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
f8fa169d
Commit
f8fa169d
authored
Jan 12, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Store foreground/background color even when passed CLR_INVALID.
parent
9ecc1e07
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
12 deletions
+40
-12
dc.c
dlls/gdi32/dc.c
+4
-12
dc.c
dlls/gdi32/tests/dc.c
+36
-0
No files found.
dlls/gdi32/dc.c
View file @
f8fa169d
...
...
@@ -853,12 +853,8 @@ COLORREF WINAPI SetBkColor( HDC hdc, COLORREF color )
if
(
dc
)
{
PHYSDEV
physdev
=
GET_DC_PHYSDEV
(
dc
,
pSetBkColor
);
color
=
physdev
->
funcs
->
pSetBkColor
(
physdev
,
color
);
if
(
color
!=
CLR_INVALID
)
{
ret
=
dc
->
backgroundColor
;
dc
->
backgroundColor
=
color
;
}
ret
=
dc
->
backgroundColor
;
dc
->
backgroundColor
=
physdev
->
funcs
->
pSetBkColor
(
physdev
,
color
);
release_dc_ptr
(
dc
);
}
return
ret
;
...
...
@@ -894,12 +890,8 @@ COLORREF WINAPI SetTextColor( HDC hdc, COLORREF color )
if
(
dc
)
{
PHYSDEV
physdev
=
GET_DC_PHYSDEV
(
dc
,
pSetTextColor
);
color
=
physdev
->
funcs
->
pSetTextColor
(
physdev
,
color
);
if
(
color
!=
CLR_INVALID
)
{
ret
=
dc
->
textColor
;
dc
->
textColor
=
color
;
}
ret
=
dc
->
textColor
;
dc
->
textColor
=
physdev
->
funcs
->
pSetTextColor
(
physdev
,
color
);
release_dc_ptr
(
dc
);
}
return
ret
;
...
...
dlls/gdi32/tests/dc.c
View file @
f8fa169d
...
...
@@ -54,6 +54,41 @@ static void dump_region(HRGN hrgn)
HeapFree
(
GetProcessHeap
(),
0
,
data
);
}
static
void
test_dc_values
(
void
)
{
HDC
hdc
=
CreateDCA
(
"DISPLAY"
,
NULL
,
NULL
,
NULL
);
COLORREF
color
;
ok
(
hdc
!=
NULL
,
"CreateDC failed
\n
"
);
color
=
SetBkColor
(
hdc
,
0x12345678
);
ok
(
color
==
0xffffff
,
"initial color %08x
\n
"
,
color
);
color
=
GetBkColor
(
hdc
);
ok
(
color
==
0x12345678
,
"wrong color %08x
\n
"
,
color
);
color
=
SetBkColor
(
hdc
,
0xffffffff
);
ok
(
color
==
0x12345678
,
"wrong color %08x
\n
"
,
color
);
color
=
GetBkColor
(
hdc
);
ok
(
color
==
0xffffffff
,
"wrong color %08x
\n
"
,
color
);
color
=
SetBkColor
(
hdc
,
0
);
ok
(
color
==
0xffffffff
,
"wrong color %08x
\n
"
,
color
);
color
=
GetBkColor
(
hdc
);
ok
(
color
==
0
,
"wrong color %08x
\n
"
,
color
);
color
=
SetTextColor
(
hdc
,
0xffeeddcc
);
ok
(
color
==
0
,
"initial color %08x
\n
"
,
color
);
color
=
GetTextColor
(
hdc
);
ok
(
color
==
0xffeeddcc
,
"wrong color %08x
\n
"
,
color
);
color
=
SetTextColor
(
hdc
,
0xffffffff
);
ok
(
color
==
0xffeeddcc
,
"wrong color %08x
\n
"
,
color
);
color
=
GetTextColor
(
hdc
);
ok
(
color
==
0xffffffff
,
"wrong color %08x
\n
"
,
color
);
color
=
SetTextColor
(
hdc
,
0
);
ok
(
color
==
0xffffffff
,
"wrong color %08x
\n
"
,
color
);
color
=
GetTextColor
(
hdc
);
ok
(
color
==
0
,
"wrong color %08x
\n
"
,
color
);
DeleteDC
(
hdc
);
}
static
void
test_savedc_2
(
void
)
{
HWND
hwnd
;
...
...
@@ -999,6 +1034,7 @@ static void test_printer_dc(void)
START_TEST
(
dc
)
{
pSetLayout
=
(
void
*
)
GetProcAddress
(
GetModuleHandle
(
"gdi32.dll"
),
"SetLayout"
);
test_dc_values
();
test_savedc
();
test_savedc_2
();
test_GdiConvertToDevmodeW
();
...
...
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