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
6419edfb
Commit
6419edfb
authored
Mar 09, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add a mechanism for stacking gdi drivers.
parent
ec54c80e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
56 additions
and
18 deletions
+56
-18
dc.c
dlls/gdi32/dc.c
+41
-11
init.c
dlls/gdi32/enhmfdrv/init.c
+1
-2
gdi_private.h
dlls/gdi32/gdi_private.h
+11
-1
init.c
dlls/gdi32/mfdrv/init.c
+1
-2
psdrv.h
dlls/wineps.drv/psdrv.h
+1
-1
x11drv.h
dlls/winex11.drv/x11drv.h
+1
-1
No files found.
dlls/gdi32/dc.c
View file @
6419edfb
...
...
@@ -79,7 +79,8 @@ DC *alloc_dc_ptr( const DC_FUNCTIONS *funcs, WORD magic )
dc
->
funcs
=
funcs
;
dc
->
nulldrv
.
funcs
=
&
null_driver
;
dc
->
physDev
=
NULL
;
dc
->
nulldrv
.
next
=
NULL
;
dc
->
physDev
=
&
dc
->
nulldrv
;
dc
->
thread
=
GetCurrentThreadId
();
dc
->
refcount
=
1
;
dc
->
dirty
=
0
;
...
...
@@ -229,6 +230,34 @@ void update_dc( DC *dc )
/***********************************************************************
* push_dc_driver
*
* Push a driver on top of the DC driver stack.
*/
void
push_dc_driver
(
DC
*
dc
,
PHYSDEV
physdev
)
{
physdev
->
next
=
dc
->
physDev
;
physdev
->
hdc
=
dc
->
hSelf
;
dc
->
physDev
=
physdev
;
dc
->
funcs
=
physdev
->
funcs
;
}
/***********************************************************************
* pop_dc_driver
*
* Pop the top driver from the DC driver stack.
*/
void
pop_dc_driver
(
DC
*
dc
,
PHYSDEV
physdev
)
{
assert
(
physdev
==
dc
->
physDev
);
assert
(
physdev
!=
&
dc
->
nulldrv
);
dc
->
physDev
=
physdev
->
next
;
dc
->
funcs
=
dc
->
physDev
->
funcs
;
}
/***********************************************************************
* DC_DeleteObject
*/
static
BOOL
DC_DeleteObject
(
HGDIOBJ
handle
)
...
...
@@ -633,6 +662,7 @@ HDC WINAPI CreateDCW( LPCWSTR driver, LPCWSTR device, LPCWSTR output,
{
HDC
hdc
;
DC
*
dc
;
PHYSDEV
physdev
;
const
DC_FUNCTIONS
*
funcs
;
WCHAR
buf
[
300
];
...
...
@@ -663,14 +693,15 @@ HDC WINAPI CreateDCW( LPCWSTR driver, LPCWSTR device, LPCWSTR output,
debugstr_w
(
driver
),
debugstr_w
(
device
),
debugstr_w
(
output
),
dc
->
hSelf
);
if
(
dc
->
funcs
->
pCreateDC
&&
!
dc
->
funcs
->
pCreateDC
(
hdc
,
&
dc
->
physD
ev
,
buf
,
device
,
output
,
initData
))
!
dc
->
funcs
->
pCreateDC
(
hdc
,
&
physd
ev
,
buf
,
device
,
output
,
initData
))
{
WARN
(
"creation aborted by device
\n
"
);
goto
error
;
}
dc
->
physDev
->
funcs
=
funcs
;
dc
->
physDev
->
hdc
=
hdc
;
physdev
->
funcs
=
funcs
;
push_dc_driver
(
dc
,
physdev
);
dc
->
vis_rect
.
left
=
0
;
dc
->
vis_rect
.
top
=
0
;
dc
->
vis_rect
.
right
=
GetDeviceCaps
(
hdc
,
DESKTOPHORZRES
);
...
...
@@ -782,21 +813,20 @@ HDC WINAPI CreateCompatibleDC( HDC hdc )
dc
->
vis_rect
.
bottom
=
1
;
if
(
!
(
dc
->
hVisRgn
=
CreateRectRgn
(
0
,
0
,
1
,
1
)))
goto
error
;
/* default bitmap is 1x1 */
/* Copy the driver-specific physical device info into
* the new DC. The driver may use this read-only info
* while creating the compatible DC below. */
dc
->
physDev
=
physDev
;
ret
=
dc
->
hSelf
;
/* Pass the driver-specific physical device info into
* the new DC. The driver may use this read-only info
* while creating the compatible DC. */
if
(
dc
->
funcs
->
pCreateDC
&&
!
dc
->
funcs
->
pCreateDC
(
dc
->
hSelf
,
&
dc
->
physDev
,
NULL
,
NULL
,
NULL
,
NULL
))
!
dc
->
funcs
->
pCreateDC
(
dc
->
hSelf
,
&
physDev
,
NULL
,
NULL
,
NULL
,
NULL
))
{
WARN
(
"creation aborted by device
\n
"
);
goto
error
;
}
dc
->
physDev
->
funcs
=
funcs
;
dc
->
physDev
->
hdc
=
hdc
;
physDev
->
funcs
=
funcs
;
push_dc_driver
(
dc
,
physDev
)
;
DC_InitDC
(
dc
);
release_dc_ptr
(
dc
);
return
ret
;
...
...
dlls/gdi32/enhmfdrv/init.c
View file @
6419edfb
...
...
@@ -319,9 +319,8 @@ HDC WINAPI CreateEnhMetaFileW(
free_dc_ptr
(
dc
);
return
0
;
}
dc
->
physDev
=
(
PHYSDEV
)
physDev
;
physDev
->
dev
.
funcs
=
&
EMFDRV_Funcs
;
p
hysDev
->
dev
.
hdc
=
dc
->
hSelf
;
p
ush_dc_driver
(
dc
,
&
physDev
->
dev
)
;
physDev
->
hdc
=
dc
->
hSelf
;
if
(
description
)
{
/* App name\0Title\0\0 */
...
...
dlls/gdi32/gdi_private.h
View file @
6419edfb
...
...
@@ -75,6 +75,7 @@ typedef struct tagGDIOBJHDR
typedef
struct
gdi_physdev
{
const
struct
tagDC_FUNCS
*
funcs
;
struct
gdi_physdev
*
next
;
HDC
hdc
;
}
*
PHYSDEV
;
...
...
@@ -377,6 +378,8 @@ extern BOOL free_dc_ptr( DC *dc ) DECLSPEC_HIDDEN;
extern
DC
*
get_dc_ptr
(
HDC
hdc
)
DECLSPEC_HIDDEN
;
extern
void
release_dc_ptr
(
DC
*
dc
)
DECLSPEC_HIDDEN
;
extern
void
update_dc
(
DC
*
dc
)
DECLSPEC_HIDDEN
;
extern
void
push_dc_driver
(
DC
*
dc
,
PHYSDEV
physdev
)
DECLSPEC_HIDDEN
;
extern
void
pop_dc_driver
(
DC
*
dc
,
PHYSDEV
physdev
)
DECLSPEC_HIDDEN
;
extern
void
DC_InitDC
(
DC
*
dc
)
DECLSPEC_HIDDEN
;
extern
void
DC_UpdateXforms
(
DC
*
dc
)
DECLSPEC_HIDDEN
;
extern
INT
save_dc_state
(
HDC
hdc
)
DECLSPEC_HIDDEN
;
...
...
@@ -395,7 +398,14 @@ extern const DC_FUNCTIONS *DRIVER_get_display_driver(void) DECLSPEC_HIDDEN;
extern
const
DC_FUNCTIONS
*
DRIVER_load_driver
(
LPCWSTR
name
)
DECLSPEC_HIDDEN
;
extern
BOOL
DRIVER_GetDriverName
(
LPCWSTR
device
,
LPWSTR
driver
,
DWORD
size
)
DECLSPEC_HIDDEN
;
#define GET_DC_PHYSDEV(dc,func) ((dc)->physDev->funcs->func ? (dc)->physDev : &(dc)->nulldrv)
static
inline
PHYSDEV
get_physdev_entry_point
(
PHYSDEV
dev
,
size_t
offset
)
{
while
(
!
((
void
**
)
dev
->
funcs
)[
offset
/
sizeof
(
void
*
)])
dev
=
dev
->
next
;
return
dev
;
}
#define GET_DC_PHYSDEV(dc,func) get_physdev_entry_point( (dc)->physDev, FIELD_OFFSET(DC_FUNCTIONS,func))
#define GET_NEXT_PHYSDEV(dev,func) get_physdev_entry_point( (dev)->next, FIELD_OFFSET(DC_FUNCTIONS,func))
/* enhmetafile.c */
extern
HENHMETAFILE
EMF_Create_HENHMETAFILE
(
ENHMETAHEADER
*
emh
,
BOOL
on_disk
)
DECLSPEC_HIDDEN
;
...
...
dlls/gdi32/mfdrv/init.c
View file @
6419edfb
...
...
@@ -171,9 +171,8 @@ static DC *MFDRV_AllocMetaFile(void)
free_dc_ptr
(
dc
);
return
NULL
;
}
dc
->
physDev
=
(
PHYSDEV
)
physDev
;
physDev
->
dev
.
funcs
=
&
MFDRV_Funcs
;
p
hysDev
->
dev
.
hdc
=
dc
->
hSelf
;
p
ush_dc_driver
(
dc
,
&
physDev
->
dev
)
;
physDev
->
hdc
=
dc
->
hSelf
;
if
(
!
(
physDev
->
mh
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
physDev
->
mh
)
)))
...
...
dlls/wineps.drv/psdrv.h
View file @
6419edfb
...
...
@@ -353,7 +353,7 @@ typedef struct {
typedef
struct
{
void
*
reserved
[
2
];
/* reserved for gdi */
void
*
reserved
[
3
];
/* reserved for gdi */
HDC
hdc
;
PSFONT
font
;
/* Current PS font */
DOWNLOAD
*
downloaded_fonts
;
...
...
dlls/winex11.drv/x11drv.h
View file @
6419edfb
...
...
@@ -144,7 +144,7 @@ struct xrender_info;
/* X physical device */
typedef
struct
{
void
*
reserved
[
2
];
/* reserved for gdi */
void
*
reserved
[
3
];
/* reserved for gdi */
HDC
hdc
;
GC
gc
;
/* X Window GC */
Drawable
drawable
;
...
...
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