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
26506897
Commit
26506897
authored
Nov 03, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Use the brush information passed in SelectBrush for pattern brushes.
parent
0a189ffa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
30 deletions
+37
-30
brush.c
dlls/winex11.drv/brush.c
+37
-30
No files found.
dlls/winex11.drv/brush.c
View file @
26506897
...
...
@@ -209,15 +209,21 @@ static void BRUSH_SelectSolidBrush( X11DRV_PDEVICE *physDev, COLORREF color )
/***********************************************************************
* BRUSH_SelectPatternBrush
*/
static
BOOL
BRUSH_SelectPatternBrush
(
X11DRV_PDEVICE
*
physDev
,
HBITMAP
hb
itmap
)
static
void
BRUSH_SelectPatternBrush
(
X11DRV_PDEVICE
*
physDev
,
HBITMAP
hbitmap
,
X_PHYSBITMAP
*
physB
itmap
)
{
BITMAP
bitmap
;
X_PHYSBITMAP
*
physBitmap
=
X11DRV_get_phys_bitmap
(
hbitmap
);
if
(
!
physBitmap
||
!
GetObjectW
(
hbitmap
,
sizeof
(
bitmap
),
&
bitmap
))
return
FALSE
;
GetObjectW
(
hbitmap
,
sizeof
(
bitmap
),
&
bitmap
)
;
X11DRV_DIB_Lock
(
physBitmap
,
DIB_Status_GdiMod
);
if
(
physDev
->
brush
.
pixmap
)
{
wine_tsx11_lock
();
XFreePixmap
(
gdi_display
,
physDev
->
brush
.
pixmap
);
wine_tsx11_unlock
();
}
if
((
physDev
->
depth
==
1
)
&&
(
physBitmap
->
depth
!=
1
))
{
wine_tsx11_lock
();
...
...
@@ -247,33 +253,26 @@ static BOOL BRUSH_SelectPatternBrush( X11DRV_PDEVICE *physDev, HBITMAP hbitmap )
physDev
->
brush
.
fillStyle
=
FillOpaqueStippled
;
physDev
->
brush
.
pixel
=
-
1
;
/* Special case (see DC_SetupGCForBrush) */
}
return
TRUE
;
}
/***********************************************************************
* BRUSH_SelectDIBPatternBrush
*/
static
BOOL
BRUSH_SelectDIBPatternBrush
(
X11DRV_PDEVICE
*
physDev
,
const
BITMAPINFO
*
info
)
/* create a bitmap appropriate for the given DIB pattern brush */
HBITMAP
create_brush_bitmap
(
X11DRV_PDEVICE
*
physDev
,
const
BITMAPINFO
*
info
,
void
*
bits
,
UINT
usage
)
{
BOOL
ret
;
HDC
memdc
;
HBITMAP
bitmap
=
CreateDIBitmap
(
physDev
->
dev
.
hdc
,
&
info
->
bmiHeader
,
CBM_INIT
,
(
LPBYTE
)
info
+
bitmap_info_size
(
info
,
DIB_RGB_COLORS
),
info
,
DIB_RGB_COLORS
);
int
bpp
=
screen_bpp
;
HBITMAP
bitmap
;
if
(
physDev
->
depth
==
1
||
info
->
bmiHeader
.
biBitCount
==
1
)
bpp
=
1
;
bitmap
=
CreateBitmap
(
info
->
bmiHeader
.
biWidth
,
abs
(
info
->
bmiHeader
.
biHeight
),
1
,
bpp
,
NULL
);
if
(
!
bitmap
)
return
0
;
/* make sure it's owned by x11drv */
memdc
=
CreateCompatibleDC
(
physDev
->
dev
.
hdc
);
SelectObject
(
memdc
,
bitmap
);
DeleteDC
(
memdc
);
if
((
ret
=
BRUSH_SelectPatternBrush
(
physDev
,
bitmap
)))
{
X_PHYSBITMAP
*
physBitmap
=
X11DRV_get_phys_bitmap
(
bitmap
);
physBitmap
->
pixmap
=
0
;
/* so it doesn't get freed */
}
DeleteObject
(
bitmap
);
return
ret
;
SetDIBits
(
physDev
->
dev
.
hdc
,
bitmap
,
0
,
abs
(
info
->
bmiHeader
.
biHeight
),
bits
,
info
,
usage
);
return
bitmap
;
}
...
...
@@ -286,6 +285,24 @@ HBRUSH X11DRV_SelectBrush( PHYSDEV dev, HBRUSH hbrush, HBITMAP bitmap,
X11DRV_PDEVICE
*
physDev
=
get_x11drv_dev
(
dev
);
LOGBRUSH
logbrush
;
if
(
bitmap
||
info
)
/* pattern brush */
{
X_PHYSBITMAP
*
physbitmap
;
BOOL
delete_bitmap
=
FALSE
;
if
(
!
bitmap
||
!
(
physbitmap
=
X11DRV_get_phys_bitmap
(
bitmap
)))
{
if
(
!
(
bitmap
=
create_brush_bitmap
(
physDev
,
info
,
bits
,
usage
)))
return
0
;
physbitmap
=
X11DRV_get_phys_bitmap
(
bitmap
);
delete_bitmap
=
TRUE
;
}
BRUSH_SelectPatternBrush
(
physDev
,
bitmap
,
physbitmap
);
TRACE
(
"BS_PATTERN
\n
"
);
physDev
->
brush
.
style
=
BS_PATTERN
;
if
(
delete_bitmap
)
DeleteObject
(
bitmap
);
return
hbrush
;
}
if
(
!
GetObjectA
(
hbrush
,
sizeof
(
logbrush
),
&
logbrush
))
return
0
;
TRACE
(
"hdc=%p hbrush=%p
\n
"
,
dev
->
hdc
,
hbrush
);
...
...
@@ -321,16 +338,6 @@ HBRUSH X11DRV_SelectBrush( PHYSDEV dev, HBRUSH hbrush, HBITMAP bitmap,
wine_tsx11_unlock
();
physDev
->
brush
.
fillStyle
=
FillStippled
;
break
;
case
BS_PATTERN
:
TRACE
(
"BS_PATTERN
\n
"
);
if
(
!
BRUSH_SelectPatternBrush
(
physDev
,
(
HBITMAP
)
logbrush
.
lbHatch
))
return
0
;
break
;
case
BS_DIBPATTERN
:
TRACE
(
"BS_DIBPATTERN
\n
"
);
if
(
!
BRUSH_SelectDIBPatternBrush
(
physDev
,
(
BITMAPINFO
*
)
logbrush
.
lbHatch
))
return
0
;
break
;
}
return
hbrush
;
}
...
...
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