Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
3629ea4c
Commit
3629ea4c
authored
Sep 26, 2007
by
Chris Robinson
Committed by
Alexandre Julliard
Oct 03, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Track async GL drawable changes.
parent
86a9b760
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
2 deletions
+55
-2
opengl.c
dlls/winex11.drv/opengl.c
+54
-2
x11drv.h
dlls/winex11.drv/x11drv.h
+1
-0
No files found.
dlls/winex11.drv/opengl.c
View file @
3629ea4c
...
...
@@ -111,6 +111,8 @@ typedef struct wine_glcontext {
BOOL
do_escape
;
X11DRV_PDEVICE
*
physDev
;
X11DRV_PDEVICE
*
pReadDev
;
Drawable
drawables
[
2
];
BOOL
refresh_drawables
;
struct
wine_glcontext
*
next
;
struct
wine_glcontext
*
prev
;
}
Wine_GLContext
;
...
...
@@ -940,6 +942,36 @@ int pixelformat_from_fbconfig_id(XID fbconfig_id)
}
/* Mark any allocated context using the glx drawable 'old' to use 'new' */
void
mark_drawable_dirty
(
Drawable
old
,
Drawable
new
)
{
Wine_GLContext
*
ctx
;
for
(
ctx
=
context_list
;
ctx
;
ctx
=
ctx
->
next
)
{
if
(
old
==
ctx
->
drawables
[
0
])
{
ctx
->
drawables
[
0
]
=
new
;
ctx
->
refresh_drawables
=
TRUE
;
}
if
(
old
==
ctx
->
drawables
[
1
])
{
ctx
->
drawables
[
1
]
=
new
;
ctx
->
refresh_drawables
=
TRUE
;
}
}
}
/* Given the current context, make sure its drawable is sync'd */
static
inline
void
sync_context
(
Wine_GLContext
*
context
)
{
if
(
context
&&
context
->
refresh_drawables
)
{
if
(
glxRequireVersion
(
3
))
pglXMakeContextCurrent
(
gdi_display
,
context
->
drawables
[
0
],
context
->
drawables
[
1
],
context
->
ctx
);
else
pglXMakeCurrent
(
gdi_display
,
context
->
drawables
[
0
],
context
->
ctx
);
context
->
refresh_drawables
=
FALSE
;
}
}
/**
* X11DRV_ChoosePixelFormat
*
...
...
@@ -1607,6 +1639,9 @@ BOOL X11DRV_wglMakeCurrent(X11DRV_PDEVICE *physDev, HGLRC hglrc) {
ctx
->
hdc
=
hdc
;
ctx
->
physDev
=
physDev
;
ctx
->
pReadDev
=
physDev
;
ctx
->
drawables
[
0
]
=
drawable
;
ctx
->
drawables
[
1
]
=
drawable
;
ctx
->
refresh_drawables
=
FALSE
;
if
(
type
==
OBJ_MEMDC
)
{
...
...
@@ -1656,6 +1691,9 @@ BOOL X11DRV_wglMakeContextCurrentARB(X11DRV_PDEVICE* pDrawDev, X11DRV_PDEVICE* p
ctx
->
hdc
=
pDrawDev
->
hdc
;
ctx
->
physDev
=
pDrawDev
;
ctx
->
pReadDev
=
pReadDev
;
ctx
->
drawables
[
0
]
=
d_draw
;
ctx
->
drawables
[
1
]
=
d_read
;
ctx
->
refresh_drawables
=
FALSE
;
ret
=
pglXMakeContextCurrent
(
gdi_display
,
d_draw
,
d_read
,
ctx
->
ctx
);
NtCurrentTeb
()
->
glContext
=
ctx
;
}
...
...
@@ -1939,17 +1977,23 @@ static inline void update_drawable(X11DRV_PDEVICE *physDev)
static
void
WINAPI
X11DRV_wglFinish
(
void
)
{
Wine_GLContext
*
ctx
=
NtCurrentTeb
()
->
glContext
;
wine_tsx11_lock
();
sync_context
(
ctx
);
pglFinish
();
update_drawable
(
((
Wine_GLContext
*
)
NtCurrentTeb
()
->
glContext
)
->
physDev
);
update_drawable
(
ctx
->
physDev
);
wine_tsx11_unlock
();
}
static
void
WINAPI
X11DRV_wglFlush
(
void
)
{
Wine_GLContext
*
ctx
=
NtCurrentTeb
()
->
glContext
;
wine_tsx11_lock
();
sync_context
(
ctx
);
pglFlush
();
update_drawable
(
((
Wine_GLContext
*
)
NtCurrentTeb
()
->
glContext
)
->
physDev
);
update_drawable
(
ctx
->
physDev
);
wine_tsx11_unlock
();
}
...
...
@@ -3203,6 +3247,8 @@ BOOL destroy_glxpixmap(Display *display, XID glxpixmap)
BOOL
X11DRV_SwapBuffers
(
X11DRV_PDEVICE
*
physDev
)
{
GLXDrawable
drawable
;
Wine_GLContext
*
ctx
=
NtCurrentTeb
()
->
glContext
;
if
(
!
has_opengl
())
{
ERR
(
"No libGL on this box - disabling OpenGL support !
\n
"
);
return
0
;
...
...
@@ -3211,7 +3257,9 @@ BOOL X11DRV_SwapBuffers(X11DRV_PDEVICE *physDev)
TRACE_
(
opengl
)(
"(%p)
\n
"
,
physDev
);
drawable
=
get_glxdrawable
(
physDev
);
wine_tsx11_lock
();
sync_context
(
ctx
);
pglXSwapBuffers
(
gdi_display
,
drawable
);
update_drawable
(
physDev
);
wine_tsx11_unlock
();
...
...
@@ -3292,6 +3340,10 @@ int pixelformat_from_fbconfig_id(XID fbconfig_id)
return
0
;
}
void
mark_drawable_dirty
(
Drawable
old
,
Drawable
new
)
{
}
/***********************************************************************
* ChoosePixelFormat (X11DRV.@)
*/
...
...
dlls/winex11.drv/x11drv.h
View file @
3629ea4c
...
...
@@ -670,6 +670,7 @@ extern BOOL X11DRV_set_win_format( HWND hwnd, XID fbconfig );
extern
int
pixelformat_from_fbconfig_id
(
XID
fbconfig_id
);
extern
XVisualInfo
*
visual_from_fbconfig_id
(
XID
fbconfig_id
);
extern
void
mark_drawable_dirty
(
Drawable
old
,
Drawable
new
);
extern
void
alloc_window_dce
(
struct
x11drv_win_data
*
data
);
extern
void
free_window_dce
(
struct
x11drv_win_data
*
data
);
...
...
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