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
acbb0bdf
Commit
acbb0bdf
authored
Aug 20, 2015
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 20, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d2d1: Implement d2d_factory_CreateTransformedGeometry().
parent
69906b59
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
12 deletions
+49
-12
d2d1_private.h
dlls/d2d1/d2d1_private.h
+8
-0
factory.c
dlls/d2d1/factory.c
+12
-2
geometry.c
dlls/d2d1/geometry.c
+0
-0
render_target.c
dlls/d2d1/render_target.c
+29
-10
d2d1.c
dlls/d2d1/tests/d2d1.c
+0
-0
No files found.
dlls/d2d1/d2d1_private.h
View file @
acbb0bdf
...
...
@@ -249,6 +249,8 @@ struct d2d_geometry
ID2D1Factory
*
factory
;
D2D_MATRIX_3X2_F
transform
;
D2D1_POINT_2F
*
vertices
;
size_t
vertex_count
;
...
...
@@ -277,12 +279,18 @@ struct d2d_geometry
{
D2D1_RECT_F
rect
;
}
rectangle
;
struct
{
ID2D1Geometry
*
src_geometry
;
}
transformed
;
}
u
;
};
void
d2d_path_geometry_init
(
struct
d2d_geometry
*
geometry
,
ID2D1Factory
*
factory
)
DECLSPEC_HIDDEN
;
HRESULT
d2d_rectangle_geometry_init
(
struct
d2d_geometry
*
geometry
,
ID2D1Factory
*
factory
,
const
D2D1_RECT_F
*
rect
)
DECLSPEC_HIDDEN
;
void
d2d_transformed_geometry_init
(
struct
d2d_geometry
*
geometry
,
ID2D1Factory
*
factory
,
ID2D1Geometry
*
src_geometry
,
const
D2D_MATRIX_3X2_F
*
transform
)
DECLSPEC_HIDDEN
;
struct
d2d_geometry
*
unsafe_impl_from_ID2D1Geometry
(
ID2D1Geometry
*
iface
)
DECLSPEC_HIDDEN
;
static
inline
void
d2d_matrix_multiply
(
D2D_MATRIX_3X2_F
*
a
,
const
D2D_MATRIX_3X2_F
*
b
)
...
...
dlls/d2d1/factory.c
View file @
acbb0bdf
...
...
@@ -150,10 +150,20 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateTransformedGeometry(ID2D1Fact
ID2D1Geometry
*
src_geometry
,
const
D2D1_MATRIX_3X2_F
*
transform
,
ID2D1TransformedGeometry
**
transformed_geometry
)
{
FIXME
(
"iface %p, src_geometry %p, transform %p, transformed_geometry %p stub!
\n
"
,
struct
d2d_geometry
*
object
;
TRACE
(
"iface %p, src_geometry %p, transform %p, transformed_geometry %p.
\n
"
,
iface
,
src_geometry
,
transform
,
transformed_geometry
);
return
E_NOTIMPL
;
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
d2d_transformed_geometry_init
(
object
,
iface
,
src_geometry
,
transform
);
TRACE
(
"Created transformed geometry %p.
\n
"
,
object
);
*
transformed_geometry
=
(
ID2D1TransformedGeometry
*
)
&
object
->
ID2D1Geometry_iface
;
return
S_OK
;
}
static
HRESULT
STDMETHODCALLTYPE
d2d_factory_CreatePathGeometry
(
ID2D1Factory
*
iface
,
ID2D1PathGeometry
**
geometry
)
...
...
dlls/d2d1/geometry.c
View file @
acbb0bdf
This diff is collapsed.
Click to expand it.
dlls/d2d1/render_target.c
View file @
acbb0bdf
...
...
@@ -133,6 +133,7 @@ static void d2d_draw(struct d2d_d3d_render_target *render_target, enum d2d_shape
{
struct
d2d_shape_resources
*
shape_resources
=
&
render_target
->
shape_resources
[
shape_type
];
ID3D10Device
*
device
=
render_target
->
device
;
D3D10_RECT
scissor_rect
;
unsigned
int
offset
;
D3D10_VIEWPORT
vp
;
HRESULT
hr
;
...
...
@@ -164,16 +165,22 @@ static void d2d_draw(struct d2d_d3d_render_target *render_target, enum d2d_shape
if
(
render_target
->
clip_stack
.
count
)
{
const
D2D1_RECT_F
*
clip_rect
;
D3D10_RECT
scissor_rect
;
clip_rect
=
&
render_target
->
clip_stack
.
stack
[
render_target
->
clip_stack
.
count
-
1
];
scissor_rect
.
left
=
clip_rect
->
left
+
0
.
5
f
;
scissor_rect
.
top
=
clip_rect
->
top
+
0
.
5
f
;
scissor_rect
.
right
=
clip_rect
->
right
+
0
.
5
f
;
scissor_rect
.
bottom
=
clip_rect
->
bottom
+
0
.
5
f
;
ID3D10Device_RSSetScissorRects
(
device
,
1
,
&
scissor_rect
);
ID3D10Device_RSSetState
(
device
,
render_target
->
rs
);
}
else
{
scissor_rect
.
left
=
0
.
0
f
;
scissor_rect
.
top
=
0
.
0
f
;
scissor_rect
.
right
=
render_target
->
pixel_size
.
width
;
scissor_rect
.
bottom
=
render_target
->
pixel_size
.
height
;
}
ID3D10Device_RSSetScissorRects
(
device
,
1
,
&
scissor_rect
);
ID3D10Device_RSSetState
(
device
,
render_target
->
rs
);
ID3D10Device_OMSetRenderTargets
(
device
,
1
,
&
render_target
->
view
,
NULL
);
if
(
brush
)
d2d_brush_bind_resources
(
brush
,
render_target
,
shape_type
);
...
...
@@ -664,6 +671,7 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_FillGeometry(ID2D1RenderTarg
ID3D10Buffer
*
ib
,
*
vb
,
*
vs_cb
,
*
ps_cb
;
D3D10_SUBRESOURCE_DATA
buffer_data
;
D3D10_BUFFER_DESC
buffer_desc
;
D2D1_MATRIX_3X2_F
w
,
g
;
float
tmp_x
,
tmp_y
;
HRESULT
hr
;
struct
...
...
@@ -681,13 +689,24 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_FillGeometry(ID2D1RenderTarg
tmp_x
=
(
2
.
0
f
*
render_target
->
dpi_x
)
/
(
96
.
0
f
*
render_target
->
pixel_size
.
width
);
tmp_y
=
-
(
2
.
0
f
*
render_target
->
dpi_y
)
/
(
96
.
0
f
*
render_target
->
pixel_size
.
height
);
transform
.
_11
=
render_target
->
drawing_state
.
transform
.
_11
*
tmp_x
;
transform
.
_21
=
render_target
->
drawing_state
.
transform
.
_21
*
tmp_x
;
transform
.
_31
=
render_target
->
drawing_state
.
transform
.
_31
*
tmp_x
-
1
.
0
f
;
w
=
render_target
->
drawing_state
.
transform
;
w
.
_11
*=
tmp_x
;
w
.
_21
*=
tmp_x
;
w
.
_31
=
w
.
_31
*
tmp_x
-
1
.
0
f
;
w
.
_12
*=
tmp_y
;
w
.
_22
*=
tmp_y
;
w
.
_32
=
w
.
_32
*
tmp_y
+
1
.
0
f
;
g
=
geometry_impl
->
transform
;
d2d_matrix_multiply
(
&
g
,
&
w
);
transform
.
_11
=
g
.
_11
;
transform
.
_21
=
g
.
_21
;
transform
.
_31
=
g
.
_31
;
transform
.
pad0
=
0
.
0
f
;
transform
.
_12
=
render_target
->
drawing_state
.
transform
.
_12
*
tmp_y
;
transform
.
_22
=
render_target
->
drawing_state
.
transform
.
_22
*
tmp_y
;
transform
.
_32
=
render_target
->
drawing_state
.
transform
.
_32
*
tmp_y
+
1
.
0
f
;
transform
.
_12
=
g
.
_12
;
transform
.
_22
=
g
.
_22
;
transform
.
_32
=
g
.
_32
;
transform
.
pad1
=
0
.
0
f
;
buffer_desc
.
ByteWidth
=
sizeof
(
transform
);
...
...
@@ -1801,7 +1820,7 @@ HRESULT d2d_d3d_render_target_init(struct d2d_d3d_render_target *render_target,
}
rs_desc
.
FillMode
=
D3D10_FILL_SOLID
;
rs_desc
.
CullMode
=
D3D10_CULL_
BACK
;
rs_desc
.
CullMode
=
D3D10_CULL_
NONE
;
rs_desc
.
FrontCounterClockwise
=
FALSE
;
rs_desc
.
DepthBias
=
0
;
rs_desc
.
DepthBiasClamp
=
0
.
0
f
;
...
...
dlls/d2d1/tests/d2d1.c
View file @
acbb0bdf
This diff is collapsed.
Click to expand it.
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