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
b74a33d9
Commit
b74a33d9
authored
Sep 12, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Store the XRender info structure inside the XRender physdev object.
parent
40957d02
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
37 deletions
+48
-37
init.c
dlls/winex11.drv/init.c
+0
-2
x11drv.h
dlls/winex11.drv/x11drv.h
+0
-1
xrender.c
dlls/winex11.drv/xrender.c
+48
-34
No files found.
dlls/winex11.drv/init.c
View file @
b74a33d9
...
...
@@ -193,8 +193,6 @@ static BOOL X11DRV_DeleteDC( PHYSDEV dev )
{
X11DRV_PDEVICE
*
physDev
=
get_x11drv_dev
(
dev
);
if
(
physDev
->
xrender
)
X11DRV_XRender_DeleteDC
(
physDev
);
DeleteObject
(
physDev
->
region
);
wine_tsx11_lock
();
XFreeGC
(
gdi_display
,
physDev
->
gc
);
...
...
dlls/winex11.drv/x11drv.h
View file @
b74a33d9
...
...
@@ -305,7 +305,6 @@ extern const struct gdi_dc_funcs *X11DRV_XRender_Init(void) DECLSPEC_HIDDEN;
extern
void
X11DRV_XRender_Finalize
(
void
)
DECLSPEC_HIDDEN
;
extern
BOOL
X11DRV_XRender_SelectFont
(
X11DRV_PDEVICE
*
,
HFONT
)
DECLSPEC_HIDDEN
;
extern
void
X11DRV_XRender_SetDeviceClipping
(
X11DRV_PDEVICE
*
physDev
,
const
RGNDATA
*
data
)
DECLSPEC_HIDDEN
;
extern
void
X11DRV_XRender_DeleteDC
(
X11DRV_PDEVICE
*
)
DECLSPEC_HIDDEN
;
extern
void
X11DRV_XRender_CopyBrush
(
X11DRV_PDEVICE
*
physDev
,
X_PHYSBITMAP
*
physBitmap
,
int
width
,
int
height
)
DECLSPEC_HIDDEN
;
extern
BOOL
X11DRV_XRender_ExtTextOut
(
X11DRV_PDEVICE
*
physDev
,
INT
x
,
INT
y
,
UINT
flags
,
const
RECT
*
lprect
,
LPCWSTR
wstr
,
...
...
dlls/winex11.drv/xrender.c
View file @
b74a33d9
...
...
@@ -156,6 +156,7 @@ struct xrender_physdev
{
struct
gdi_physdev
dev
;
X11DRV_PDEVICE
*
x11dev
;
struct
xrender_info
info
;
};
static
inline
struct
xrender_physdev
*
get_xrender_dev
(
PHYSDEV
dev
)
...
...
@@ -622,6 +623,29 @@ static Picture get_xrender_picture_source(X11DRV_PDEVICE *physDev, BOOL repeat)
return
info
->
pict_src
;
}
static
void
free_xrender_picture
(
struct
xrender_physdev
*
dev
)
{
if
(
dev
->
info
.
pict
||
dev
->
info
.
pict_src
)
{
wine_tsx11_lock
();
XFlush
(
gdi_display
);
if
(
dev
->
info
.
pict
)
{
TRACE
(
"freeing pict = %lx dc = %p
\n
"
,
dev
->
info
.
pict
,
dev
->
dev
.
hdc
);
pXRenderFreePicture
(
gdi_display
,
dev
->
info
.
pict
);
dev
->
info
.
pict
=
0
;
}
if
(
dev
->
info
.
pict_src
)
{
TRACE
(
"freeing pict = %lx dc = %p
\n
"
,
dev
->
info
.
pict_src
,
dev
->
dev
.
hdc
);
pXRenderFreePicture
(
gdi_display
,
dev
->
info
.
pict_src
);
dev
->
info
.
pict_src
=
0
;
}
wine_tsx11_unlock
();
}
dev
->
info
.
format
=
NULL
;
}
/* return a mask picture used to force alpha to 0 */
static
Picture
get_no_alpha_mask
(
void
)
{
...
...
@@ -1112,18 +1136,28 @@ void X11DRV_XRender_SetDeviceClipping(X11DRV_PDEVICE *physDev, const RGNDATA *da
}
}
static
BOOL
create_xrender_dc
(
PHYSDEV
*
pdev
)
{
X11DRV_PDEVICE
*
x11dev
=
get_x11drv_dev
(
*
pdev
);
struct
xrender_physdev
*
physdev
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
physdev
)
);
if
(
!
physdev
)
return
FALSE
;
physdev
->
x11dev
=
x11dev
;
physdev
->
info
.
cache_index
=
-
1
;
physdev
->
info
.
format
=
get_xrender_format_from_color_shifts
(
x11dev
->
depth
,
x11dev
->
color_shifts
);
x11dev
->
xrender
=
&
physdev
->
info
;
push_dc_driver
(
pdev
,
&
physdev
->
dev
,
&
xrender_funcs
);
return
TRUE
;
}
/**********************************************************************
* xrenderdrv_CreateDC
*/
static
BOOL
xrenderdrv_CreateDC
(
PHYSDEV
*
pdev
,
LPCWSTR
driver
,
LPCWSTR
device
,
LPCWSTR
output
,
const
DEVMODEW
*
initData
)
{
struct
xrender_physdev
*
physdev
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
physdev
)
);
if
(
!
physdev
)
return
FALSE
;
physdev
->
x11dev
=
get_x11drv_dev
(
*
pdev
);
push_dc_driver
(
pdev
,
&
physdev
->
dev
,
&
xrender_funcs
);
return
TRUE
;
return
create_xrender_dc
(
pdev
);
}
/**********************************************************************
...
...
@@ -1131,8 +1165,6 @@ static BOOL xrenderdrv_CreateDC( PHYSDEV *pdev, LPCWSTR driver, LPCWSTR device,
*/
static
BOOL
xrenderdrv_CreateCompatibleDC
(
PHYSDEV
orig
,
PHYSDEV
*
pdev
)
{
struct
xrender_physdev
*
physdev
;
if
(
orig
)
/* chain to x11drv first */
{
orig
=
GET_NEXT_PHYSDEV
(
orig
,
pCreateCompatibleDC
);
...
...
@@ -1140,10 +1172,7 @@ static BOOL xrenderdrv_CreateCompatibleDC( PHYSDEV orig, PHYSDEV *pdev )
}
/* otherwise we have been called by x11drv */
if
(
!
(
physdev
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
physdev
)
)))
return
FALSE
;
physdev
->
x11dev
=
get_x11drv_dev
(
*
pdev
);
push_dc_driver
(
pdev
,
&
physdev
->
dev
,
&
xrender_funcs
);
return
TRUE
;
return
create_xrender_dc
(
pdev
);
}
/**********************************************************************
...
...
@@ -1152,25 +1181,16 @@ static BOOL xrenderdrv_CreateCompatibleDC( PHYSDEV orig, PHYSDEV *pdev )
static
BOOL
xrenderdrv_DeleteDC
(
PHYSDEV
dev
)
{
struct
xrender_physdev
*
physdev
=
get_xrender_dev
(
dev
);
HeapFree
(
GetProcessHeap
(),
0
,
physdev
);
return
TRUE
;
}
/***********************************************************************
* X11DRV_XRender_DeleteDC
*/
void
X11DRV_XRender_DeleteDC
(
X11DRV_PDEVICE
*
physDev
)
{
X11DRV_XRender_UpdateDrawable
(
physDev
);
free_xrender_picture
(
physdev
);
EnterCriticalSection
(
&
xrender_cs
);
if
(
physDev
->
xrender
->
cache_index
!=
-
1
)
dec_ref_cache
(
physDev
->
xrender
->
cache_index
);
LeaveCriticalSection
(
&
xrender_cs
);
EnterCriticalSection
(
&
xrender_cs
);
if
(
physdev
->
info
.
cache_index
!=
-
1
)
dec_ref_cache
(
physdev
->
info
.
cache_index
);
LeaveCriticalSection
(
&
xrender_cs
);
HeapFree
(
GetProcessHeap
(),
0
,
physDev
->
xrender
)
;
physDev
->
xrender
=
NULL
;
return
;
physdev
->
x11dev
->
xrender
=
NULL
;
HeapFree
(
GetProcessHeap
(),
0
,
physdev
)
;
return
TRUE
;
}
BOOL
X11DRV_XRender_SetPhysBitmapDepth
(
X_PHYSBITMAP
*
physBitmap
,
int
bits_pixel
,
const
DIBSECTION
*
dib
)
...
...
@@ -2596,12 +2616,6 @@ BOOL X11DRV_XRender_SelectFont(X11DRV_PDEVICE *physDev, HFONT hfont)
return
FALSE
;
}
void
X11DRV_XRender_DeleteDC
(
X11DRV_PDEVICE
*
physDev
)
{
assert
(
0
);
return
;
}
void
X11DRV_XRender_SetDeviceClipping
(
X11DRV_PDEVICE
*
physDev
,
const
RGNDATA
*
data
)
{
assert
(
0
);
...
...
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