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
d7fb7818
Commit
d7fb7818
authored
Feb 23, 2017
by
Henri Verbeet
Committed by
Alexandre Julliard
Feb 23, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d2d1/tests: Add tests for drawing simple shapes.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4aea3618
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
106 additions
and
1 deletion
+106
-1
d2d1.c
dlls/d2d1/tests/d2d1.c
+106
-1
No files found.
dlls/d2d1/tests/d2d1.c
View file @
d7fb7818
...
...
@@ -71,6 +71,13 @@ static void set_rect_u(D2D1_RECT_U *rect, UINT32 left, UINT32 top, UINT32 right,
rect
->
bottom
=
bottom
;
}
static
void
set_ellipse
(
D2D1_ELLIPSE
*
ellipse
,
float
x
,
float
y
,
float
rx
,
float
ry
)
{
set_point
(
&
ellipse
->
point
,
x
,
y
);
ellipse
->
radiusX
=
rx
;
ellipse
->
radiusY
=
ry
;
}
static
void
set_color
(
D2D1_COLOR_F
*
color
,
float
r
,
float
g
,
float
b
,
float
a
)
{
color
->
r
=
r
;
...
...
@@ -486,6 +493,7 @@ static BOOL compare_figure(IDXGISurface *surface, unsigned int x, unsigned int y
}
if
(
diff
>
max_diff
)
{
trace
(
"diff %u > max_diff %u.
\n
"
,
diff
,
max_diff
);
read_figure
(
&
figure
,
mapped_texture
.
pData
,
mapped_texture
.
RowPitch
,
x
,
y
,
w
,
h
,
prev
);
serialize_figure
(
&
figure
);
}
...
...
@@ -3675,6 +3683,8 @@ static void test_draw_geometry(void)
ID3D10Device1
*
device
;
IDXGISurface
*
surface
;
ID2D1Factory
*
factory
;
D2D1_POINT_2F
p0
,
p1
;
D2D1_ELLIPSE
ellipse
;
D2D1_COLOR_F
color
;
D2D1_RECT_F
rect
;
ULONG
refcount
;
...
...
@@ -3701,6 +3711,102 @@ static void test_draw_geometry(void)
hr
=
ID2D1RenderTarget_CreateSolidColorBrush
(
rt
,
&
color
,
NULL
,
&
brush
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create brush, hr %#x.
\n
"
,
hr
);
ID2D1RenderTarget_BeginDraw
(
rt
);
set_color
(
&
color
,
0
.
396
f
,
0
.
180
f
,
0
.
537
f
,
1
.
0
f
);
ID2D1RenderTarget_Clear
(
rt
,
&
color
);
set_point
(
&
p0
,
40
.
0
f
,
160
.
0
f
);
ID2D1RenderTarget_DrawLine
(
rt
,
p0
,
p0
,
(
ID2D1Brush
*
)
brush
,
10
.
0
f
,
NULL
);
set_point
(
&
p0
,
100
.
0
f
,
160
.
0
f
);
set_point
(
&
p1
,
140
.
0
f
,
160
.
0
f
);
ID2D1RenderTarget_DrawLine
(
rt
,
p0
,
p1
,
(
ID2D1Brush
*
)
brush
,
10
.
0
f
,
NULL
);
set_point
(
&
p0
,
200
.
0
f
,
80
.
0
f
);
set_point
(
&
p1
,
200
.
0
f
,
240
.
0
f
);
ID2D1RenderTarget_DrawLine
(
rt
,
p0
,
p1
,
(
ID2D1Brush
*
)
brush
,
10
.
0
f
,
NULL
);
set_point
(
&
p0
,
260
.
0
f
,
240
.
0
f
);
set_point
(
&
p1
,
300
.
0
f
,
80
.
0
f
);
ID2D1RenderTarget_DrawLine
(
rt
,
p0
,
p1
,
(
ID2D1Brush
*
)
brush
,
10
.
0
f
,
NULL
);
set_rect
(
&
rect
,
40
.
0
f
,
480
.
0
f
,
40
.
0
f
,
480
.
0
f
);
ID2D1RenderTarget_DrawRectangle
(
rt
,
&
rect
,
(
ID2D1Brush
*
)
brush
,
10
.
0
f
,
NULL
);
set_rect
(
&
rect
,
100
.
0
f
,
480
.
0
f
,
140
.
0
f
,
480
.
0
f
);
ID2D1RenderTarget_DrawRectangle
(
rt
,
&
rect
,
(
ID2D1Brush
*
)
brush
,
10
.
0
f
,
NULL
);
set_rect
(
&
rect
,
200
.
0
f
,
400
.
0
f
,
200
.
0
f
,
560
.
0
f
);
ID2D1RenderTarget_DrawRectangle
(
rt
,
&
rect
,
(
ID2D1Brush
*
)
brush
,
10
.
0
f
,
NULL
);
set_rect
(
&
rect
,
260
.
0
f
,
560
.
0
f
,
300
.
0
f
,
400
.
0
f
);
ID2D1RenderTarget_DrawRectangle
(
rt
,
&
rect
,
(
ID2D1Brush
*
)
brush
,
10
.
0
f
,
NULL
);
set_ellipse
(
&
ellipse
,
40
.
0
f
,
800
.
0
f
,
0
.
0
f
,
0
.
0
f
);
ID2D1RenderTarget_DrawEllipse
(
rt
,
&
ellipse
,
(
ID2D1Brush
*
)
brush
,
10
.
0
f
,
NULL
);
set_ellipse
(
&
ellipse
,
120
.
0
f
,
800
.
0
f
,
20
.
0
f
,
0
.
0
f
);
ID2D1RenderTarget_DrawEllipse
(
rt
,
&
ellipse
,
(
ID2D1Brush
*
)
brush
,
10
.
0
f
,
NULL
);
set_ellipse
(
&
ellipse
,
200
.
0
f
,
800
.
0
f
,
0
.
0
f
,
80
.
0
f
);
ID2D1RenderTarget_DrawEllipse
(
rt
,
&
ellipse
,
(
ID2D1Brush
*
)
brush
,
10
.
0
f
,
NULL
);
set_ellipse
(
&
ellipse
,
280
.
0
f
,
800
.
0
f
,
20
.
0
f
,
80
.
0
f
);
ID2D1RenderTarget_DrawEllipse
(
rt
,
&
ellipse
,
(
ID2D1Brush
*
)
brush
,
10
.
0
f
,
NULL
);
hr
=
ID2D1RenderTarget_EndDraw
(
rt
,
NULL
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to end draw, hr %#x.
\n
"
,
hr
);
match
=
compare_figure
(
surface
,
0
,
0
,
160
,
160
,
0xff652e89
,
0
,
""
);
todo_wine
ok
(
match
,
"Figure does not match.
\n
"
);
match
=
compare_figure
(
surface
,
160
,
0
,
160
,
160
,
0xff652e89
,
0
,
"yGBQUFBQUFBQUFDoYQAA"
);
todo_wine
ok
(
match
,
"Figure does not match.
\n
"
);
match
=
compare_figure
(
surface
,
320
,
0
,
160
,
160
,
0xff652e89
,
0
,
"xjIUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUxjIA"
);
todo_wine
ok
(
match
,
"Figure does not match.
\n
"
);
match
=
compare_figure
(
surface
,
480
,
0
,
160
,
160
,
0xff652e89
,
2
,
"zjECnQETjAEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEV"
"igEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEV"
"igEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEV"
"igEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEV"
"igEVigEVigEVigEVjAETnQECzjEA"
);
todo_wine
ok
(
match
,
"Figure does not match.
\n
"
);
match
=
compare_figure
(
surface
,
0
,
160
,
160
,
160
,
0xff652e89
,
0
,
"5mAUjAEUjAEUjAEUjAEUhmIA"
);
todo_wine
ok
(
match
,
"Figure does not match.
\n
"
);
match
=
compare_figure
(
surface
,
160
,
160
,
160
,
160
,
0xff652e89
,
0
,
"vmBkPGQ8ZDxkPGTeYQAA"
);
todo_wine
ok
(
match
,
"Figure does not match.
\n
"
);
match
=
compare_figure
(
surface
,
320
,
160
,
160
,
160
,
0xff652e89
,
0
,
"5i4UjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUhjAA"
);
todo_wine
ok
(
match
,
"Figure does not match.
\n
"
);
match
=
compare_figure
(
surface
,
480
,
160
,
160
,
160
,
0xff652e89
,
0
,
"vi5kPGQ8ZDxkPGQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8"
"FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8"
"FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8ZDxkPGQ8ZDxk3i8A"
);
ok
(
match
,
"Figure does not match.
\n
"
);
match
=
compare_figure
(
surface
,
0
,
320
,
160
,
160
,
0xff652e89
,
0
,
"iGIQjgEUjAEUjgEQiGIA"
);
todo_wine
ok
(
match
,
"Figure does not match.
\n
"
);
match
=
compare_figure
(
surface
,
160
,
320
,
160
,
160
,
0xff652e89
,
0
,
"yGBQSGA+ZDxkPmDgYQAA"
);
todo_wine
ok
(
match
,
"Figure does not match.
\n
"
);
match
=
compare_figure
(
surface
,
320
,
320
,
160
,
160
,
0xff652e89
,
0
,
"iDAQjgEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjgEQiDAA"
);
todo_wine
ok
(
match
,
"Figure does not match.
\n
"
);
match
=
compare_figure
(
surface
,
480
,
320
,
160
,
160
,
0xff652e89
,
10
,
"hDAYgwEieyh1LnAybBcIF2gWDhZkFhIWYRUWFV4VGhVbFRwVWRUeFVcVIBVVFCQUUxQmFFEUKBRP"
"FSgVTRUqFUwULBRLFC4USRQwFEgUMBRHFDIURhQyFEUUNBREFDQUQxQ2FEIUNhRBFDgUQBQ4FEAU"
"OBQ/FDoUPhQ6FD4UOhQ+FDoUPhQ6FD0UPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8"
"FDwUPBQ8FDwUPBQ8FD0UOhQ+FDoUPhQ6FD4UOhQ+FDoUPxQ4FEAUOBRAFDgUQRQ2FEIUNhRDFDQU"
"RBQ0FEUUMhRGFDIURxQwFEgUMBRJFC4USxQsFEwVKhVNFSgVTxQoFFEUJhRTFCQUVRUgFVcVHhVZ"
"FRwVWxUaFV4VFhVhFhIWZBYOFmgXCBdsMnAudSh7IoMBGIQw"
);
todo_wine
ok
(
match
,
"Figure does not match.
\n
"
);
hr
=
ID2D1Factory_CreatePathGeometry
(
factory
,
&
geometry
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create path geometry, hr %#x.
\n
"
,
hr
);
hr
=
ID2D1PathGeometry_Open
(
geometry
,
&
sink
);
...
...
@@ -3778,7 +3884,6 @@ static void test_draw_geometry(void)
ID2D1GeometrySink_Release
(
sink
);
ID2D1RenderTarget_BeginDraw
(
rt
);
set_color
(
&
color
,
0
.
396
f
,
0
.
180
f
,
0
.
537
f
,
1
.
0
f
);
ID2D1RenderTarget_Clear
(
rt
,
&
color
);
ID2D1RenderTarget_DrawGeometry
(
rt
,
(
ID2D1Geometry
*
)
geometry
,
(
ID2D1Brush
*
)
brush
,
5
.
0
f
,
NULL
);
hr
=
ID2D1RenderTarget_EndDraw
(
rt
,
NULL
,
NULL
);
...
...
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