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
524aef66
Commit
524aef66
authored
May 22, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Use a rop_mask_bits object to store the brush bits.
parent
e5551393
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
19 deletions
+17
-19
dibdrv.h
dlls/gdi32/dibdrv/dibdrv.h
+1
-2
objects.c
dlls/gdi32/dibdrv/objects.c
+16
-17
No files found.
dlls/gdi32/dibdrv/dibdrv.h
View file @
524aef66
...
...
@@ -76,8 +76,7 @@ typedef struct dib_brush
INT
rop
;
/* rop2 last used to create the brush bits */
COLORREF
colorref
;
dib_info
dib
;
void
*
and_bits
;
void
*
xor_bits
;
rop_mask_bits
masks
;
struct
brush_pattern
pattern
;
BOOL
(
*
rects
)(
struct
dibdrv_physdev
*
pdev
,
struct
dib_brush
*
brush
,
dib_info
*
dib
,
int
num
,
const
RECT
*
rects
,
INT
rop
);
...
...
dlls/gdi32/dibdrv/objects.c
View file @
524aef66
...
...
@@ -1734,10 +1734,10 @@ static BOOL solid_brush(dibdrv_physdev *pdev, dib_brush *brush, dib_info *dib,
static
void
free_pattern_brush_bits
(
dib_brush
*
brush
)
{
HeapFree
(
GetProcessHeap
(),
0
,
brush
->
and_bits
);
HeapFree
(
GetProcessHeap
(),
0
,
brush
->
xor_bits
);
brush
->
and_bits
=
NULL
;
brush
->
xor_bits
=
NULL
;
HeapFree
(
GetProcessHeap
(),
0
,
brush
->
masks
.
and
);
HeapFree
(
GetProcessHeap
(),
0
,
brush
->
masks
.
xor
);
brush
->
masks
.
and
=
NULL
;
brush
->
masks
.
xor
=
NULL
;
}
void
free_pattern_brush
(
dib_brush
*
brush
)
...
...
@@ -1752,13 +1752,13 @@ static BOOL create_pattern_brush_bits( dib_brush *brush )
DWORD
*
brush_bits
=
brush
->
dib
.
bits
.
ptr
;
DWORD
*
and_bits
,
*
xor_bits
;
assert
(
brush
->
and_bits
==
NULL
);
assert
(
brush
->
xor_bits
==
NULL
);
assert
(
brush
->
masks
.
and
==
NULL
);
assert
(
brush
->
masks
.
xor
==
NULL
);
assert
(
brush
->
dib
.
stride
>
0
);
and_bits
=
brush
->
and_bits
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
xor_bits
=
brush
->
xor_bits
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
and_bits
=
brush
->
masks
.
and
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
xor_bits
=
brush
->
masks
.
xor
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
!
and_bits
||
!
xor_bits
)
{
...
...
@@ -1790,12 +1790,11 @@ static BOOL create_hatch_brush_bits(dibdrv_physdev *pdev, dib_brush *brush, BOOL
{
dib_info
hatch
;
rop_mask
fg_mask
,
bg_mask
;
rop_mask_bits
mask_bits
;
DWORD
size
;
BOOL
ret
;
assert
(
brush
->
and_bits
==
NULL
);
assert
(
brush
->
xor_bits
==
NULL
);
assert
(
brush
->
masks
.
and
==
NULL
);
assert
(
brush
->
masks
.
xor
==
NULL
);
/* Just initialise brush dib with the color / sizing info. We don't
need the bits as we'll calculate the rop masks straight from
...
...
@@ -1812,10 +1811,10 @@ static BOOL create_hatch_brush_bits(dibdrv_physdev *pdev, dib_brush *brush, BOOL
size
=
brush
->
dib
.
height
*
brush
->
dib
.
stride
;
mask_bits
.
and
=
brush
->
and_bits
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
mask_bits
.
xor
=
brush
->
xor_bits
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
brush
->
masks
.
and
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
brush
->
masks
.
xor
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
!
mask_bits
.
and
||
!
mask_bit
s
.
xor
)
if
(
!
brush
->
masks
.
and
||
!
brush
->
mask
s
.
xor
)
{
ERR
(
"Failed to create pattern brush bits
\n
"
);
free_pattern_brush_bits
(
brush
);
...
...
@@ -1841,7 +1840,7 @@ static BOOL create_hatch_brush_bits(dibdrv_physdev *pdev, dib_brush *brush, BOOL
if
(
GetBkMode
(
pdev
->
dev
.
hdc
)
!=
TRANSPARENT
&&
(
GetBkColor
(
pdev
->
dev
.
hdc
)
&
(
1
<<
24
)))
*
needs_reselect
=
TRUE
;
ret
=
brush
->
dib
.
funcs
->
create_rop_masks
(
&
brush
->
dib
,
&
hatch
,
&
fg_mask
,
&
bg_mask
,
&
mask_bit
s
);
ret
=
brush
->
dib
.
funcs
->
create_rop_masks
(
&
brush
->
dib
,
&
hatch
,
&
fg_mask
,
&
bg_mask
,
&
brush
->
mask
s
);
if
(
!
ret
)
free_pattern_brush_bits
(
brush
);
return
ret
;
...
...
@@ -1966,7 +1965,7 @@ static BOOL pattern_brush(dibdrv_physdev *pdev, dib_brush *brush, dib_info *dib,
brush
->
rop
=
rop
;
}
if
(
brush
->
and_bits
==
NULL
)
if
(
brush
->
masks
.
and
==
NULL
)
{
switch
(
brush
->
style
)
{
...
...
@@ -1990,7 +1989,7 @@ static BOOL pattern_brush(dibdrv_physdev *pdev, dib_brush *brush, dib_info *dib,
GetBrushOrgEx
(
pdev
->
dev
.
hdc
,
&
origin
);
dib
->
funcs
->
pattern_rects
(
dib
,
num
,
rects
,
&
origin
,
&
brush
->
dib
,
brush
->
and_bits
,
brush
->
xor_bits
);
dib
->
funcs
->
pattern_rects
(
dib
,
num
,
rects
,
&
origin
,
&
brush
->
dib
,
brush
->
masks
.
and
,
brush
->
masks
.
xor
);
if
(
needs_reselect
)
free_pattern_brush
(
brush
);
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