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
e94d3b4e
Commit
e94d3b4e
authored
May 08, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add a priority mechanism for pushing drivers on the stack in a defined order.
parent
03c75b9c
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
114 additions
and
36 deletions
+114
-36
bitmap.c
dlls/gdi32/bitmap.c
+4
-11
dc.c
dlls/gdi32/dc.c
+2
-1
dib.c
dlls/gdi32/dib.c
+2
-5
dc.c
dlls/gdi32/dibdrv/dc.c
+2
-0
driver.c
dlls/gdi32/driver.c
+2
-0
init.c
dlls/gdi32/enhmfdrv/init.c
+14
-1
freetype.c
dlls/gdi32/freetype.c
+13
-1
gdi_private.h
dlls/gdi32/gdi_private.h
+9
-0
init.c
dlls/gdi32/mfdrv/init.c
+14
-1
path.c
dlls/gdi32/path.c
+14
-4
init.c
dlls/wineps.drv/init.c
+13
-1
init.c
dlls/winex11.drv/init.c
+1
-0
xrender.c
dlls/winex11.drv/xrender.c
+13
-1
gdi_driver.h
include/wine/gdi_driver.h
+11
-10
No files found.
dlls/gdi32/bitmap.c
View file @
e94d3b4e
...
...
@@ -545,7 +545,7 @@ static HGDIOBJ BITMAP_SelectObject( HGDIOBJ handle, HDC hdc )
HGDIOBJ
ret
;
BITMAPOBJ
*
bitmap
;
DC
*
dc
;
PHYSDEV
physdev
=
NULL
,
old_physdev
=
NULL
,
pathdev
=
NULL
;
PHYSDEV
physdev
=
NULL
,
old_physdev
=
NULL
;
if
(
!
(
dc
=
get_dc_ptr
(
hdc
)))
return
0
;
...
...
@@ -571,11 +571,7 @@ static HGDIOBJ BITMAP_SelectObject( HGDIOBJ handle, HDC hdc )
goto
done
;
}
if
(
dc
->
physDev
->
funcs
==
&
path_driver
)
pathdev
=
pop_dc_driver
(
&
dc
->
physDev
);
old_physdev
=
GET_DC_PHYSDEV
(
dc
,
pSelectBitmap
);
if
(
old_physdev
==
dc
->
dibdrv
)
old_physdev
=
pop_dc_driver
(
&
dc
->
physDev
);
if
(
dc
->
dibdrv
)
old_physdev
=
pop_dc_driver
(
dc
,
dc
->
dibdrv
);
physdev
=
GET_DC_PHYSDEV
(
dc
,
pSelectBitmap
);
if
(
physdev
->
funcs
==
&
null_driver
)
...
...
@@ -618,12 +614,9 @@ static HGDIOBJ BITMAP_SelectObject( HGDIOBJ handle, HDC hdc )
done:
if
(
!
ret
)
{
if
(
physdev
&&
physdev
==
dc
->
dibdrv
)
pop_dc_driver
(
&
dc
->
physDev
);
if
(
old_physdev
&&
old_physdev
==
dc
->
dibdrv
)
push_dc_driver
(
&
dc
->
physDev
,
old_physdev
,
old_physdev
->
funcs
);
if
(
physdev
&&
physdev
==
dc
->
dibdrv
)
pop_dc_driver
(
dc
,
dc
->
dibdrv
);
if
(
old_physdev
)
push_dc_driver
(
&
dc
->
physDev
,
old_physdev
,
old_physdev
->
funcs
);
}
if
(
pathdev
)
push_dc_driver
(
&
dc
->
physDev
,
pathdev
,
pathdev
->
funcs
);
release_dc_ptr
(
dc
);
return
ret
;
}
...
...
dlls/gdi32/dc.c
View file @
e94d3b4e
...
...
@@ -156,7 +156,8 @@ void free_dc_ptr( DC *dc )
while
(
dc
->
physDev
!=
&
dc
->
nulldrv
)
{
PHYSDEV
physdev
=
pop_dc_driver
(
&
dc
->
physDev
);
PHYSDEV
physdev
=
dc
->
physDev
;
dc
->
physDev
=
physdev
->
next
;
physdev
->
funcs
->
pDeleteDC
(
physdev
);
if
(
physdev
==
dc
->
dibdrv
)
dc
->
dibdrv
=
NULL
;
}
...
...
dlls/gdi32/dib.c
View file @
e94d3b4e
...
...
@@ -1570,7 +1570,7 @@ static HGDIOBJ DIB_SelectObject( HGDIOBJ handle, HDC hdc )
HGDIOBJ
ret
;
BITMAPOBJ
*
bitmap
;
DC
*
dc
;
PHYSDEV
physdev
=
NULL
,
old_physdev
=
NULL
,
pathdev
=
NULL
;
PHYSDEV
physdev
=
NULL
,
old_physdev
=
NULL
;
if
(
!
(
dc
=
get_dc_ptr
(
hdc
)))
return
0
;
...
...
@@ -1596,8 +1596,6 @@ static HGDIOBJ DIB_SelectObject( HGDIOBJ handle, HDC hdc )
goto
done
;
}
if
(
dc
->
physDev
->
funcs
==
&
path_driver
)
pathdev
=
pop_dc_driver
(
&
dc
->
physDev
);
old_physdev
=
GET_DC_PHYSDEV
(
dc
,
pSelectBitmap
);
physdev
=
dc
->
dibdrv
;
if
(
old_physdev
!=
dc
->
dibdrv
)
...
...
@@ -1633,9 +1631,8 @@ static HGDIOBJ DIB_SelectObject( HGDIOBJ handle, HDC hdc )
done:
if
(
!
ret
)
{
if
(
old_physdev
&&
old_physdev
!=
dc
->
dibdrv
)
pop_dc_driver
(
&
dc
->
physDe
v
);
if
(
old_physdev
&&
old_physdev
!=
dc
->
dibdrv
)
pop_dc_driver
(
dc
,
dc
->
dibdr
v
);
}
if
(
pathdev
)
push_dc_driver
(
&
dc
->
physDev
,
pathdev
,
pathdev
->
funcs
);
release_dc_ptr
(
dc
);
return
ret
;
}
...
...
dlls/gdi32/dibdrv/dc.c
View file @
e94d3b4e
...
...
@@ -742,4 +742,6 @@ const struct gdi_dc_funcs dib_driver =
dibdrv_wglShareLists
,
/* pwglShareLists */
dibdrv_wglUseFontBitmapsA
,
/* pwglUseFontBitmapsA */
dibdrv_wglUseFontBitmapsW
,
/* pwglUseFontBitmapsW */
GDI_PRIORITY_DIB_DRV
/* priority */
};
dlls/gdi32/driver.c
View file @
e94d3b4e
...
...
@@ -875,6 +875,8 @@ const struct gdi_dc_funcs null_driver =
nulldrv_wglShareLists
,
/* pwglShareLists */
nulldrv_wglUseFontBitmapsA
,
/* pwglUseFontBitmapsA */
nulldrv_wglUseFontBitmapsW
,
/* pwglUseFontBitmapsW */
GDI_PRIORITY_NULL_DRV
/* priority */
};
...
...
dlls/gdi32/enhmfdrv/init.c
View file @
e94d3b4e
...
...
@@ -169,7 +169,20 @@ static const struct gdi_dc_funcs EMFDRV_Funcs =
EMFDRV_StrokePath
,
/* pStrokePath */
NULL
,
/* pSwapBuffers */
NULL
,
/* pUnrealizePalette */
EMFDRV_WidenPath
/* pWidenPath */
EMFDRV_WidenPath
,
/* pWidenPath */
NULL
,
/* pwglCopyContext */
NULL
,
/* pwglCreateContext */
NULL
,
/* pwglCreateContextAttribsARB */
NULL
,
/* pwglDeleteContext */
NULL
,
/* pwglGetPbufferDCARB */
NULL
,
/* pwglGetProcAddress */
NULL
,
/* pwglMakeContextCurrentARB */
NULL
,
/* pwglMakeCurrent */
NULL
,
/* pwglSetPixelFormatWINE */
NULL
,
/* pwglShareLists */
NULL
,
/* pwglUseFontBitmapsA */
NULL
,
/* pwglUseFontBitmapsW */
GDI_PRIORITY_GRAPHICS_DRV
/* priority */
};
...
...
dlls/gdi32/freetype.c
View file @
e94d3b4e
...
...
@@ -7874,7 +7874,19 @@ static const struct gdi_dc_funcs freetype_funcs =
NULL
,
/* pSwapBuffers */
NULL
,
/* pUnrealizePalette */
NULL
,
/* pWidenPath */
/* OpenGL not supported */
NULL
,
/* pwglCopyContext */
NULL
,
/* pwglCreateContext */
NULL
,
/* pwglCreateContextAttribsARB */
NULL
,
/* pwglDeleteContext */
NULL
,
/* pwglGetPbufferDCARB */
NULL
,
/* pwglGetProcAddress */
NULL
,
/* pwglMakeContextCurrentARB */
NULL
,
/* pwglMakeCurrent */
NULL
,
/* pwglSetPixelFormatWINE */
NULL
,
/* pwglShareLists */
NULL
,
/* pwglUseFontBitmapsA */
NULL
,
/* pwglUseFontBitmapsW */
GDI_PRIORITY_FONT_DRV
/* priority */
};
#else
/* HAVE_FREETYPE */
...
...
dlls/gdi32/gdi_private.h
View file @
e94d3b4e
...
...
@@ -170,6 +170,15 @@ static inline INT GDI_ROUND(double val)
#define GET_DC_PHYSDEV(dc,func) \
get_physdev_entry_point( (dc)->physDev, FIELD_OFFSET(struct gdi_dc_funcs,func))
static
inline
PHYSDEV
pop_dc_driver
(
DC
*
dc
,
PHYSDEV
dev
)
{
PHYSDEV
*
pdev
=
&
dc
->
physDev
;
while
(
*
pdev
&&
*
pdev
!=
dev
)
pdev
=
&
(
*
pdev
)
->
next
;
if
(
!*
pdev
)
return
NULL
;
*
pdev
=
dev
->
next
;
return
dev
;
}
/* bitmap object */
typedef
struct
tagBITMAPOBJ
...
...
dlls/gdi32/mfdrv/init.c
View file @
e94d3b4e
...
...
@@ -232,7 +232,20 @@ static const struct gdi_dc_funcs MFDRV_Funcs =
MFDRV_StrokePath
,
/* pStrokePath */
NULL
,
/* pSwapBuffers */
NULL
,
/* pUnrealizePalette */
MFDRV_WidenPath
/* pWidenPath */
MFDRV_WidenPath
,
/* pWidenPath */
NULL
,
/* pwglCopyContext */
NULL
,
/* pwglCreateContext */
NULL
,
/* pwglCreateContextAttribsARB */
NULL
,
/* pwglDeleteContext */
NULL
,
/* pwglGetPbufferDCARB */
NULL
,
/* pwglGetProcAddress */
NULL
,
/* pwglMakeContextCurrentARB */
NULL
,
/* pwglMakeCurrent */
NULL
,
/* pwglSetPixelFormatWINE */
NULL
,
/* pwglShareLists */
NULL
,
/* pwglUseFontBitmapsA */
NULL
,
/* pwglUseFontBitmapsW */
GDI_PRIORITY_GRAPHICS_DRV
/* priority */
};
...
...
dlls/gdi32/path.c
View file @
e94d3b4e
...
...
@@ -103,9 +103,7 @@ static inline struct path_physdev *get_path_physdev( PHYSDEV dev )
static
inline
void
pop_path_driver
(
DC
*
dc
,
struct
path_physdev
*
physdev
)
{
PHYSDEV
*
dev
=
&
dc
->
physDev
;
while
(
*
dev
!=
&
physdev
->
dev
)
dev
=
&
(
*
dev
)
->
next
;
*
dev
=
physdev
->
dev
.
next
;
pop_dc_driver
(
dc
,
&
physdev
->
dev
);
HeapFree
(
GetProcessHeap
(),
0
,
physdev
);
}
...
...
@@ -2369,5 +2367,17 @@ const struct gdi_dc_funcs path_driver =
NULL
,
/* pSwapBuffers */
NULL
,
/* pUnrealizePalette */
NULL
,
/* pWidenPath */
/* OpenGL not supported */
NULL
,
/* pwglCopyContext */
NULL
,
/* pwglCreateContext */
NULL
,
/* pwglCreateContextAttribsARB */
NULL
,
/* pwglDeleteContext */
NULL
,
/* pwglGetPbufferDCARB */
NULL
,
/* pwglGetProcAddress */
NULL
,
/* pwglMakeContextCurrentARB */
NULL
,
/* pwglMakeCurrent */
NULL
,
/* pwglSetPixelFormatWINE */
NULL
,
/* pwglShareLists */
NULL
,
/* pwglUseFontBitmapsA */
NULL
,
/* pwglUseFontBitmapsW */
GDI_PRIORITY_PATH_DRV
/* priority */
};
dlls/wineps.drv/init.c
View file @
e94d3b4e
...
...
@@ -952,7 +952,19 @@ static const struct gdi_dc_funcs psdrv_funcs =
NULL
,
/* pSwapBuffers */
NULL
,
/* pUnrealizePalette */
NULL
,
/* pWidenPath */
/* OpenGL not supported */
NULL
,
/* pwglCopyContext */
NULL
,
/* pwglCreateContext */
NULL
,
/* pwglCreateContextAttribsARB */
NULL
,
/* pwglDeleteContext */
NULL
,
/* pwglGetPbufferDCARB */
NULL
,
/* pwglGetProcAddress */
NULL
,
/* pwglMakeContextCurrentARB */
NULL
,
/* pwglMakeCurrent */
NULL
,
/* pwglSetPixelFormatWINE */
NULL
,
/* pwglShareLists */
NULL
,
/* pwglUseFontBitmapsA */
NULL
,
/* pwglUseFontBitmapsW */
GDI_PRIORITY_GRAPHICS_DRV
/* priority */
};
...
...
dlls/winex11.drv/init.c
View file @
e94d3b4e
...
...
@@ -583,6 +583,7 @@ static const struct gdi_dc_funcs x11drv_funcs =
X11DRV_wglShareLists
,
/* pwglShareLists */
X11DRV_wglUseFontBitmapsA
,
/* pwglUseFontBitmapsA */
X11DRV_wglUseFontBitmapsW
,
/* pwglUseFontBitmapsW */
GDI_PRIORITY_GRAPHICS_DRV
/* priority */
};
...
...
dlls/winex11.drv/xrender.c
View file @
e94d3b4e
...
...
@@ -2780,7 +2780,19 @@ static const struct gdi_dc_funcs xrender_funcs =
NULL
,
/* pSwapBuffers */
NULL
,
/* pUnrealizePalette */
NULL
,
/* pWidenPath */
/* OpenGL not supported */
NULL
,
/* pwglCopyContext */
NULL
,
/* pwglCreateContext */
NULL
,
/* pwglCreateContextAttribsARB */
NULL
,
/* pwglDeleteContext */
NULL
,
/* pwglGetPbufferDCARB */
NULL
,
/* pwglGetProcAddress */
NULL
,
/* pwglMakeContextCurrentARB */
NULL
,
/* pwglMakeCurrent */
NULL
,
/* pwglSetPixelFormatWINE */
NULL
,
/* pwglShareLists */
NULL
,
/* pwglUseFontBitmapsA */
NULL
,
/* pwglUseFontBitmapsW */
GDI_PRIORITY_GRAPHICS_DRV
+
10
/* priority */
};
#else
/* SONAME_LIBXRENDER */
...
...
include/wine/gdi_driver.h
View file @
e94d3b4e
...
...
@@ -196,8 +196,6 @@ struct gdi_dc_funcs
BOOL
(
*
pSwapBuffers
)(
PHYSDEV
);
BOOL
(
*
pUnrealizePalette
)(
HPALETTE
);
BOOL
(
*
pWidenPath
)(
PHYSDEV
);
/* OpenGL32 */
BOOL
(
*
pwglCopyContext
)(
HGLRC
,
HGLRC
,
UINT
);
HGLRC
(
*
pwglCreateContext
)(
PHYSDEV
);
HGLRC
(
*
pwglCreateContextAttribsARB
)(
PHYSDEV
,
HGLRC
,
const
int
*
);
...
...
@@ -210,10 +208,19 @@ struct gdi_dc_funcs
BOOL
(
*
pwglShareLists
)(
HGLRC
,
HGLRC
);
BOOL
(
*
pwglUseFontBitmapsA
)(
PHYSDEV
,
DWORD
,
DWORD
,
DWORD
);
BOOL
(
*
pwglUseFontBitmapsW
)(
PHYSDEV
,
DWORD
,
DWORD
,
DWORD
);
/* priority order for the driver on the stack */
UINT
priority
;
};
/* increment this when you change the DC function table */
#define WINE_GDI_DRIVER_VERSION 26
#define WINE_GDI_DRIVER_VERSION 27
#define GDI_PRIORITY_NULL_DRV 0
/* null driver */
#define GDI_PRIORITY_FONT_DRV 100
/* any font driver */
#define GDI_PRIORITY_GRAPHICS_DRV 200
/* any graphics driver */
#define GDI_PRIORITY_DIB_DRV 300
/* the DIB driver */
#define GDI_PRIORITY_PATH_DRV 400
/* the path driver */
static
inline
PHYSDEV
get_physdev_entry_point
(
PHYSDEV
dev
,
size_t
offset
)
{
...
...
@@ -226,17 +233,11 @@ static inline PHYSDEV get_physdev_entry_point( PHYSDEV dev, size_t offset )
static
inline
void
push_dc_driver
(
PHYSDEV
*
dev
,
PHYSDEV
physdev
,
const
struct
gdi_dc_funcs
*
funcs
)
{
while
((
*
dev
)
->
funcs
->
priority
>
funcs
->
priority
)
dev
=
&
(
*
dev
)
->
next
;
physdev
->
funcs
=
funcs
;
physdev
->
next
=
*
dev
;
physdev
->
hdc
=
(
*
dev
)
->
hdc
;
*
dev
=
physdev
;
}
static
inline
PHYSDEV
pop_dc_driver
(
PHYSDEV
*
dev
)
{
PHYSDEV
ret
=
*
dev
;
*
dev
=
ret
->
next
;
return
ret
;
}
#endif
/* __WINE_WINE_GDI_DRIVER_H */
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