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
03496d6f
Commit
03496d6f
authored
Nov 08, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Avoid copying the brush pattern if the format matches the DC.
parent
bb162ba4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
1 deletion
+29
-1
objects.c
dlls/gdi32/dibdrv/objects.c
+29
-1
No files found.
dlls/gdi32/dibdrv/objects.c
View file @
03496d6f
...
...
@@ -1246,6 +1246,27 @@ static BOOL create_hatch_brush_bits(dibdrv_physdev *pdev)
return
ret
;
}
static
BOOL
matching_pattern_format
(
dib_info
*
dib
,
dib_info
*
pattern
)
{
if
(
dib
->
bit_count
!=
pattern
->
bit_count
)
return
FALSE
;
if
(
dib
->
stride
!=
pattern
->
stride
)
return
FALSE
;
switch
(
dib
->
bit_count
)
{
case
1
:
case
4
:
case
8
:
if
(
dib
->
color_table_size
!=
pattern
->
color_table_size
)
return
FALSE
;
return
!
memcmp
(
dib
->
color_table
,
pattern
->
color_table
,
dib
->
color_table_size
*
sizeof
(
RGBQUAD
)
);
case
16
:
case
32
:
return
(
dib
->
red_mask
==
pattern
->
red_mask
&&
dib
->
green_mask
==
pattern
->
green_mask
&&
dib
->
blue_mask
==
pattern
->
blue_mask
);
}
return
TRUE
;
}
static
void
select_pattern_brush
(
dibdrv_physdev
*
pdev
,
dib_info
*
pattern
)
{
RECT
rect
;
...
...
@@ -1257,7 +1278,14 @@ static void select_pattern_brush( dibdrv_physdev *pdev, dib_info *pattern )
pdev
->
brush_dib
.
width
=
pattern
->
width
;
pdev
->
brush_dib
.
stride
=
get_dib_stride
(
pdev
->
brush_dib
.
width
,
pdev
->
brush_dib
.
bit_count
);
pdev
->
brush_dib
.
bits
.
param
=
NULL
;
if
(
matching_pattern_format
(
&
pdev
->
brush_dib
,
pattern
))
{
pdev
->
brush_dib
.
bits
.
ptr
=
pattern
->
bits
.
ptr
;
pdev
->
brush_dib
.
bits
.
is_copy
=
FALSE
;
pdev
->
brush_dib
.
bits
.
free
=
NULL
;
return
;
}
pdev
->
brush_dib
.
bits
.
ptr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
pdev
->
brush_dib
.
height
*
pdev
->
brush_dib
.
stride
);
pdev
->
brush_dib
.
bits
.
is_copy
=
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