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
828e62c8
Commit
828e62c8
authored
Jun 02, 2017
by
Henri Verbeet
Committed by
Alexandre Julliard
Jun 02, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d2d1: Implement d2d_transformed_geometry_GetBounds().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2485305b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
3 deletions
+49
-3
geometry.c
dlls/d2d1/geometry.c
+9
-2
d2d1.c
dlls/d2d1/tests/d2d1.c
+40
-1
No files found.
dlls/d2d1/geometry.c
View file @
828e62c8
...
...
@@ -3066,9 +3066,16 @@ static void STDMETHODCALLTYPE d2d_transformed_geometry_GetFactory(ID2D1Transform
static
HRESULT
STDMETHODCALLTYPE
d2d_transformed_geometry_GetBounds
(
ID2D1TransformedGeometry
*
iface
,
const
D2D1_MATRIX_3X2_F
*
transform
,
D2D1_RECT_F
*
bounds
)
{
FIXME
(
"iface %p, transform %p, bounds %p stub!
\n
"
,
iface
,
transform
,
bounds
);
struct
d2d_geometry
*
geometry
=
impl_from_ID2D1TransformedGeometry
(
iface
);
D2D1_MATRIX_3X2_F
g
;
return
E_NOTIMPL
;
TRACE
(
"iface %p, transform %p, bounds %p.
\n
"
,
iface
,
transform
,
bounds
);
g
=
geometry
->
transform
;
if
(
transform
)
d2d_matrix_multiply
(
&
g
,
transform
);
return
ID2D1Geometry_GetBounds
(
geometry
->
u
.
transformed
.
src_geometry
,
&
g
,
bounds
);
}
static
HRESULT
STDMETHODCALLTYPE
d2d_transformed_geometry_GetWidenedBounds
(
ID2D1TransformedGeometry
*
iface
,
...
...
dlls/d2d1/tests/d2d1.c
View file @
828e62c8
...
...
@@ -1838,6 +1838,7 @@ static void test_path_geometry(void)
static
void
test_rectangle_geometry
(
void
)
{
ID2D1TransformedGeometry
*
transformed_geometry
;
ID2D1RectangleGeometry
*
geometry
;
D2D1_MATRIX_3X2_F
matrix
;
D2D1_RECT_F
rect
,
rect2
;
...
...
@@ -1964,8 +1965,46 @@ static void test_rectangle_geometry(void)
ok
(
match
,
"Got unexpected bounds {%.8e, %.8e, %.8e, %.8e}.
\n
"
,
rect
.
left
,
rect
.
top
,
rect
.
right
,
rect
.
bottom
);
ID2D1RectangleGeometry_Release
(
geometry
);
set_matrix_identity
(
&
matrix
);
scale_matrix
(
&
matrix
,
4
.
0
f
,
5
.
0
f
);
rotate_matrix
(
&
matrix
,
M_PI
/
3
.
0
f
);
translate_matrix
(
&
matrix
,
30
.
0
f
,
20
.
0
f
);
hr
=
ID2D1Factory_CreateTransformedGeometry
(
factory
,
(
ID2D1Geometry
*
)
geometry
,
&
matrix
,
&
transformed_geometry
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create transformed geometry, hr %#x.
\n
"
,
hr
);
ID2D1TransformedGeometry_GetBounds
(
transformed_geometry
,
NULL
,
&
rect
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get bounds.
\n
"
);
match
=
compare_rect
(
&
rect
,
-
7.85640717e+01
f
,
1.79903809e+02
f
,
1.07179594e+01
f
,
2.73205078e+02
f
,
1
);
ok
(
match
,
"Got unexpected bounds {%.8e, %.8e, %.8e, %.8e}.
\n
"
,
rect
.
left
,
rect
.
top
,
rect
.
right
,
rect
.
bottom
);
set_matrix_identity
(
&
matrix
);
rotate_matrix
(
&
matrix
,
M_PI
/
-
3
.
0
f
);
scale_matrix
(
&
matrix
,
0
.
25
f
,
0
.
2
f
);
ID2D1TransformedGeometry_GetBounds
(
transformed_geometry
,
&
matrix
,
&
rect
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get bounds.
\n
"
);
match
=
compare_rect
(
&
rect
,
30
.
0
f
,
20
.
0
f
,
40
.
0
f
,
40
.
0
f
,
2
);
ok
(
match
,
"Got unexpected bounds {%.8e, %.8e, %.8e, %.8e}.
\n
"
,
rect
.
left
,
rect
.
top
,
rect
.
right
,
rect
.
bottom
);
set_matrix_identity
(
&
matrix
);
scale_matrix
(
&
matrix
,
2
.
0
f
,
0
.
0
f
);
ID2D1TransformedGeometry_GetBounds
(
transformed_geometry
,
&
matrix
,
&
rect
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get bounds.
\n
"
);
match
=
compare_rect
(
&
rect
,
-
1.57128143e+02
f
,
0.00000000e+00
f
,
2.14359188e+01
f
,
0.00000000e+00
f
,
1
);
ok
(
match
,
"Got unexpected bounds {%.8e, %.8e, %.8e, %.8e}.
\n
"
,
rect
.
left
,
rect
.
top
,
rect
.
right
,
rect
.
bottom
);
set_matrix_identity
(
&
matrix
);
scale_matrix
(
&
matrix
,
0
.
0
f
,
0
.
5
f
);
ID2D1TransformedGeometry_GetBounds
(
transformed_geometry
,
&
matrix
,
&
rect
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get bounds.
\n
"
);
match
=
compare_rect
(
&
rect
,
0.00000000e+00
f
,
8.99519043e+01
f
,
0.00000000e+00
,
1.36602539e+02
f
,
1
);
ok
(
match
,
"Got unexpected bounds {%.8e, %.8e, %.8e, %.8e}.
\n
"
,
rect
.
left
,
rect
.
top
,
rect
.
right
,
rect
.
bottom
);
ID2D1TransformedGeometry_Release
(
transformed_geometry
);
ID2D1RectangleGeometry_Release
(
geometry
);
ID2D1Factory_Release
(
factory
);
}
...
...
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