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
d3cc27f1
Commit
d3cc27f1
authored
Apr 28, 2015
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 29, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d2d1/tests: Add some extend mode tests to test_bitmap_brush().
parent
c92d7aff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
0 deletions
+49
-0
d2d1.c
dlls/d2d1/tests/d2d1.c
+49
-0
No files found.
dlls/d2d1/tests/d2d1.c
View file @
d3cc27f1
...
...
@@ -706,11 +706,32 @@ static void test_bitmap_brush(void)
IDXGISurface
*
surface
;
D2D1_COLOR_F
color
;
D2D1_SIZE_U
size
;
unsigned
int
i
;
ULONG
refcount
;
float
opacity
;
HWND
window
;
HRESULT
hr
;
static
const
struct
{
D2D1_EXTEND_MODE
extend_mode_x
;
D2D1_EXTEND_MODE
extend_mode_y
;
float
translate_x
;
float
translate_y
;
D2D1_RECT_F
rect
;
}
extend_mode_tests
[]
=
{
{
D2D1_EXTEND_MODE_MIRROR
,
D2D1_EXTEND_MODE_MIRROR
,
-
7
.
0
f
,
1
.
0
f
,
{
-
4
.
0
f
,
0
.
0
f
,
-
8
.
0
f
,
4
.
0
f
}},
{
D2D1_EXTEND_MODE_WRAP
,
D2D1_EXTEND_MODE_MIRROR
,
-
3
.
0
f
,
1
.
0
f
,
{
-
4
.
0
f
,
4
.
0
f
,
0
.
0
f
,
0
.
0
f
}},
{
D2D1_EXTEND_MODE_CLAMP
,
D2D1_EXTEND_MODE_MIRROR
,
1
.
0
f
,
1
.
0
f
,
{
4
.
0
f
,
0
.
0
f
,
0
.
0
f
,
4
.
0
f
}},
{
D2D1_EXTEND_MODE_MIRROR
,
D2D1_EXTEND_MODE_WRAP
,
-
7
.
0
f
,
5
.
0
f
,
{
-
8
.
0
f
,
8
.
0
f
,
-
4
.
0
f
,
4
.
0
f
}},
{
D2D1_EXTEND_MODE_WRAP
,
D2D1_EXTEND_MODE_WRAP
,
-
3
.
0
f
,
5
.
0
f
,
{
0
.
0
f
,
4
.
0
f
,
-
4
.
0
f
,
8
.
0
f
}},
{
D2D1_EXTEND_MODE_CLAMP
,
D2D1_EXTEND_MODE_WRAP
,
1
.
0
f
,
5
.
0
f
,
{
0
.
0
f
,
8
.
0
f
,
4
.
0
f
,
4
.
0
f
}},
{
D2D1_EXTEND_MODE_MIRROR
,
D2D1_EXTEND_MODE_CLAMP
,
-
7
.
0
f
,
9
.
0
f
,
{
-
4
.
0
f
,
8
.
0
f
,
-
8
.
0
f
,
12
.
0
f
}},
{
D2D1_EXTEND_MODE_WRAP
,
D2D1_EXTEND_MODE_CLAMP
,
-
3
.
0
f
,
9
.
0
f
,
{
-
4
.
0
f
,
12
.
0
f
,
0
.
0
f
,
8
.
0
f
}},
{
D2D1_EXTEND_MODE_CLAMP
,
D2D1_EXTEND_MODE_CLAMP
,
1
.
0
f
,
9
.
0
f
,
{
4
.
0
f
,
8
.
0
f
,
0
.
0
f
,
12
.
0
f
}},
};
static
const
DWORD
bitmap_data
[]
=
{
0xffff0000
,
0xffffff00
,
0xff00ff00
,
0xff00ffff
,
...
...
@@ -814,6 +835,34 @@ static void test_bitmap_brush(void)
ok
(
SUCCEEDED
(
hr
),
"Failed to end draw, hr %#x.
\n
"
,
hr
);
ok
(
compare_surface
(
surface
,
"393636185359a550d459e1e5f0e25411814f724c"
),
"Surface does not match.
\n
"
);
ID2D1RenderTarget_BeginDraw
(
rt
);
ID2D1RenderTarget_Clear
(
rt
,
&
color
);
ID2D1BitmapBrush_SetOpacity
(
brush
,
1
.
0
f
);
for
(
i
=
0
;
i
<
sizeof
(
extend_mode_tests
)
/
sizeof
(
*
extend_mode_tests
);
++
i
)
{
ID2D1BitmapBrush_SetExtendModeX
(
brush
,
extend_mode_tests
[
i
].
extend_mode_x
);
extend_mode
=
ID2D1BitmapBrush_GetExtendModeX
(
brush
);
ok
(
extend_mode
==
extend_mode_tests
[
i
].
extend_mode_x
,
"Test %u: Got unexpected extend mode %#x, expected %#x.
\n
"
,
i
,
extend_mode
,
extend_mode_tests
[
i
].
extend_mode_x
);
ID2D1BitmapBrush_SetExtendModeY
(
brush
,
extend_mode_tests
[
i
].
extend_mode_y
);
extend_mode
=
ID2D1BitmapBrush_GetExtendModeY
(
brush
);
ok
(
extend_mode
==
extend_mode_tests
[
i
].
extend_mode_y
,
"Test %u: Got unexpected extend mode %#x, expected %#x.
\n
"
,
i
,
extend_mode
,
extend_mode_tests
[
i
].
extend_mode_y
);
set_matrix_identity
(
&
matrix
);
translate_matrix
(
&
matrix
,
extend_mode_tests
[
i
].
translate_x
,
extend_mode_tests
[
i
].
translate_y
);
scale_matrix
(
&
matrix
,
0
.
5
f
,
0
.
5
f
);
ID2D1BitmapBrush_SetTransform
(
brush
,
&
matrix
);
ID2D1RenderTarget_FillRectangle
(
rt
,
&
extend_mode_tests
[
i
].
rect
,
(
ID2D1Brush
*
)
brush
);
}
hr
=
ID2D1RenderTarget_EndDraw
(
rt
,
NULL
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to end draw, hr %#x.
\n
"
,
hr
);
ok
(
compare_surface
(
surface
,
"b4b775afecdae2d26642001f4faff73663bb8b31"
),
"Surface does not match.
\n
"
);
ID2D1BitmapBrush_Release
(
brush
);
refcount
=
ID2D1Bitmap_Release
(
bitmap
);
ok
(
!
refcount
,
"Bitmap has %u references left.
\n
"
,
refcount
);
...
...
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