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
c5f41f89
Commit
c5f41f89
authored
Jun 02, 2011
by
Huw Davies
Committed by
Alexandre Julliard
Jun 02, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Update pixel colours when the colour table changes.
parent
78ab293d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
5 deletions
+39
-5
dc.c
dlls/gdi32/dibdrv/dc.c
+33
-5
objects.c
dlls/gdi32/dibdrv/objects.c
+4
-0
gdi_private.h
dlls/gdi32/gdi_private.h
+2
-0
No files found.
dlls/gdi32/dibdrv/dc.c
View file @
c5f41f89
...
...
@@ -357,6 +357,37 @@ static void CDECL dibdrv_SetDeviceClipping( PHYSDEV dev, HRGN vis_rgn, HRGN clip
return
next
->
funcs
->
pSetDeviceClipping
(
next
,
vis_rgn
,
clip_rgn
);
}
static
void
update_masks
(
dibdrv_physdev
*
pdev
,
INT
rop
)
{
calc_and_xor_masks
(
rop
,
pdev
->
pen_color
,
&
pdev
->
pen_and
,
&
pdev
->
pen_xor
);
update_brush_rop
(
pdev
,
rop
);
if
(
GetBkMode
(
pdev
->
dev
.
hdc
)
==
OPAQUE
)
calc_and_xor_masks
(
rop
,
pdev
->
bkgnd_color
,
&
pdev
->
bkgnd_and
,
&
pdev
->
bkgnd_xor
);
}
/***********************************************************************
* dibdrv_SetDIBColorTable
*/
static
UINT
CDECL
dibdrv_SetDIBColorTable
(
PHYSDEV
dev
,
UINT
pos
,
UINT
count
,
const
RGBQUAD
*
colors
)
{
PHYSDEV
next
=
GET_NEXT_PHYSDEV
(
dev
,
pSetDIBColorTable
);
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
TRACE
(
"(%p, %d, %d, %p)
\n
"
,
dev
,
pos
,
count
,
colors
);
if
(
pdev
->
dib
.
color_table
&&
pos
<
pdev
->
dib
.
color_table_size
)
{
if
(
pos
+
count
>
pdev
->
dib
.
color_table_size
)
count
=
pdev
->
dib
.
color_table_size
-
pos
;
memcpy
(
pdev
->
dib
.
color_table
+
pos
,
colors
,
count
*
sizeof
(
RGBQUAD
)
);
pdev
->
pen_color
=
pdev
->
dib
.
funcs
->
colorref_to_pixel
(
&
pdev
->
dib
,
pdev
->
pen_colorref
);
pdev
->
brush_color
=
pdev
->
dib
.
funcs
->
colorref_to_pixel
(
&
pdev
->
dib
,
pdev
->
brush_colorref
);
pdev
->
bkgnd_color
=
pdev
->
dib
.
funcs
->
colorref_to_pixel
(
&
pdev
->
dib
,
GetBkColor
(
dev
->
hdc
)
);
update_masks
(
pdev
,
GetROP2
(
dev
->
hdc
)
);
}
return
next
->
funcs
->
pSetDIBColorTable
(
next
,
pos
,
count
,
colors
);
}
/***********************************************************************
* dibdrv_SetROP2
*/
...
...
@@ -365,10 +396,7 @@ static INT CDECL dibdrv_SetROP2( PHYSDEV dev, INT rop )
PHYSDEV
next
=
GET_NEXT_PHYSDEV
(
dev
,
pSetROP2
);
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
calc_and_xor_masks
(
rop
,
pdev
->
pen_color
,
&
pdev
->
pen_and
,
&
pdev
->
pen_xor
);
update_brush_rop
(
pdev
,
rop
);
if
(
GetBkMode
(
dev
->
hdc
)
==
OPAQUE
)
calc_and_xor_masks
(
rop
,
pdev
->
bkgnd_color
,
&
pdev
->
bkgnd_and
,
&
pdev
->
bkgnd_xor
);
update_masks
(
pdev
,
rop
);
return
next
->
funcs
->
pSetROP2
(
next
,
rop
);
}
...
...
@@ -462,7 +490,7 @@ const DC_FUNCTIONS dib_driver =
dibdrv_SetBkMode
,
/* pSetBkMode */
dibdrv_SetDCBrushColor
,
/* pSetDCBrushColor */
dibdrv_SetDCPenColor
,
/* pSetDCPenColor */
NULL
,
/* pSetDIBColorTable */
dibdrv_SetDIBColorTable
,
/* pSetDIBColorTable */
NULL
,
/* pSetDIBits */
NULL
,
/* pSetDIBitsToDevice */
dibdrv_SetDeviceClipping
,
/* pSetDeviceClipping */
...
...
dlls/gdi32/dibdrv/objects.c
View file @
c5f41f89
...
...
@@ -868,6 +868,7 @@ HPEN CDECL dibdrv_SelectPen( PHYSDEV dev, HPEN hpen )
if
(
hpen
==
GetStockObject
(
DC_PEN
))
logpen
.
lopnColor
=
GetDCPenColor
(
dev
->
hdc
);
pdev
->
pen_colorref
=
logpen
.
lopnColor
;
pdev
->
pen_color
=
pdev
->
dib
.
funcs
->
colorref_to_pixel
(
&
pdev
->
dib
,
logpen
.
lopnColor
);
calc_and_xor_masks
(
GetROP2
(
dev
->
hdc
),
pdev
->
pen_color
,
&
pdev
->
pen_and
,
&
pdev
->
pen_xor
);
...
...
@@ -919,6 +920,7 @@ COLORREF CDECL dibdrv_SetDCPenColor( PHYSDEV dev, COLORREF color )
if
(
GetCurrentObject
(
dev
->
hdc
,
OBJ_PEN
)
==
GetStockObject
(
DC_PEN
))
{
pdev
->
pen_colorref
=
color
;
pdev
->
pen_color
=
pdev
->
dib
.
funcs
->
colorref_to_pixel
(
&
pdev
->
dib
,
color
);
calc_and_xor_masks
(
GetROP2
(
dev
->
hdc
),
pdev
->
pen_color
,
&
pdev
->
pen_and
,
&
pdev
->
pen_xor
);
}
...
...
@@ -1102,6 +1104,7 @@ HBRUSH CDECL dibdrv_SelectBrush( PHYSDEV dev, HBRUSH hbrush )
switch
(
logbrush
.
lbStyle
)
{
case
BS_SOLID
:
pdev
->
brush_colorref
=
logbrush
.
lbColor
;
pdev
->
brush_color
=
pdev
->
dib
.
funcs
->
colorref_to_pixel
(
&
pdev
->
dib
,
logbrush
.
lbColor
);
calc_and_xor_masks
(
GetROP2
(
dev
->
hdc
),
pdev
->
brush_color
,
&
pdev
->
brush_and
,
&
pdev
->
brush_xor
);
pdev
->
brush_rects
=
solid_brush
;
...
...
@@ -1152,6 +1155,7 @@ COLORREF CDECL dibdrv_SetDCBrushColor( PHYSDEV dev, COLORREF color )
if
(
GetCurrentObject
(
dev
->
hdc
,
OBJ_BRUSH
)
==
GetStockObject
(
DC_BRUSH
))
{
pdev
->
brush_colorref
=
color
;
pdev
->
brush_color
=
pdev
->
dib
.
funcs
->
colorref_to_pixel
(
&
pdev
->
dib
,
color
);
calc_and_xor_masks
(
GetROP2
(
dev
->
hdc
),
pdev
->
brush_color
,
&
pdev
->
brush_and
,
&
pdev
->
brush_xor
);
}
...
...
dlls/gdi32/gdi_private.h
View file @
c5f41f89
...
...
@@ -118,6 +118,7 @@ typedef struct dibdrv_physdev
DWORD
defer
;
/* pen */
COLORREF
pen_colorref
;
DWORD
pen_color
,
pen_and
,
pen_xor
;
dash_pattern
pen_pattern
;
dash_pos
dash_pos
;
...
...
@@ -126,6 +127,7 @@ typedef struct dibdrv_physdev
/* brush */
UINT
brush_style
;
INT
brush_rop
;
/* PatBlt, for example, can override the DC's rop2 */
COLORREF
brush_colorref
;
DWORD
brush_color
,
brush_and
,
brush_xor
;
dib_info
brush_dib
;
void
*
brush_and_bits
,
*
brush_xor_bits
;
...
...
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