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
efa37f56
Commit
efa37f56
authored
Sep 10, 2009
by
Roderick Colenbrander
Committed by
Alexandre Julliard
Sep 10, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Add helper function for copying brushes.
parent
88b990b2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
7 deletions
+49
-7
brush.c
dlls/winex11.drv/brush.c
+4
-7
x11drv.h
dlls/winex11.drv/x11drv.h
+1
-0
xrender.c
dlls/winex11.drv/xrender.c
+44
-0
No files found.
dlls/winex11.drv/brush.c
View file @
efa37f56
...
...
@@ -215,25 +215,22 @@ static BOOL BRUSH_SelectPatternBrush( X11DRV_PDEVICE *physDev, HBITMAP hbitmap )
if
(
!
physBitmap
||
!
GetObjectW
(
hbitmap
,
sizeof
(
bitmap
),
&
bitmap
))
return
FALSE
;
wine_tsx11_lock
();
if
((
physDev
->
depth
==
1
)
&&
(
physBitmap
->
pixmap_depth
!=
1
))
{
wine_tsx11_lock
();
/* Special case: a color pattern on a monochrome DC */
physDev
->
brush
.
pixmap
=
XCreatePixmap
(
gdi_display
,
root_window
,
bitmap
.
bmWidth
,
bitmap
.
bmHeight
,
1
);
/* FIXME: should probably convert to monochrome instead */
XCopyPlane
(
gdi_display
,
physBitmap
->
pixmap
,
physDev
->
brush
.
pixmap
,
get_bitmap_gc
(
1
),
0
,
0
,
bitmap
.
bmWidth
,
bitmap
.
bmHeight
,
0
,
0
,
1
);
wine_tsx11_unlock
();
}
else
{
physDev
->
brush
.
pixmap
=
XCreatePixmap
(
gdi_display
,
root_window
,
bitmap
.
bmWidth
,
bitmap
.
bmHeight
,
physBitmap
->
pixmap_depth
);
XCopyArea
(
gdi_display
,
physBitmap
->
pixmap
,
physDev
->
brush
.
pixmap
,
get_bitmap_gc
(
physBitmap
->
pixmap_depth
),
0
,
0
,
bitmap
.
bmWidth
,
bitmap
.
bmHeight
,
0
,
0
);
/* XRender is needed because of possible depth conversion */
X11DRV_XRender_CopyBrush
(
physDev
,
physBitmap
,
bitmap
.
bmWidth
,
bitmap
.
bmHeight
);
}
wine_tsx11_unlock
();
if
(
physBitmap
->
pixmap_depth
>
1
)
{
...
...
dlls/winex11.drv/x11drv.h
View file @
efa37f56
...
...
@@ -286,6 +286,7 @@ extern void X11DRV_XRender_Init(void);
extern
void
X11DRV_XRender_Finalize
(
void
);
extern
BOOL
X11DRV_XRender_SelectFont
(
X11DRV_PDEVICE
*
,
HFONT
);
extern
void
X11DRV_XRender_DeleteDC
(
X11DRV_PDEVICE
*
);
extern
void
X11DRV_XRender_CopyBrush
(
X11DRV_PDEVICE
*
physDev
,
X_PHYSBITMAP
*
physBitmap
,
int
width
,
int
height
);
extern
BOOL
X11DRV_XRender_ExtTextOut
(
X11DRV_PDEVICE
*
physDev
,
INT
x
,
INT
y
,
UINT
flags
,
const
RECT
*
lprect
,
LPCWSTR
wstr
,
UINT
count
,
const
INT
*
lpDx
);
...
...
dlls/winex11.drv/xrender.c
View file @
efa37f56
...
...
@@ -1984,6 +1984,40 @@ BOOL CDECL X11DRV_AlphaBlend(X11DRV_PDEVICE *devDst, INT xDst, INT yDst, INT wid
return
TRUE
;
}
void
X11DRV_XRender_CopyBrush
(
X11DRV_PDEVICE
*
physDev
,
X_PHYSBITMAP
*
physBitmap
,
int
width
,
int
height
)
{
/* At depths >1, the depth of physBitmap and physDev might not be the same e.g. the physbitmap might be a 16-bit DIB while the physdev uses 24-bit */
int
depth
=
physBitmap
->
pixmap_depth
==
1
?
1
:
physDev
->
depth
;
wine_tsx11_lock
();
physDev
->
brush
.
pixmap
=
XCreatePixmap
(
gdi_display
,
root_window
,
width
,
height
,
depth
);
/* Use XCopyArea when the physBitmap and brush.pixmap have the same depth. */
if
(
physBitmap
->
pixmap_depth
==
1
||
physDev
->
depth
==
physBitmap
->
pixmap_depth
)
{
XCopyArea
(
gdi_display
,
physBitmap
->
pixmap
,
physDev
->
brush
.
pixmap
,
get_bitmap_gc
(
physBitmap
->
pixmap_depth
),
0
,
0
,
width
,
height
,
0
,
0
);
}
else
/* We meed depth conversion */
{
WineXRenderFormat
*
src_format
=
get_xrender_format_from_color_shifts
(
physBitmap
->
pixmap_depth
,
&
physBitmap
->
pixmap_color_shifts
);
WineXRenderFormat
*
dst_format
=
get_xrender_format_from_color_shifts
(
physDev
->
depth
,
physDev
->
color_shifts
);
Picture
src_pict
,
dst_pict
;
XRenderPictureAttributes
pa
;
pa
.
subwindow_mode
=
IncludeInferiors
;
pa
.
repeat
=
RepeatNone
;
src_pict
=
pXRenderCreatePicture
(
gdi_display
,
physBitmap
->
pixmap
,
src_format
->
pict_format
,
CPSubwindowMode
|
CPRepeat
,
&
pa
);
dst_pict
=
pXRenderCreatePicture
(
gdi_display
,
physDev
->
brush
.
pixmap
,
dst_format
->
pict_format
,
CPSubwindowMode
|
CPRepeat
,
&
pa
);
xrender_blit
(
src_pict
,
0
,
dst_pict
,
0
,
0
,
1
.
0
,
1
.
0
,
width
,
height
);
pXRenderFreePicture
(
gdi_display
,
src_pict
);
pXRenderFreePicture
(
gdi_display
,
dst_pict
);
}
wine_tsx11_unlock
();
}
BOOL
X11DRV_XRender_GetSrcAreaStretch
(
X11DRV_PDEVICE
*
physDevSrc
,
X11DRV_PDEVICE
*
physDevDst
,
Pixmap
pixmap
,
GC
gc
,
INT
widthSrc
,
INT
heightSrc
,
...
...
@@ -2125,6 +2159,16 @@ BOOL X11DRV_AlphaBlend(X11DRV_PDEVICE *devDst, INT xDst, INT yDst, INT widthDst,
return
FALSE
;
}
void
X11DRV_XRender_CopyBrush
(
X11DRV_PDEVICE
*
physDev
,
X_PHYSBITMAP
*
physBitmap
,
int
width
,
int
height
)
{
wine_tsx11_lock
();
physDev
->
brush
.
pixmap
=
XCreatePixmap
(
gdi_display
,
root_window
,
width
,
height
,
physBitmap
->
pixmap_depth
);
XCopyArea
(
gdi_display
,
physBitmap
->
pixmap
,
physDev
->
brush
.
pixmap
,
get_bitmap_gc
(
physBitmap
->
pixmap_depth
),
0
,
0
,
width
,
height
,
0
,
0
);
wine_tsx11_unlock
();
}
BOOL
X11DRV_XRender_GetSrcAreaStretch
(
X11DRV_PDEVICE
*
physDevSrc
,
X11DRV_PDEVICE
*
physDevDst
,
Pixmap
pixmap
,
GC
gc
,
INT
widthSrc
,
INT
heightSrc
,
...
...
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