Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
6e01e4aa
Commit
6e01e4aa
authored
Dec 12, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opengl32: Don't use ENTER_GL/LEAVE_GL around calls to driver functions.
This causes lock inversions when the driver accesses the DC.
parent
de154e73
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
43 deletions
+47
-43
wgl.c
dlls/opengl32/wgl.c
+1
-17
opengl.c
dlls/winex11.drv/opengl.c
+46
-26
No files found.
dlls/opengl32/wgl.c
View file @
6e01e4aa
...
...
@@ -569,9 +569,7 @@ BOOL WINAPI wglUseFontOutlinesW(HDC hdc,
void
WINAPI
wine_glEnable
(
GLenum
cap
)
{
TRACE
(
"(%d)
\n
"
,
cap
);
ENTER_GL
();
wine_wgl
.
p_wglEnable
(
cap
);
LEAVE_GL
();
}
/***********************************************************************
...
...
@@ -579,12 +577,8 @@ void WINAPI wine_glEnable( GLenum cap )
*/
GLboolean
WINAPI
wine_glIsEnabled
(
GLenum
cap
)
{
GLboolean
ret_value
;
TRACE
(
"(%d)
\n
"
,
cap
);
ENTER_GL
();
ret_value
=
wine_wgl
.
p_wglIsEnabled
(
cap
);
LEAVE_GL
();
return
ret_value
;
return
wine_wgl
.
p_wglIsEnabled
(
cap
);
}
/***********************************************************************
...
...
@@ -593,9 +587,7 @@ GLboolean WINAPI wine_glIsEnabled( GLenum cap )
void
WINAPI
wine_glDisable
(
GLenum
cap
)
{
TRACE
(
"(%d)
\n
"
,
cap
);
ENTER_GL
();
wine_wgl
.
p_wglDisable
(
cap
);
LEAVE_GL
();
}
/***********************************************************************
...
...
@@ -604,9 +596,7 @@ void WINAPI wine_glDisable( GLenum cap )
void
WINAPI
wine_glScissor
(
GLint
x
,
GLint
y
,
GLsizei
width
,
GLsizei
height
)
{
TRACE
(
"(%d, %d, %d, %d)
\n
"
,
x
,
y
,
width
,
height
);
ENTER_GL
();
wine_wgl
.
p_wglScissor
(
x
,
y
,
width
,
height
);
LEAVE_GL
();
}
/***********************************************************************
...
...
@@ -615,9 +605,7 @@ void WINAPI wine_glScissor( GLint x, GLint y, GLsizei width, GLsizei height )
void
WINAPI
wine_glViewport
(
GLint
x
,
GLint
y
,
GLsizei
width
,
GLsizei
height
)
{
TRACE
(
"(%d, %d, %d, %d)
\n
"
,
x
,
y
,
width
,
height
);
ENTER_GL
();
wine_wgl
.
p_wglViewport
(
x
,
y
,
width
,
height
);
LEAVE_GL
();
}
/***********************************************************************
...
...
@@ -678,11 +666,7 @@ const GLubyte * WINAPI wine_glGetString( GLenum name )
*/
void
WINAPI
wine_glGetIntegerv
(
GLenum
pname
,
GLint
*
params
)
{
ENTER_GL
();
glGetIntegerv
(
pname
,
params
);
/* A few parameters like GL_DEPTH_BITS differ between WGL and GLX, the wglGetIntegerv helper function handles those */
wine_wgl
.
p_wglGetIntegerv
(
pname
,
params
);
LEAVE_GL
();
}
...
...
dlls/winex11.drv/opengl.c
View file @
6e01e4aa
...
...
@@ -1463,6 +1463,8 @@ static void sync_current_drawable(void)
width
=
ctx
->
physDev
->
dc_rect
.
right
-
ctx
->
physDev
->
dc_rect
.
left
;
height
=
ctx
->
physDev
->
dc_rect
.
bottom
-
ctx
->
physDev
->
dc_rect
.
top
;
wine_tsx11_lock
();
pglViewport
(
ctx
->
physDev
->
dc_rect
.
left
+
ctx
->
viewport
.
left
,
dy
+
ctx
->
viewport
.
top
,
ctx
->
viewport
.
right
?
(
ctx
->
viewport
.
right
-
ctx
->
viewport
.
left
)
:
width
,
...
...
@@ -1478,6 +1480,7 @@ static void sync_current_drawable(void)
else
pglScissor
(
ctx
->
physDev
->
dc_rect
.
left
,
dy
,
width
,
height
);
wine_tsx11_unlock
();
}
}
...
...
@@ -1796,7 +1799,9 @@ static void WINAPI X11DRV_wglDisable(GLenum cap)
}
else
{
pglDisable
(
cap
);
wine_tsx11_lock
();
pglDisable
(
cap
);
wine_tsx11_unlock
();
}
}
...
...
@@ -1809,35 +1814,49 @@ static void WINAPI X11DRV_wglEnable(GLenum cap)
}
else
{
pglEnable
(
cap
);
wine_tsx11_lock
();
pglEnable
(
cap
);
wine_tsx11_unlock
();
}
}
/* WGL helper function which handles differences in glGetIntegerv from WGL and GLX */
static
void
WINAPI
X11DRV_wglGetIntegerv
(
GLenum
pname
,
GLint
*
params
)
{
TRACE
(
"pname: 0x%x, params: %p
\n
"
,
pname
,
params
);
if
(
pname
==
GL_DEPTH_BITS
)
{
GLXContext
gl_ctx
=
pglXGetCurrentContext
();
Wine_GLContext
*
ret
=
get_context_from_GLXContext
(
gl_ctx
);
/*TRACE("returns Wine Ctx as %p\n", ret);*/
/**
* if we cannot find a Wine Context
* we only have the default wine desktop context,
* so if we have only a 24 depth say we have 32
*/
if
(
NULL
==
ret
&&
24
==
*
params
)
{
*
params
=
32
;
static
void
WINAPI
X11DRV_wglGetIntegerv
(
GLenum
pname
,
GLint
*
params
)
{
wine_tsx11_lock
();
switch
(
pname
)
{
case
GL_DEPTH_BITS
:
{
GLXContext
gl_ctx
=
pglXGetCurrentContext
();
Wine_GLContext
*
ret
=
get_context_from_GLXContext
(
gl_ctx
);
pglGetIntegerv
(
pname
,
params
);
/**
* if we cannot find a Wine Context
* we only have the default wine desktop context,
* so if we have only a 24 depth say we have 32
*/
if
(
NULL
==
ret
&&
24
==
*
params
)
{
*
params
=
32
;
}
TRACE
(
"returns GL_DEPTH_BITS as '%d'
\n
"
,
*
params
);
break
;
}
TRACE
(
"returns GL_DEPTH_BITS as '%d'
\n
"
,
*
params
);
}
if
(
pname
==
GL_ALPHA_BITS
)
{
GLint
tmp
;
GLXContext
gl_ctx
=
pglXGetCurrentContext
();
Wine_GLContext
*
ret
=
get_context_from_GLXContext
(
gl_ctx
);
pglXGetFBConfigAttrib
(
ret
->
display
,
ret
->
fb_conf
,
GLX_ALPHA_SIZE
,
&
tmp
);
TRACE
(
"returns GL_ALPHA_BITS as '%d'
\n
"
,
tmp
);
*
params
=
tmp
;
case
GL_ALPHA_BITS
:
{
GLXContext
gl_ctx
=
pglXGetCurrentContext
();
Wine_GLContext
*
ret
=
get_context_from_GLXContext
(
gl_ctx
);
pglXGetFBConfigAttrib
(
ret
->
display
,
ret
->
fb_conf
,
GLX_ALPHA_SIZE
,
params
);
TRACE
(
"returns GL_ALPHA_BITS as '%d'
\n
"
,
*
params
);
break
;
}
default
:
pglGetIntegerv
(
pname
,
params
);
break
;
}
wine_tsx11_unlock
();
}
static
GLboolean
WINAPI
X11DRV_wglIsEnabled
(
GLenum
cap
)
...
...
@@ -1851,9 +1870,10 @@ static GLboolean WINAPI X11DRV_wglIsEnabled(GLenum cap)
}
else
{
enabled
=
pglIsEnabled
(
cap
);
wine_tsx11_lock
();
enabled
=
pglIsEnabled
(
cap
);
wine_tsx11_unlock
();
}
return
enabled
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment