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
849c4716
Commit
849c4716
authored
Apr 25, 2017
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 25, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uxtheme: Fix buffer dc origin and clipping.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a3f0a591
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
2 deletions
+57
-2
buffer.c
dlls/uxtheme/buffer.c
+3
-1
system.c
dlls/uxtheme/tests/system.c
+54
-1
No files found.
dlls/uxtheme/buffer.c
View file @
849c4716
...
...
@@ -137,6 +137,8 @@ HPAINTBUFFER WINAPI BeginBufferedPaint(HDC targetdc, const RECT *rect,
return
NULL
;
}
SetWindowOrgEx
(
buffer
->
memorydc
,
rect
->
left
,
rect
->
top
,
NULL
);
IntersectClipRect
(
buffer
->
memorydc
,
rect
->
left
,
rect
->
top
,
rect
->
right
,
rect
->
bottom
);
DeleteObject
(
SelectObject
(
buffer
->
memorydc
,
buffer
->
bitmap
));
*
retdc
=
buffer
->
memorydc
;
...
...
@@ -160,7 +162,7 @@ HRESULT WINAPI EndBufferedPaint(HPAINTBUFFER bufferhandle, BOOL update)
{
if
(
!
BitBlt
(
buffer
->
targetdc
,
buffer
->
rect
.
left
,
buffer
->
rect
.
top
,
buffer
->
rect
.
right
-
buffer
->
rect
.
left
,
buffer
->
rect
.
bottom
-
buffer
->
rect
.
top
,
buffer
->
memorydc
,
0
,
0
,
SRCCOPY
))
buffer
->
memorydc
,
buffer
->
rect
.
left
,
buffer
->
rect
.
top
,
SRCCOPY
))
{
WARN
(
"BitBlt() failed
\n
"
);
}
...
...
dlls/uxtheme/tests/system.c
View file @
849c4716
...
...
@@ -523,14 +523,42 @@ static void test_CloseThemeData(void)
ok
(
hRes
==
E_HANDLE
,
"Expected E_HANDLE, got 0x%08x
\n
"
,
hRes
);
}
static
void
test_buffer_dc_props
(
HDC
hdc
,
const
RECT
*
rect
)
{
static
const
XFORM
ident
=
{
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
};
XFORM
xform
;
POINT
org
;
RECT
box
;
BOOL
ret
;
ret
=
GetWorldTransform
(
hdc
,
&
xform
);
ok
(
ret
,
"Failed to get world transform
\n
"
);
ok
(
!
memcmp
(
&
xform
,
&
ident
,
sizeof
(
xform
)),
"Unexpected world transform
\n
"
);
ret
=
GetViewportOrgEx
(
hdc
,
&
org
);
ok
(
ret
,
"Failed to get vport origin
\n
"
);
ok
(
org
.
x
==
0
&&
org
.
y
==
0
,
"Unexpected vport origin
\n
"
);
ret
=
GetWindowOrgEx
(
hdc
,
&
org
);
ok
(
ret
,
"Failed to get vport origin
\n
"
);
ok
(
org
.
x
==
rect
->
left
&&
org
.
y
==
rect
->
top
,
"Unexpected window origin
\n
"
);
ret
=
GetClipBox
(
hdc
,
&
box
);
ok
(
ret
,
"Failed to get clip box
\n
"
);
ok
(
box
.
left
==
rect
->
left
&&
box
.
top
==
rect
->
top
,
"Unexpected clip box
\n
"
);
ok
(
GetGraphicsMode
(
hdc
)
==
GM_COMPATIBLE
,
"wrong graphics mode
\n
"
);
}
static
void
test_buffered_paint
(
void
)
{
HDC
target
,
src
,
hdc
,
screen_dc
;
BP_PAINTPARAMS
params
=
{
0
};
BP_BUFFERFORMAT
format
;
HDC
target
,
src
,
hdc
;
HPAINTBUFFER
buffer
;
RECT
rect
,
rect2
;
RGBQUAD
*
bits
;
HBITMAP
hbm
;
HRESULT
hr
;
int
row
;
...
...
@@ -670,6 +698,31 @@ todo_wine
hr
=
pGetBufferedPaintBits
(
NULL
,
NULL
,
&
row
);
ok
(
hr
==
E_POINTER
,
"Unexpected return code %#x
\n
"
,
hr
);
screen_dc
=
GetDC
(
0
);
hdc
=
CreateCompatibleDC
(
screen_dc
);
ok
(
hdc
!=
NULL
,
"Failed to create a DC
\n
"
);
hbm
=
CreateCompatibleBitmap
(
screen_dc
,
64
,
64
);
ok
(
hbm
!=
NULL
,
"Failed to create a bitmap
\n
"
);
SelectObject
(
hdc
,
hbm
);
ReleaseDC
(
0
,
screen_dc
);
SetRect
(
&
rect
,
1
,
2
,
34
,
56
);
buffer
=
pBeginBufferedPaint
(
hdc
,
&
rect
,
BPBF_COMPATIBLEBITMAP
,
NULL
,
&
src
);
test_buffer_dc_props
(
src
,
&
rect
);
hr
=
pEndBufferedPaint
(
buffer
,
FALSE
);
ok
(
hr
==
S_OK
,
"Unexpected return code %#x
\n
"
,
hr
);
DeleteObject
(
hbm
);
DeleteDC
(
hdc
);
buffer
=
pBeginBufferedPaint
(
target
,
&
rect
,
BPBF_COMPATIBLEBITMAP
,
NULL
,
&
src
);
test_buffer_dc_props
(
src
,
&
rect
);
hr
=
pEndBufferedPaint
(
buffer
,
FALSE
);
ok
(
hr
==
S_OK
,
"Unexpected return code %#x
\n
"
,
hr
);
/* access buffer bits */
for
(
format
=
BPBF_COMPATIBLEBITMAP
;
format
<=
BPBF_TOPDOWNMONODIB
;
format
++
)
{
...
...
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