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
65a2c885
Commit
65a2c885
authored
Dec 12, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Don't create a default color table for pattern brushes, use the DC colors instead.
parent
d5fe87e2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
7 deletions
+26
-7
brush.c
dlls/gdi32/brush.c
+2
-2
objects.c
dlls/gdi32/dibdrv/objects.c
+24
-5
No files found.
dlls/gdi32/brush.c
View file @
65a2c885
...
...
@@ -79,8 +79,6 @@ static BOOL store_bitmap_bits( BRUSHOBJ *brush, BITMAPOBJ *bmp )
return
FALSE
;
}
if
(
info
->
bmiHeader
.
biBitCount
<=
8
&&
!
info
->
bmiHeader
.
biClrUsed
)
fill_default_color_table
(
info
);
/* release the unneeded space */
HeapReAlloc
(
GetProcessHeap
(),
HEAP_REALLOC_IN_PLACE_ONLY
,
info
,
get_dib_info_size
(
info
,
DIB_RGB_COLORS
));
...
...
@@ -162,6 +160,8 @@ BOOL get_brush_bitmap_info( HBRUSH handle, BITMAPINFO *info, void **bits, UINT *
if
(
brush
->
info
)
{
memcpy
(
info
,
brush
->
info
,
get_dib_info_size
(
brush
->
info
,
brush
->
usage
));
if
(
info
->
bmiHeader
.
biBitCount
<=
8
&&
!
info
->
bmiHeader
.
biClrUsed
)
fill_default_color_table
(
info
);
*
bits
=
brush
->
bits
.
ptr
;
*
usage
=
brush
->
usage
;
ret
=
TRUE
;
...
...
dlls/gdi32/dibdrv/objects.c
View file @
65a2c885
...
...
@@ -1468,10 +1468,11 @@ static BOOL matching_pattern_format( dib_info *dib, dib_info *pattern )
return
TRUE
;
}
static
BOOL
select_pattern_brush
(
dibdrv_physdev
*
pdev
)
static
BOOL
select_pattern_brush
(
dibdrv_physdev
*
pdev
,
BOOL
*
needs_reselect
)
{
char
buffer
[
FIELD_OFFSET
(
BITMAPINFO
,
bmiColors
[
256
]
)];
BITMAPINFO
*
info
=
(
BITMAPINFO
*
)
buffer
;
RGBQUAD
color_table
[
2
];
RECT
rect
;
dib_info
pattern
;
...
...
@@ -1490,12 +1491,31 @@ static BOOL select_pattern_brush( dibdrv_physdev *pdev )
copy_bitmapinfo
(
info
,
pdev
->
brush_pattern_info
);
fill_color_table_from_pal_colors
(
info
,
pdev
->
dev
.
hdc
);
init_dib_info_from_bitmapinfo
(
&
pattern
,
info
,
pdev
->
brush_pattern_bits
,
0
);
*
needs_reselect
=
TRUE
;
}
else
{
init_dib_info_from_bitmapinfo
(
&
pattern
,
pdev
->
brush_pattern_info
,
pdev
->
brush_pattern_bits
,
0
);
}
if
(
pattern
.
bit_count
==
1
&&
!
pattern
.
color_table
)
{
/* monochrome DDB pattern uses DC colors */
COLORREF
color
=
GetTextColor
(
pdev
->
dev
.
hdc
);
color_table
[
0
].
rgbRed
=
GetRValue
(
color
);
color_table
[
0
].
rgbGreen
=
GetGValue
(
color
);
color_table
[
0
].
rgbBlue
=
GetBValue
(
color
);
color_table
[
0
].
rgbReserved
=
0
;
color
=
GetBkColor
(
pdev
->
dev
.
hdc
);
color_table
[
1
].
rgbRed
=
GetRValue
(
color
);
color_table
[
1
].
rgbGreen
=
GetGValue
(
color
);
color_table
[
1
].
rgbBlue
=
GetBValue
(
color
);
color_table
[
1
].
rgbReserved
=
0
;
pattern
.
color_table
=
color_table
;
pattern
.
color_table_size
=
2
;
*
needs_reselect
=
TRUE
;
}
copy_dib_color_info
(
&
pdev
->
brush_dib
,
&
pdev
->
dib
);
pdev
->
brush_dib
.
height
=
pattern
.
height
;
...
...
@@ -1537,13 +1557,14 @@ static BOOL pattern_brush(dibdrv_physdev *pdev, dib_info *dib, int num, const RE
int
i
,
j
;
const
WINEREGION
*
clip
;
POINT
origin
;
BOOL
needs_reselect
=
FALSE
;
if
(
pdev
->
brush_and_bits
==
NULL
)
{
switch
(
pdev
->
brush_style
)
{
case
BS_DIBPATTERN
:
if
(
!
pdev
->
brush_dib
.
bits
.
ptr
&&
!
select_pattern_brush
(
pdev
))
if
(
!
pdev
->
brush_dib
.
bits
.
ptr
&&
!
select_pattern_brush
(
pdev
,
&
needs_reselect
))
return
FALSE
;
if
(
!
create_pattern_brush_bits
(
pdev
))
return
FALSE
;
...
...
@@ -1600,9 +1621,7 @@ static BOOL pattern_brush(dibdrv_physdev *pdev, dib_info *dib, int num, const RE
}
release_wine_region
(
region
);
/* we need to recompute the bits each time for DIB_PAL_COLORS */
if
(
pdev
->
brush_style
==
BS_DIBPATTERN
&&
pdev
->
brush_pattern_usage
==
DIB_PAL_COLORS
)
free_pattern_brush
(
pdev
);
if
(
needs_reselect
)
free_pattern_brush
(
pdev
);
return
TRUE
;
}
...
...
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