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
ce63099a
Commit
ce63099a
authored
Sep 15, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Get rid of the xrender_info structure.
parent
6ae70616
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
106 deletions
+71
-106
x11drv.h
dlls/winex11.drv/x11drv.h
+0
-3
xrender.c
dlls/winex11.drv/xrender.c
+71
-103
No files found.
dlls/winex11.drv/x11drv.h
View file @
ce63099a
...
@@ -140,8 +140,6 @@ typedef struct
...
@@ -140,8 +140,6 @@ typedef struct
/* X physical font */
/* X physical font */
typedef
UINT
X_PHYSFONT
;
typedef
UINT
X_PHYSFONT
;
struct
xrender_info
;
/* X physical device */
/* X physical device */
typedef
struct
typedef
struct
{
{
...
@@ -165,7 +163,6 @@ typedef struct
...
@@ -165,7 +163,6 @@ typedef struct
Drawable
gl_drawable
;
Drawable
gl_drawable
;
Pixmap
pixmap
;
/* Pixmap for a GLXPixmap gl_drawable */
Pixmap
pixmap
;
/* Pixmap for a GLXPixmap gl_drawable */
int
gl_copy
;
int
gl_copy
;
struct
xrender_info
*
xrender
;
}
X11DRV_PDEVICE
;
}
X11DRV_PDEVICE
;
static
inline
X11DRV_PDEVICE
*
get_x11drv_dev
(
PHYSDEV
dev
)
static
inline
X11DRV_PDEVICE
*
get_x11drv_dev
(
PHYSDEV
dev
)
...
...
dlls/winex11.drv/xrender.c
View file @
ce63099a
...
@@ -144,21 +144,16 @@ typedef struct
...
@@ -144,21 +144,16 @@ typedef struct
INT
next
;
INT
next
;
}
gsCacheEntry
;
}
gsCacheEntry
;
struct
xrender_
info
struct
xrender_
physdev
{
{
struct
gdi_physdev
dev
;
X11DRV_PDEVICE
*
x11dev
;
int
cache_index
;
int
cache_index
;
Picture
pict
;
Picture
pict
;
Picture
pict_src
;
Picture
pict_src
;
const
WineXRenderFormat
*
format
;
const
WineXRenderFormat
*
format
;
};
};
struct
xrender_physdev
{
struct
gdi_physdev
dev
;
X11DRV_PDEVICE
*
x11dev
;
struct
xrender_info
info
;
};
static
inline
struct
xrender_physdev
*
get_xrender_dev
(
PHYSDEV
dev
)
static
inline
struct
xrender_physdev
*
get_xrender_dev
(
PHYSDEV
dev
)
{
{
return
(
struct
xrender_physdev
*
)
dev
;
return
(
struct
xrender_physdev
*
)
dev
;
...
@@ -548,109 +543,84 @@ static void set_xrender_transformation(Picture src_pict, double xscale, double y
...
@@ -548,109 +543,84 @@ static void set_xrender_transformation(Picture src_pict, double xscale, double y
}
}
/* check if we can use repeating instead of scaling for the specified source DC */
/* check if we can use repeating instead of scaling for the specified source DC */
static
BOOL
use_source_repeat
(
X11DRV_PDEVICE
*
physDev
)
static
BOOL
use_source_repeat
(
struct
xrender_physdev
*
dev
)
{
return
(
physDev
->
bitmap
&&
physDev
->
drawable_rect
.
right
-
physDev
->
drawable_rect
.
left
==
1
&&
physDev
->
drawable_rect
.
bottom
-
physDev
->
drawable_rect
.
top
==
1
);
}
static
struct
xrender_info
*
get_xrender_info
(
X11DRV_PDEVICE
*
physDev
)
{
{
if
(
!
physDev
->
xrender
)
return
(
dev
->
x11dev
->
bitmap
&&
{
dev
->
x11dev
->
drawable_rect
.
right
-
dev
->
x11dev
->
drawable_rect
.
left
==
1
&&
physDev
->
xrender
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
physDev
->
xrender
));
dev
->
x11dev
->
drawable_rect
.
bottom
-
dev
->
x11dev
->
drawable_rect
.
top
==
1
);
if
(
!
physDev
->
xrender
)
{
ERR
(
"Unable to allocate XRENDERINFO!
\n
"
);
return
NULL
;
}
physDev
->
xrender
->
cache_index
=
-
1
;
}
if
(
!
physDev
->
xrender
->
format
)
physDev
->
xrender
->
format
=
get_xrender_format_from_color_shifts
(
physDev
->
depth
,
physDev
->
color_shifts
);
return
physDev
->
xrender
;
}
}
static
Picture
get_xrender_picture
(
X11DRV_PDEVICE
*
physDev
)
static
Picture
get_xrender_picture
(
struct
xrender_physdev
*
dev
)
{
{
struct
xrender_info
*
info
=
get_xrender_info
(
physDev
);
if
(
!
dev
->
pict
&&
dev
->
format
)
if
(
!
info
)
return
0
;
if
(
!
info
->
pict
&&
info
->
format
)
{
{
XRenderPictureAttributes
pa
;
XRenderPictureAttributes
pa
;
RGNDATA
*
clip
=
X11DRV_GetRegionData
(
physD
ev
->
region
,
0
);
RGNDATA
*
clip
=
X11DRV_GetRegionData
(
dev
->
x11d
ev
->
region
,
0
);
wine_tsx11_lock
();
wine_tsx11_lock
();
pa
.
subwindow_mode
=
IncludeInferiors
;
pa
.
subwindow_mode
=
IncludeInferiors
;
info
->
pict
=
pXRenderCreatePicture
(
gdi_display
,
physDev
->
drawable
,
info
->
format
->
pict_format
,
dev
->
pict
=
pXRenderCreatePicture
(
gdi_display
,
dev
->
x11dev
->
drawable
,
CPSubwindowMode
,
&
pa
);
dev
->
format
->
pict_format
,
CPSubwindowMode
,
&
pa
);
if
(
info
->
pict
&&
clip
)
if
(
dev
->
pict
&&
clip
)
pXRenderSetPictureClipRectangles
(
gdi_display
,
info
->
pict
,
pXRenderSetPictureClipRectangles
(
gdi_display
,
dev
->
pict
,
physDev
->
dc_rect
.
left
,
physD
ev
->
dc_rect
.
top
,
dev
->
x11dev
->
dc_rect
.
left
,
dev
->
x11d
ev
->
dc_rect
.
top
,
(
XRectangle
*
)
clip
->
Buffer
,
clip
->
rdh
.
nCount
);
(
XRectangle
*
)
clip
->
Buffer
,
clip
->
rdh
.
nCount
);
wine_tsx11_unlock
();
wine_tsx11_unlock
();
TRACE
(
"Allocing pict=%lx dc=%p drawable=%08lx
\n
"
,
info
->
pict
,
physDev
->
dev
.
hdc
,
physDev
->
drawable
);
TRACE
(
"Allocing pict=%lx dc=%p drawable=%08lx
\n
"
,
dev
->
pict
,
dev
->
dev
.
hdc
,
dev
->
x11dev
->
drawable
);
HeapFree
(
GetProcessHeap
(),
0
,
clip
);
HeapFree
(
GetProcessHeap
(),
0
,
clip
);
}
}
return
info
->
pict
;
return
dev
->
pict
;
}
}
static
Picture
get_xrender_picture_source
(
X11DRV_PDEVICE
*
physDev
,
BOOL
repeat
)
static
Picture
get_xrender_picture_source
(
struct
xrender_physdev
*
dev
,
BOOL
repeat
)
{
{
struct
xrender_info
*
info
=
get_xrender_info
(
physDev
);
if
(
!
dev
->
pict_src
&&
dev
->
format
)
if
(
!
info
)
return
0
;
if
(
!
info
->
pict_src
&&
info
->
format
)
{
{
XRenderPictureAttributes
pa
;
XRenderPictureAttributes
pa
;
wine_tsx11_lock
();
wine_tsx11_lock
();
pa
.
subwindow_mode
=
IncludeInferiors
;
pa
.
subwindow_mode
=
IncludeInferiors
;
pa
.
repeat
=
repeat
?
RepeatNormal
:
RepeatNone
;
pa
.
repeat
=
repeat
?
RepeatNormal
:
RepeatNone
;
info
->
pict_src
=
pXRenderCreatePicture
(
gdi_display
,
physDev
->
drawable
,
info
->
format
->
pict_format
,
dev
->
pict_src
=
pXRenderCreatePicture
(
gdi_display
,
dev
->
x11dev
->
drawable
,
CPSubwindowMode
|
CPRepeat
,
&
pa
);
dev
->
format
->
pict_format
,
CPSubwindowMode
|
CPRepeat
,
&
pa
);
wine_tsx11_unlock
();
wine_tsx11_unlock
();
TRACE
(
"Allocing pict_src=%lx dc=%p drawable=%08lx repeat=%u
\n
"
,
TRACE
(
"Allocing pict_src=%lx dc=%p drawable=%08lx repeat=%u
\n
"
,
info
->
pict_src
,
physDev
->
dev
.
hdc
,
physD
ev
->
drawable
,
pa
.
repeat
);
dev
->
pict_src
,
dev
->
dev
.
hdc
,
dev
->
x11d
ev
->
drawable
,
pa
.
repeat
);
}
}
return
info
->
pict_src
;
return
dev
->
pict_src
;
}
}
static
void
free_xrender_picture
(
struct
xrender_physdev
*
dev
)
static
void
free_xrender_picture
(
struct
xrender_physdev
*
dev
)
{
{
if
(
dev
->
info
.
pict
||
dev
->
info
.
pict_src
)
if
(
dev
->
pict
||
dev
->
pict_src
)
{
{
wine_tsx11_lock
();
wine_tsx11_lock
();
XFlush
(
gdi_display
);
XFlush
(
gdi_display
);
if
(
dev
->
info
.
pict
)
if
(
dev
->
pict
)
{
{
TRACE
(
"freeing pict = %lx dc = %p
\n
"
,
dev
->
info
.
pict
,
dev
->
dev
.
hdc
);
TRACE
(
"freeing pict = %lx dc = %p
\n
"
,
dev
->
pict
,
dev
->
dev
.
hdc
);
pXRenderFreePicture
(
gdi_display
,
dev
->
info
.
pict
);
pXRenderFreePicture
(
gdi_display
,
dev
->
pict
);
dev
->
info
.
pict
=
0
;
dev
->
pict
=
0
;
}
}
if
(
dev
->
info
.
pict_src
)
if
(
dev
->
pict_src
)
{
{
TRACE
(
"freeing pict = %lx dc = %p
\n
"
,
dev
->
info
.
pict_src
,
dev
->
dev
.
hdc
);
TRACE
(
"freeing pict = %lx dc = %p
\n
"
,
dev
->
pict_src
,
dev
->
dev
.
hdc
);
pXRenderFreePicture
(
gdi_display
,
dev
->
info
.
pict_src
);
pXRenderFreePicture
(
gdi_display
,
dev
->
pict_src
);
dev
->
info
.
pict_src
=
0
;
dev
->
pict_src
=
0
;
}
}
wine_tsx11_unlock
();
wine_tsx11_unlock
();
}
}
dev
->
info
.
format
=
NULL
;
dev
->
format
=
NULL
;
}
}
static
void
update_xrender_drawable
(
struct
xrender_physdev
*
dev
)
static
void
update_xrender_drawable
(
struct
xrender_physdev
*
dev
)
{
{
free_xrender_picture
(
dev
);
free_xrender_picture
(
dev
);
dev
->
info
.
format
=
get_xrender_format_from_color_shifts
(
dev
->
x11dev
->
depth
,
dev
->
format
=
get_xrender_format_from_color_shifts
(
dev
->
x11dev
->
depth
,
dev
->
x11dev
->
color_shifts
);
dev
->
x11dev
->
color_shifts
);
}
}
/* return a mask picture used to force alpha to 0 */
/* return a mask picture used to force alpha to 0 */
...
@@ -1124,9 +1094,9 @@ static HFONT xrenderdrv_SelectFont( PHYSDEV dev, HFONT hfont, HANDLE gdiFont )
...
@@ -1124,9 +1094,9 @@ static HFONT xrenderdrv_SelectFont( PHYSDEV dev, HFONT hfont, HANDLE gdiFont )
lfsz_calc_hash
(
&
lfsz
);
lfsz_calc_hash
(
&
lfsz
);
EnterCriticalSection
(
&
xrender_cs
);
EnterCriticalSection
(
&
xrender_cs
);
if
(
physdev
->
info
.
cache_index
!=
-
1
)
if
(
physdev
->
cache_index
!=
-
1
)
dec_ref_cache
(
physdev
->
info
.
cache_index
);
dec_ref_cache
(
physdev
->
cache_index
);
physdev
->
info
.
cache_index
=
GetCacheEntry
(
dev
->
hdc
,
&
lfsz
);
physdev
->
cache_index
=
GetCacheEntry
(
dev
->
hdc
,
&
lfsz
);
LeaveCriticalSection
(
&
xrender_cs
);
LeaveCriticalSection
(
&
xrender_cs
);
physdev
->
x11dev
->
has_gdi_font
=
TRUE
;
physdev
->
x11dev
->
has_gdi_font
=
TRUE
;
return
0
;
return
0
;
...
@@ -1134,10 +1104,10 @@ static HFONT xrenderdrv_SelectFont( PHYSDEV dev, HFONT hfont, HANDLE gdiFont )
...
@@ -1134,10 +1104,10 @@ static HFONT xrenderdrv_SelectFont( PHYSDEV dev, HFONT hfont, HANDLE gdiFont )
static
void
update_xrender_clipping
(
struct
xrender_physdev
*
dev
,
const
RGNDATA
*
data
)
static
void
update_xrender_clipping
(
struct
xrender_physdev
*
dev
,
const
RGNDATA
*
data
)
{
{
if
(
dev
->
info
.
pict
)
if
(
dev
->
pict
)
{
{
wine_tsx11_lock
();
wine_tsx11_lock
();
pXRenderSetPictureClipRectangles
(
gdi_display
,
dev
->
info
.
pict
,
pXRenderSetPictureClipRectangles
(
gdi_display
,
dev
->
pict
,
dev
->
x11dev
->
dc_rect
.
left
,
dev
->
x11dev
->
dc_rect
.
top
,
dev
->
x11dev
->
dc_rect
.
left
,
dev
->
x11dev
->
dc_rect
.
top
,
(
XRectangle
*
)
data
->
Buffer
,
data
->
rdh
.
nCount
);
(
XRectangle
*
)
data
->
Buffer
,
data
->
rdh
.
nCount
);
wine_tsx11_unlock
();
wine_tsx11_unlock
();
...
@@ -1179,9 +1149,8 @@ static BOOL create_xrender_dc( PHYSDEV *pdev )
...
@@ -1179,9 +1149,8 @@ static BOOL create_xrender_dc( PHYSDEV *pdev )
if
(
!
physdev
)
return
FALSE
;
if
(
!
physdev
)
return
FALSE
;
physdev
->
x11dev
=
x11dev
;
physdev
->
x11dev
=
x11dev
;
physdev
->
info
.
cache_index
=
-
1
;
physdev
->
cache_index
=
-
1
;
physdev
->
info
.
format
=
get_xrender_format_from_color_shifts
(
x11dev
->
depth
,
x11dev
->
color_shifts
);
physdev
->
format
=
get_xrender_format_from_color_shifts
(
x11dev
->
depth
,
x11dev
->
color_shifts
);
x11dev
->
xrender
=
&
physdev
->
info
;
push_dc_driver
(
pdev
,
&
physdev
->
dev
,
&
xrender_funcs
);
push_dc_driver
(
pdev
,
&
physdev
->
dev
,
&
xrender_funcs
);
return
TRUE
;
return
TRUE
;
}
}
...
@@ -1220,10 +1189,9 @@ static BOOL xrenderdrv_DeleteDC( PHYSDEV dev )
...
@@ -1220,10 +1189,9 @@ static BOOL xrenderdrv_DeleteDC( PHYSDEV dev )
free_xrender_picture
(
physdev
);
free_xrender_picture
(
physdev
);
EnterCriticalSection
(
&
xrender_cs
);
EnterCriticalSection
(
&
xrender_cs
);
if
(
physdev
->
info
.
cache_index
!=
-
1
)
dec_ref_cache
(
physdev
->
info
.
cache_index
);
if
(
physdev
->
cache_index
!=
-
1
)
dec_ref_cache
(
physdev
->
cache_index
);
LeaveCriticalSection
(
&
xrender_cs
);
LeaveCriticalSection
(
&
xrender_cs
);
physdev
->
x11dev
->
xrender
=
NULL
;
HeapFree
(
GetProcessHeap
(),
0
,
physdev
);
HeapFree
(
GetProcessHeap
(),
0
,
physdev
);
return
TRUE
;
return
TRUE
;
}
}
...
@@ -1406,7 +1374,7 @@ static void UploadGlyph(struct xrender_physdev *physDev, int glyph, AA_Type form
...
@@ -1406,7 +1374,7 @@ static void UploadGlyph(struct xrender_physdev *physDev, int glyph, AA_Type form
Glyph
gid
;
Glyph
gid
;
GLYPHMETRICS
gm
;
GLYPHMETRICS
gm
;
XGlyphInfo
gi
;
XGlyphInfo
gi
;
gsCacheEntry
*
entry
=
glyphsetCache
+
physDev
->
info
.
cache_index
;
gsCacheEntry
*
entry
=
glyphsetCache
+
physDev
->
cache_index
;
gsCacheEntryFormat
*
formatEntry
;
gsCacheEntryFormat
*
formatEntry
;
UINT
ggo_format
=
GGO_GLYPH_INDEX
;
UINT
ggo_format
=
GGO_GLYPH_INDEX
;
WXRFormat
wxr_format
;
WXRFormat
wxr_format
;
...
@@ -2047,7 +2015,7 @@ BOOL xrenderdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
...
@@ -2047,7 +2015,7 @@ BOOL xrenderdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
EnterCriticalSection
(
&
xrender_cs
);
EnterCriticalSection
(
&
xrender_cs
);
entry
=
glyphsetCache
+
physdev
->
info
.
cache_index
;
entry
=
glyphsetCache
+
physdev
->
cache_index
;
if
(
disable_antialias
==
FALSE
)
if
(
disable_antialias
==
FALSE
)
aa_type
=
entry
->
aa_default
;
aa_type
=
entry
->
aa_default
;
formatEntry
=
entry
->
format
[
aa_type
];
formatEntry
=
entry
->
format
[
aa_type
];
...
@@ -2079,7 +2047,7 @@ BOOL xrenderdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
...
@@ -2079,7 +2047,7 @@ BOOL xrenderdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
POINT
offset
=
{
0
,
0
};
POINT
offset
=
{
0
,
0
};
POINT
desired
,
current
;
POINT
desired
,
current
;
int
render_op
=
PictOpOver
;
int
render_op
=
PictOpOver
;
Picture
pict
=
get_xrender_picture
(
physdev
->
x11dev
);
Picture
pict
=
get_xrender_picture
(
physdev
);
XRenderColor
col
;
XRenderColor
col
;
/* There's a bug in XRenderCompositeText that ignores the xDst and yDst parameters.
/* There's a bug in XRenderCompositeText that ignores the xDst and yDst parameters.
...
@@ -2090,12 +2058,12 @@ BOOL xrenderdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
...
@@ -2090,12 +2058,12 @@ BOOL xrenderdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
desired
.
y
=
physdev
->
x11dev
->
dc_rect
.
top
+
y
;
desired
.
y
=
physdev
->
x11dev
->
dc_rect
.
top
+
y
;
current
.
x
=
current
.
y
=
0
;
current
.
x
=
current
.
y
=
0
;
get_xrender_color
(
physdev
->
info
.
format
,
physdev
->
x11dev
->
textPixel
,
&
col
);
get_xrender_color
(
physdev
->
format
,
physdev
->
x11dev
->
textPixel
,
&
col
);
tile_pict
=
get_tile_pict
(
physdev
->
info
.
format
,
&
col
);
tile_pict
=
get_tile_pict
(
physdev
->
format
,
&
col
);
/* FIXME the mapping of Text/BkColor onto 1 or 0 needs investigation.
/* FIXME the mapping of Text/BkColor onto 1 or 0 needs investigation.
*/
*/
if
((
physdev
->
info
.
format
->
format
==
WXR_FORMAT_MONO
)
&&
(
textPixel
==
0
))
if
((
physdev
->
format
->
format
==
WXR_FORMAT_MONO
)
&&
(
textPixel
==
0
))
render_op
=
PictOpOutReverse
;
/* This gives us 'black' text */
render_op
=
PictOpOutReverse
;
/* This gives us 'black' text */
for
(
idx
=
0
;
idx
<
count
;
idx
++
)
for
(
idx
=
0
;
idx
<
count
;
idx
++
)
...
@@ -2390,7 +2358,7 @@ static void xrender_mono_blit( Picture src_pict, Picture mask_pict, Picture dst_
...
@@ -2390,7 +2358,7 @@ static void xrender_mono_blit( Picture src_pict, Picture mask_pict, Picture dst_
static
void
get_colors
(
struct
xrender_physdev
*
physdev_src
,
struct
xrender_physdev
*
physdev_dst
,
static
void
get_colors
(
struct
xrender_physdev
*
physdev_src
,
struct
xrender_physdev
*
physdev_dst
,
XRenderColor
*
fg
,
XRenderColor
*
bg
)
XRenderColor
*
fg
,
XRenderColor
*
bg
)
{
{
if
(
physdev_src
->
info
.
format
->
format
==
WXR_FORMAT_MONO
)
if
(
physdev_src
->
format
->
format
==
WXR_FORMAT_MONO
)
{
{
RGBQUAD
rgb
[
2
];
RGBQUAD
rgb
[
2
];
int
pixel
;
int
pixel
;
...
@@ -2399,15 +2367,15 @@ static void get_colors( struct xrender_physdev *physdev_src, struct xrender_phys
...
@@ -2399,15 +2367,15 @@ static void get_colors( struct xrender_physdev *physdev_src, struct xrender_phys
{
{
pixel
=
X11DRV_PALETTE_ToPhysical
(
physdev_dst
->
x11dev
,
pixel
=
X11DRV_PALETTE_ToPhysical
(
physdev_dst
->
x11dev
,
RGB
(
rgb
[
0
].
rgbRed
,
rgb
[
0
].
rgbGreen
,
rgb
[
0
].
rgbBlue
));
RGB
(
rgb
[
0
].
rgbRed
,
rgb
[
0
].
rgbGreen
,
rgb
[
0
].
rgbBlue
));
get_xrender_color
(
physdev_dst
->
info
.
format
,
pixel
,
fg
);
get_xrender_color
(
physdev_dst
->
format
,
pixel
,
fg
);
pixel
=
X11DRV_PALETTE_ToPhysical
(
physdev_dst
->
x11dev
,
pixel
=
X11DRV_PALETTE_ToPhysical
(
physdev_dst
->
x11dev
,
RGB
(
rgb
[
1
].
rgbRed
,
rgb
[
1
].
rgbGreen
,
rgb
[
1
].
rgbBlue
));
RGB
(
rgb
[
1
].
rgbRed
,
rgb
[
1
].
rgbGreen
,
rgb
[
1
].
rgbBlue
));
get_xrender_color
(
physdev_dst
->
info
.
format
,
pixel
,
bg
);
get_xrender_color
(
physdev_dst
->
format
,
pixel
,
bg
);
return
;
return
;
}
}
}
}
get_xrender_color
(
physdev_dst
->
info
.
format
,
physdev_dst
->
x11dev
->
textPixel
,
fg
);
get_xrender_color
(
physdev_dst
->
format
,
physdev_dst
->
x11dev
->
textPixel
,
fg
);
get_xrender_color
(
physdev_dst
->
info
.
format
,
physdev_dst
->
x11dev
->
backgroundPixel
,
bg
);
get_xrender_color
(
physdev_dst
->
format
,
physdev_dst
->
x11dev
->
backgroundPixel
,
bg
);
}
}
static
void
xrender_stretch_blit
(
struct
xrender_physdev
*
physdev_src
,
struct
xrender_physdev
*
physdev_dst
,
static
void
xrender_stretch_blit
(
struct
xrender_physdev
*
physdev_src
,
struct
xrender_physdev
*
physdev_dst
,
...
@@ -2428,7 +2396,7 @@ static void xrender_stretch_blit( struct xrender_physdev *physdev_src, struct xr
...
@@ -2428,7 +2396,7 @@ static void xrender_stretch_blit( struct xrender_physdev *physdev_src, struct xr
pa
.
subwindow_mode
=
IncludeInferiors
;
pa
.
subwindow_mode
=
IncludeInferiors
;
pa
.
repeat
=
RepeatNone
;
pa
.
repeat
=
RepeatNone
;
use_repeat
=
use_source_repeat
(
physdev_src
->
x11dev
);
use_repeat
=
use_source_repeat
(
physdev_src
);
if
(
!
use_repeat
)
if
(
!
use_repeat
)
{
{
xscale
=
src
->
width
/
(
double
)
dst
->
width
;
xscale
=
src
->
width
/
(
double
)
dst
->
width
;
...
@@ -2439,8 +2407,8 @@ static void xrender_stretch_blit( struct xrender_physdev *physdev_src, struct xr
...
@@ -2439,8 +2407,8 @@ static void xrender_stretch_blit( struct xrender_physdev *physdev_src, struct xr
if
(
drawable
!=
physdev_dst
->
x11dev
->
drawable
)
x_dst
=
y_dst
=
0
;
/* using an intermediate pixmap */
if
(
drawable
!=
physdev_dst
->
x11dev
->
drawable
)
x_dst
=
y_dst
=
0
;
/* using an intermediate pixmap */
/* mono -> color */
/* mono -> color */
if
(
physdev_src
->
info
.
format
->
format
==
WXR_FORMAT_MONO
&&
if
(
physdev_src
->
format
->
format
==
WXR_FORMAT_MONO
&&
physdev_dst
->
info
.
format
->
format
!=
WXR_FORMAT_MONO
)
physdev_dst
->
format
->
format
!=
WXR_FORMAT_MONO
)
{
{
XRenderColor
fg
,
bg
;
XRenderColor
fg
,
bg
;
...
@@ -2448,15 +2416,15 @@ static void xrender_stretch_blit( struct xrender_physdev *physdev_src, struct xr
...
@@ -2448,15 +2416,15 @@ static void xrender_stretch_blit( struct xrender_physdev *physdev_src, struct xr
fg
.
alpha
=
bg
.
alpha
=
0
;
fg
.
alpha
=
bg
.
alpha
=
0
;
/* We use the source drawable as a mask */
/* We use the source drawable as a mask */
mask_pict
=
get_xrender_picture_source
(
physdev_src
->
x11dev
,
use_repeat
);
mask_pict
=
get_xrender_picture_source
(
physdev_src
,
use_repeat
);
/* Use backgroundPixel as the foreground color */
/* Use backgroundPixel as the foreground color */
EnterCriticalSection
(
&
xrender_cs
);
EnterCriticalSection
(
&
xrender_cs
);
src_pict
=
get_tile_pict
(
physdev_dst
->
info
.
format
,
&
bg
);
src_pict
=
get_tile_pict
(
physdev_dst
->
format
,
&
bg
);
/* Create a destination picture and fill it with textPixel color as the background color */
/* Create a destination picture and fill it with textPixel color as the background color */
wine_tsx11_lock
();
wine_tsx11_lock
();
dst_pict
=
pXRenderCreatePicture
(
gdi_display
,
drawable
,
physdev_dst
->
info
.
format
->
pict_format
,
dst_pict
=
pXRenderCreatePicture
(
gdi_display
,
drawable
,
physdev_dst
->
format
->
pict_format
,
CPSubwindowMode
|
CPRepeat
,
&
pa
);
CPSubwindowMode
|
CPRepeat
,
&
pa
);
pXRenderFillRectangle
(
gdi_display
,
PictOpSrc
,
dst_pict
,
&
fg
,
x_dst
,
y_dst
,
width
,
height
);
pXRenderFillRectangle
(
gdi_display
,
PictOpSrc
,
dst_pict
,
&
fg
,
x_dst
,
y_dst
,
width
,
height
);
...
@@ -2471,10 +2439,10 @@ static void xrender_stretch_blit( struct xrender_physdev *physdev_src, struct xr
...
@@ -2471,10 +2439,10 @@ static void xrender_stretch_blit( struct xrender_physdev *physdev_src, struct xr
{
{
if
(
physdev_dst
->
x11dev
->
depth
==
32
&&
physdev_src
->
x11dev
->
depth
<
32
)
if
(
physdev_dst
->
x11dev
->
depth
==
32
&&
physdev_src
->
x11dev
->
depth
<
32
)
mask_pict
=
get_no_alpha_mask
();
mask_pict
=
get_no_alpha_mask
();
src_pict
=
get_xrender_picture_source
(
physdev_src
->
x11dev
,
use_repeat
);
src_pict
=
get_xrender_picture_source
(
physdev_src
,
use_repeat
);
wine_tsx11_lock
();
wine_tsx11_lock
();
dst_pict
=
pXRenderCreatePicture
(
gdi_display
,
drawable
,
physdev_dst
->
info
.
format
->
pict_format
,
dst_pict
=
pXRenderCreatePicture
(
gdi_display
,
drawable
,
physdev_dst
->
format
->
pict_format
,
CPSubwindowMode
|
CPRepeat
,
&
pa
);
CPSubwindowMode
|
CPRepeat
,
&
pa
);
xrender_blit
(
PictOpSrc
,
src_pict
,
mask_pict
,
dst_pict
,
xrender_blit
(
PictOpSrc
,
src_pict
,
mask_pict
,
dst_pict
,
...
@@ -2503,12 +2471,12 @@ static BOOL xrenderdrv_StretchBlt( PHYSDEV dst_dev, struct bitblt_coords *dst,
...
@@ -2503,12 +2471,12 @@ static BOOL xrenderdrv_StretchBlt( PHYSDEV dst_dev, struct bitblt_coords *dst,
return
dst_dev
->
funcs
->
pStretchBlt
(
dst_dev
,
dst
,
src_dev
,
src
,
rop
);
return
dst_dev
->
funcs
->
pStretchBlt
(
dst_dev
,
dst
,
src_dev
,
src
,
rop
);
}
}
if
(
physdev_dst
->
info
.
format
->
format
==
WXR_FORMAT_MONO
&&
if
(
physdev_dst
->
format
->
format
==
WXR_FORMAT_MONO
&&
physdev_src
->
info
.
format
->
format
!=
WXR_FORMAT_MONO
)
/* XRender is of no use in this case */
physdev_src
->
format
->
format
!=
WXR_FORMAT_MONO
)
/* XRender is of no use in this case */
return
X11DRV_StretchBlt
(
&
physdev_dst
->
x11dev
->
dev
,
dst
,
&
physdev_src
->
x11dev
->
dev
,
src
,
rop
);
return
X11DRV_StretchBlt
(
&
physdev_dst
->
x11dev
->
dev
,
dst
,
&
physdev_src
->
x11dev
->
dev
,
src
,
rop
);
/* if not stretching, we only need to handle format conversion */
/* if not stretching, we only need to handle format conversion */
if
(
!
stretch
&&
physdev_dst
->
info
.
format
==
physdev_src
->
info
.
format
)
if
(
!
stretch
&&
physdev_dst
->
format
==
physdev_src
->
format
)
return
X11DRV_StretchBlt
(
&
physdev_dst
->
x11dev
->
dev
,
dst
,
&
physdev_src
->
x11dev
->
dev
,
src
,
rop
);
return
X11DRV_StretchBlt
(
&
physdev_dst
->
x11dev
->
dev
,
dst
,
&
physdev_src
->
x11dev
->
dev
,
src
,
rop
);
sSrc
=
sDst
=
X11DRV_LockDIBSection
(
physdev_dst
->
x11dev
,
DIB_Status_None
);
sSrc
=
sDst
=
X11DRV_LockDIBSection
(
physdev_dst
->
x11dev
,
DIB_Status_None
);
...
@@ -2576,9 +2544,9 @@ static BOOL xrenderdrv_AlphaBlend( PHYSDEV dst_dev, struct bitblt_coords *dst,
...
@@ -2576,9 +2544,9 @@ static BOOL xrenderdrv_AlphaBlend( PHYSDEV dst_dev, struct bitblt_coords *dst,
if
(
physdev_src
!=
physdev_dst
)
X11DRV_LockDIBSection
(
physdev_src
->
x11dev
,
DIB_Status_GdiMod
);
if
(
physdev_src
!=
physdev_dst
)
X11DRV_LockDIBSection
(
physdev_src
->
x11dev
,
DIB_Status_GdiMod
);
X11DRV_LockDIBSection
(
physdev_dst
->
x11dev
,
DIB_Status_GdiMod
);
X11DRV_LockDIBSection
(
physdev_dst
->
x11dev
,
DIB_Status_GdiMod
);
dst_pict
=
get_xrender_picture
(
physdev_dst
->
x11dev
);
dst_pict
=
get_xrender_picture
(
physdev_dst
);
use_repeat
=
use_source_repeat
(
physdev_src
->
x11dev
);
use_repeat
=
use_source_repeat
(
physdev_src
);
if
(
!
use_repeat
)
if
(
!
use_repeat
)
{
{
xscale
=
src
->
width
/
(
double
)
dst
->
width
;
xscale
=
src
->
width
/
(
double
)
dst
->
width
;
...
@@ -2586,11 +2554,11 @@ static BOOL xrenderdrv_AlphaBlend( PHYSDEV dst_dev, struct bitblt_coords *dst,
...
@@ -2586,11 +2554,11 @@ static BOOL xrenderdrv_AlphaBlend( PHYSDEV dst_dev, struct bitblt_coords *dst,
}
}
else
xscale
=
yscale
=
1
;
/* no scaling needed with a repeating source */
else
xscale
=
yscale
=
1
;
/* no scaling needed with a repeating source */
if
(
!
(
blendfn
.
AlphaFormat
&
AC_SRC_ALPHA
)
&&
physdev_src
->
info
.
format
)
if
(
!
(
blendfn
.
AlphaFormat
&
AC_SRC_ALPHA
)
&&
physdev_src
->
format
)
{
{
/* we need a source picture with no alpha */
/* we need a source picture with no alpha */
WXRFormat
format
=
get_format_without_alpha
(
physdev_src
->
info
.
format
->
format
);
WXRFormat
format
=
get_format_without_alpha
(
physdev_src
->
format
->
format
);
if
(
format
!=
physdev_src
->
info
.
format
->
format
)
if
(
format
!=
physdev_src
->
format
->
format
)
{
{
XRenderPictureAttributes
pa
;
XRenderPictureAttributes
pa
;
const
WineXRenderFormat
*
fmt
=
get_xrender_format
(
format
);
const
WineXRenderFormat
*
fmt
=
get_xrender_format
(
format
);
...
@@ -2605,7 +2573,7 @@ static BOOL xrenderdrv_AlphaBlend( PHYSDEV dst_dev, struct bitblt_coords *dst,
...
@@ -2605,7 +2573,7 @@ static BOOL xrenderdrv_AlphaBlend( PHYSDEV dst_dev, struct bitblt_coords *dst,
}
}
}
}
if
(
!
src_pict
)
src_pict
=
get_xrender_picture_source
(
physdev_src
->
x11dev
,
use_repeat
);
if
(
!
src_pict
)
src_pict
=
get_xrender_picture_source
(
physdev_src
,
use_repeat
);
EnterCriticalSection
(
&
xrender_cs
);
EnterCriticalSection
(
&
xrender_cs
);
mask_pict
=
get_mask_pict
(
blendfn
.
SourceConstantAlpha
*
257
);
mask_pict
=
get_mask_pict
(
blendfn
.
SourceConstantAlpha
*
257
);
...
...
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