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
a80eafe8
Commit
a80eafe8
authored
Dec 27, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Re-create the brush bits only when the ROP has really changed.
parent
8b3271c3
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
49 deletions
+30
-49
bitblt.c
dlls/gdi32/dibdrv/bitblt.c
+3
-6
dc.c
dlls/gdi32/dibdrv/dc.c
+2
-15
dibdrv.h
dlls/gdi32/dibdrv/dibdrv.h
+3
-4
graphics.c
dlls/gdi32/dibdrv/graphics.c
+3
-8
objects.c
dlls/gdi32/dibdrv/objects.c
+19
-16
No files found.
dlls/gdi32/dibdrv/bitblt.c
View file @
a80eafe8
...
...
@@ -761,14 +761,11 @@ static DWORD execute_rop( dibdrv_physdev *pdev, const RECT *dst_rect, dib_info *
OP_DST
(
*
opcode
)
==
DST
?
clipped_rects
:
NULL
,
OP_ROP
(
*
opcode
)
);
break
;
case
OP_ARGS
(
PAT
,
DST
):
update_brush_rop
(
pdev
,
OP_ROP
(
*
opcode
)
);
pdev
->
brush_rects
(
pdev
,
dibs
[
DST
],
clipped_rects
->
count
,
clipped_rects
->
rects
);
update_brush_rop
(
pdev
,
GetROP2
(
pdev
->
dev
.
hdc
)
);
pdev
->
brush_rects
(
pdev
,
dibs
[
DST
],
clipped_rects
->
count
,
clipped_rects
->
rects
,
OP_ROP
(
*
opcode
)
);
break
;
case
OP_ARGS
(
PAT
,
SRC
):
update_brush_rop
(
pdev
,
OP_ROP
(
*
opcode
)
);
pdev
->
brush_rects
(
pdev
,
dibs
[
SRC
],
1
,
&
rects
[
SRC
]
);
update_brush_rop
(
pdev
,
GetROP2
(
pdev
->
dev
.
hdc
)
);
pdev
->
brush_rects
(
pdev
,
dibs
[
SRC
],
1
,
&
rects
[
SRC
],
OP_ROP
(
*
opcode
)
);
break
;
}
}
...
...
dlls/gdi32/dibdrv/dc.c
View file @
a80eafe8
...
...
@@ -389,24 +389,11 @@ static UINT dibdrv_SetDIBColorTable( PHYSDEV dev, UINT pos, UINT count, const RG
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
TRACE
(
"(%p, %d, %d, %p)
\n
"
,
dev
,
pos
,
count
,
colors
);
if
(
pdev
->
dib
.
color_table
)
update_brush_rop
(
pdev
,
GetROP2
(
dev
->
hdc
)
);
if
(
pdev
->
dib
.
color_table
)
pdev
->
brush_rop
=
-
1
;
/* force re-creating the brush bits */
return
next
->
funcs
->
pSetDIBColorTable
(
next
,
pos
,
count
,
colors
);
}
/***********************************************************************
* dibdrv_SetROP2
*/
static
INT
dibdrv_SetROP2
(
PHYSDEV
dev
,
INT
rop
)
{
PHYSDEV
next
=
GET_NEXT_PHYSDEV
(
dev
,
pSetROP2
);
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
update_brush_rop
(
pdev
,
rop
);
return
next
->
funcs
->
pSetROP2
(
next
,
rop
);
}
const
struct
gdi_dc_funcs
dib_driver
=
{
...
...
@@ -523,7 +510,7 @@ const struct gdi_dc_funcs dib_driver =
dibdrv_SetPixel
,
/* pSetPixel */
NULL
,
/* pSetPixelFormat */
NULL
,
/* pSetPolyFillMode */
dibdrv_SetROP2
,
/* pSetROP2 */
NULL
,
/* pSetROP2 */
NULL
,
/* pSetRelAbs */
NULL
,
/* pSetStretchBltMode */
NULL
,
/* pSetTextAlign */
...
...
dlls/gdi32/dibdrv/dibdrv.h
View file @
a80eafe8
...
...
@@ -93,7 +93,7 @@ typedef struct dibdrv_physdev
/* brush */
UINT
brush_style
;
UINT
brush_hatch
;
INT
brush_rop
;
/*
PatBlt, for example, can override the DC's rop2
*/
INT
brush_rop
;
/*
rop2 last used to create the brush bits
*/
COLORREF
brush_colorref
;
dib_info
brush_dib
;
void
*
brush_and_bits
,
*
brush_xor_bits
;
...
...
@@ -101,7 +101,7 @@ typedef struct dibdrv_physdev
void
*
brush_pattern_bits
;
UINT
brush_pattern_usage
;
HBITMAP
brush_pattern_bitmap
;
BOOL
(
*
brush_rects
)(
struct
dibdrv_physdev
*
pdev
,
dib_info
*
dib
,
int
num
,
const
RECT
*
rects
);
BOOL
(
*
brush_rects
)(
struct
dibdrv_physdev
*
pdev
,
dib_info
*
dib
,
int
num
,
const
RECT
*
rects
,
INT
rop
);
}
dibdrv_physdev
;
#define DEFER_PEN 2
...
...
@@ -220,7 +220,6 @@ struct clipped_rects
};
extern
void
get_rop_codes
(
INT
rop
,
struct
rop_codes
*
codes
)
DECLSPEC_HIDDEN
;
extern
void
update_brush_rop
(
dibdrv_physdev
*
pdev
,
INT
rop
)
DECLSPEC_HIDDEN
;
extern
void
reset_dash_origin
(
dibdrv_physdev
*
pdev
)
DECLSPEC_HIDDEN
;
extern
void
init_dib_info_from_bitmapinfo
(
dib_info
*
dib
,
const
BITMAPINFO
*
info
,
void
*
bits
,
enum
dib_info_flags
flags
)
DECLSPEC_HIDDEN
;
extern
BOOL
init_dib_info_from_bitmapobj
(
dib_info
*
dib
,
BITMAPOBJ
*
bmp
,
enum
dib_info_flags
flags
)
DECLSPEC_HIDDEN
;
...
...
@@ -230,7 +229,7 @@ extern void copy_dib_color_info(dib_info *dst, const dib_info *src) DECLSPEC_HID
extern
BOOL
convert_dib
(
dib_info
*
dst
,
const
dib_info
*
src
)
DECLSPEC_HIDDEN
;
extern
COLORREF
make_rgb_colorref
(
HDC
hdc
,
dib_info
*
dib
,
COLORREF
color
,
BOOL
*
got_pixel
,
DWORD
*
pixel
)
DECLSPEC_HIDDEN
;
extern
DWORD
get_pixel_color
(
dibdrv_physdev
*
pdev
,
COLORREF
color
,
BOOL
mono_fixup
)
DECLSPEC_HIDDEN
;
extern
BOOL
brush_rect
(
dibdrv_physdev
*
pdev
,
const
RECT
*
rect
)
DECLSPEC_HIDDEN
;
extern
BOOL
brush_rect
(
dibdrv_physdev
*
pdev
,
const
RECT
*
rect
,
INT
rop
)
DECLSPEC_HIDDEN
;
extern
int
get_clipped_rects
(
const
dib_info
*
dib
,
const
RECT
*
rc
,
HRGN
clip
,
struct
clipped_rects
*
clip_rects
)
DECLSPEC_HIDDEN
;
extern
int
clip_line
(
const
POINT
*
start
,
const
POINT
*
end
,
const
RECT
*
clip
,
const
bres_params
*
params
,
POINT
*
pt1
,
POINT
*
pt2
)
DECLSPEC_HIDDEN
;
...
...
dlls/gdi32/dibdrv/graphics.c
View file @
a80eafe8
...
...
@@ -476,15 +476,10 @@ static inline INT get_rop2_from_rop(INT rop)
BOOL
dibdrv_PatBlt
(
PHYSDEV
dev
,
struct
bitblt_coords
*
dst
,
DWORD
rop
)
{
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
INT
rop2
=
get_rop2_from_rop
(
rop
);
BOOL
ret
;
TRACE
(
"(%p, %d, %d, %d, %d, %06x)
\n
"
,
dev
,
dst
->
x
,
dst
->
y
,
dst
->
width
,
dst
->
height
,
rop
);
update_brush_rop
(
pdev
,
rop2
);
ret
=
brush_rect
(
pdev
,
&
dst
->
visrect
);
update_brush_rop
(
pdev
,
GetROP2
(
dev
->
hdc
)
);
return
ret
;
return
brush_rect
(
pdev
,
&
dst
->
visrect
,
get_rop2_from_rop
(
rop
)
);
}
/***********************************************************************
...
...
@@ -506,7 +501,7 @@ BOOL dibdrv_PaintRgn( PHYSDEV dev, HRGN rgn )
{
rect
=
get_device_rect
(
dev
->
hdc
,
region
->
rects
[
i
].
left
,
region
->
rects
[
i
].
top
,
region
->
rects
[
i
].
right
,
region
->
rects
[
i
].
bottom
,
FALSE
);
brush_rect
(
pdev
,
&
rect
);
brush_rect
(
pdev
,
&
rect
,
GetROP2
(
dev
->
hdc
)
);
}
release_wine_region
(
rgn
);
...
...
@@ -602,7 +597,7 @@ BOOL dibdrv_Rectangle( PHYSDEV dev, INT left, INT top, INT right, INT bottom )
rect
.
right
-=
1
;
rect
.
bottom
-=
1
;
brush_rect
(
pdev
,
&
rect
);
brush_rect
(
pdev
,
&
rect
,
GetROP2
(
dev
->
hdc
)
);
return
TRUE
;
}
...
...
dlls/gdi32/dibdrv/objects.c
View file @
a80eafe8
...
...
@@ -1369,12 +1369,12 @@ COLORREF dibdrv_SetDCPenColor( PHYSDEV dev, COLORREF color )
*
* Fill a number of rectangles with the solid brush
*/
static
BOOL
solid_brush
(
dibdrv_physdev
*
pdev
,
dib_info
*
dib
,
int
num
,
const
RECT
*
rects
)
static
BOOL
solid_brush
(
dibdrv_physdev
*
pdev
,
dib_info
*
dib
,
int
num
,
const
RECT
*
rects
,
INT
rop
)
{
rop_mask
brush_color
;
DWORD
color
=
get_pixel_color
(
pdev
,
pdev
->
brush_colorref
,
TRUE
);
calc_rop_masks
(
pdev
->
brush_
rop
,
color
,
&
brush_color
);
calc_rop_masks
(
rop
,
color
,
&
brush_color
);
dib
->
funcs
->
solid_rects
(
dib
,
num
,
rects
,
brush_color
.
and
,
brush_color
.
xor
);
return
TRUE
;
}
...
...
@@ -1433,7 +1433,7 @@ static const DWORD hatches[6][8] =
{
0x81
,
0x42
,
0x24
,
0x18
,
0x18
,
0x24
,
0x42
,
0x81
}
/* HS_DIAGCROSS */
};
static
BOOL
create_hatch_brush_bits
(
dibdrv_physdev
*
pdev
)
static
BOOL
create_hatch_brush_bits
(
dibdrv_physdev
*
pdev
,
BOOL
*
needs_reselect
)
{
dib_info
hatch
;
rop_mask
fg_mask
,
bg_mask
;
...
...
@@ -1474,6 +1474,11 @@ static BOOL create_hatch_brush_bits(dibdrv_physdev *pdev)
get_color_masks
(
pdev
,
pdev
->
brush_rop
,
pdev
->
brush_colorref
,
&
fg_mask
,
&
bg_mask
);
if
(
pdev
->
brush_colorref
&
(
1
<<
24
))
/* PALETTEINDEX */
*
needs_reselect
=
TRUE
;
if
(
GetBkMode
(
pdev
->
dev
.
hdc
)
!=
TRANSPARENT
&&
(
GetBkColor
(
pdev
->
dev
.
hdc
)
&
(
1
<<
24
)))
*
needs_reselect
=
TRUE
;
ret
=
pdev
->
brush_dib
.
funcs
->
create_rop_masks
(
&
pdev
->
brush_dib
,
&
hatch
,
&
fg_mask
,
&
bg_mask
,
&
mask_bits
);
if
(
!
ret
)
free_pattern_brush_bits
(
pdev
);
...
...
@@ -1591,11 +1596,17 @@ static BOOL select_pattern_brush( dibdrv_physdev *pdev, BOOL *needs_reselect )
* Fill a number of rectangles with the pattern brush
* FIXME: Should we insist l < r && t < b? Currently we assume this.
*/
static
BOOL
pattern_brush
(
dibdrv_physdev
*
pdev
,
dib_info
*
dib
,
int
num
,
const
RECT
*
rects
)
static
BOOL
pattern_brush
(
dibdrv_physdev
*
pdev
,
dib_info
*
dib
,
int
num
,
const
RECT
*
rects
,
INT
rop
)
{
POINT
origin
;
BOOL
needs_reselect
=
FALSE
;
if
(
rop
!=
pdev
->
brush_rop
)
{
free_pattern_brush_bits
(
pdev
);
pdev
->
brush_rop
=
rop
;
}
if
(
pdev
->
brush_and_bits
==
NULL
)
{
switch
(
pdev
->
brush_style
)
...
...
@@ -1608,7 +1619,7 @@ static BOOL pattern_brush(dibdrv_physdev *pdev, dib_info *dib, int num, const RE
break
;
case
BS_HATCHED
:
if
(
!
create_hatch_brush_bits
(
pdev
))
if
(
!
create_hatch_brush_bits
(
pdev
,
&
needs_reselect
))
return
FALSE
;
break
;
...
...
@@ -1626,17 +1637,11 @@ static BOOL pattern_brush(dibdrv_physdev *pdev, dib_info *dib, int num, const RE
return
TRUE
;
}
static
BOOL
null_brush
(
dibdrv_physdev
*
pdev
,
dib_info
*
dib
,
int
num
,
const
RECT
*
rects
)
static
BOOL
null_brush
(
dibdrv_physdev
*
pdev
,
dib_info
*
dib
,
int
num
,
const
RECT
*
rects
,
INT
rop
)
{
return
TRUE
;
}
void
update_brush_rop
(
dibdrv_physdev
*
pdev
,
INT
rop
)
{
pdev
->
brush_rop
=
rop
;
free_pattern_brush_bits
(
pdev
);
}
/***********************************************************************
* dibdrv_SelectBrush
*/
...
...
@@ -1675,7 +1680,6 @@ HBRUSH dibdrv_SelectBrush( PHYSDEV dev, HBRUSH hbrush, HBITMAP bitmap,
{
case
BS_SOLID
:
pdev
->
brush_colorref
=
logbrush
.
lbColor
;
pdev
->
brush_rop
=
GetROP2
(
dev
->
hdc
);
pdev
->
brush_rects
=
solid_brush
;
break
;
...
...
@@ -1687,7 +1691,6 @@ HBRUSH dibdrv_SelectBrush( PHYSDEV dev, HBRUSH hbrush, HBITMAP bitmap,
if
(
logbrush
.
lbHatch
>
HS_DIAGCROSS
)
return
0
;
pdev
->
brush_hatch
=
logbrush
.
lbHatch
;
pdev
->
brush_colorref
=
logbrush
.
lbColor
;
pdev
->
brush_rop
=
GetROP2
(
dev
->
hdc
);
pdev
->
brush_rects
=
pattern_brush
;
break
;
...
...
@@ -1712,13 +1715,13 @@ COLORREF dibdrv_SetDCBrushColor( PHYSDEV dev, COLORREF color )
return
next
->
funcs
->
pSetDCBrushColor
(
next
,
color
);
}
BOOL
brush_rect
(
dibdrv_physdev
*
pdev
,
const
RECT
*
rect
)
BOOL
brush_rect
(
dibdrv_physdev
*
pdev
,
const
RECT
*
rect
,
INT
rop
)
{
struct
clipped_rects
clipped_rects
;
BOOL
ret
;
if
(
!
get_clipped_rects
(
&
pdev
->
dib
,
rect
,
pdev
->
clip
,
&
clipped_rects
))
return
TRUE
;
ret
=
pdev
->
brush_rects
(
pdev
,
&
pdev
->
dib
,
clipped_rects
.
count
,
clipped_rects
.
rects
);
ret
=
pdev
->
brush_rects
(
pdev
,
&
pdev
->
dib
,
clipped_rects
.
count
,
clipped_rects
.
rects
,
rop
);
free_clipped_rects
(
&
clipped_rects
);
return
ret
;
}
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