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
bc47dc3f
Commit
bc47dc3f
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_layer_GetSize().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6d638b9e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
6 deletions
+22
-6
d2d1_private.h
dlls/d2d1/d2d1_private.h
+2
-1
layer.c
dlls/d2d1/layer.c
+7
-4
render_target.c
dlls/d2d1/render_target.c
+1
-1
d2d1.c
dlls/d2d1/tests/d2d1.c
+12
-0
No files found.
dlls/d2d1/d2d1_private.h
View file @
bc47dc3f
...
...
@@ -242,9 +242,10 @@ struct d2d_layer
LONG
refcount
;
ID2D1Factory
*
factory
;
D2D1_SIZE_F
size
;
};
HRESULT
d2d_layer_create
(
ID2D1Factory
*
factory
,
struct
d2d_layer
**
layer
)
DECLSPEC_HIDDEN
;
HRESULT
d2d_layer_create
(
ID2D1Factory
*
factory
,
const
D2D1_SIZE_F
*
size
,
struct
d2d_layer
**
layer
)
DECLSPEC_HIDDEN
;
struct
d2d_mesh
{
...
...
dlls/d2d1/layer.c
View file @
bc47dc3f
...
...
@@ -84,10 +84,11 @@ static void STDMETHODCALLTYPE d2d_layer_GetFactory(ID2D1Layer *iface, ID2D1Facto
static
D2D1_SIZE_F
*
STDMETHODCALLTYPE
d2d_layer_GetSize
(
ID2D1Layer
*
iface
,
D2D1_SIZE_F
*
size
)
{
FIXME
(
"iface %p, size %p stub!
\n
"
,
iface
,
size
);
struct
d2d_layer
*
layer
=
impl_from_ID2D1Layer
(
iface
);
TRACE
(
"iface %p, size %p.
\n
"
,
iface
,
size
);
size
->
width
=
0
;
size
->
height
=
0
;
*
size
=
layer
->
size
;
return
size
;
}
...
...
@@ -100,7 +101,7 @@ static const struct ID2D1LayerVtbl d2d_layer_vtbl =
d2d_layer_GetSize
,
};
HRESULT
d2d_layer_create
(
ID2D1Factory
*
factory
,
struct
d2d_layer
**
layer
)
HRESULT
d2d_layer_create
(
ID2D1Factory
*
factory
,
const
D2D1_SIZE_F
*
size
,
struct
d2d_layer
**
layer
)
{
if
(
!
(
*
layer
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
**
layer
))))
return
E_OUTOFMEMORY
;
...
...
@@ -108,6 +109,8 @@ HRESULT d2d_layer_create(ID2D1Factory *factory, struct d2d_layer **layer)
(
*
layer
)
->
ID2D1Layer_iface
.
lpVtbl
=
&
d2d_layer_vtbl
;
(
*
layer
)
->
refcount
=
1
;
ID2D1Factory_AddRef
((
*
layer
)
->
factory
=
factory
);
if
(
size
)
(
*
layer
)
->
size
=
*
size
;
TRACE
(
"Created layer %p.
\n
"
,
*
layer
);
...
...
dlls/d2d1/render_target.c
View file @
bc47dc3f
...
...
@@ -464,7 +464,7 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateLayer(ID2D1RenderTa
TRACE
(
"iface %p, size %p, layer %p.
\n
"
,
iface
,
size
,
layer
);
if
(
SUCCEEDED
(
hr
=
d2d_layer_create
(
render_target
->
factory
,
&
object
)))
if
(
SUCCEEDED
(
hr
=
d2d_layer_create
(
render_target
->
factory
,
size
,
&
object
)))
*
layer
=
&
object
->
ID2D1Layer_iface
;
return
hr
;
...
...
dlls/d2d1/tests/d2d1.c
View file @
bc47dc3f
...
...
@@ -4536,6 +4536,7 @@ static void test_layer(void)
ID3D10Device1
*
device
;
IDXGISurface
*
surface
;
ID2D1Layer
*
layer
;
D2D1_SIZE_F
size
;
ULONG
refcount
;
HWND
window
;
HRESULT
hr
;
...
...
@@ -4561,6 +4562,17 @@ static void test_layer(void)
ID2D1Layer_GetFactory
(
layer
,
&
layer_factory
);
ok
(
layer_factory
==
factory
,
"Got unexpected layer factory %p, expected %p.
\n
"
,
layer_factory
,
factory
);
ID2D1Factory_Release
(
layer_factory
);
size
=
ID2D1Layer_GetSize
(
layer
);
ok
(
size
.
width
==
0
.
0
f
,
"Got unexpected width %.8e.
\n
"
,
size
.
width
);
ok
(
size
.
height
==
0
.
0
f
,
"Got unexpected height %.8e.
\n
"
,
size
.
height
);
ID2D1Layer_Release
(
layer
);
set_size_f
(
&
size
,
800
.
0
f
,
600
.
0
f
);
hr
=
ID2D1RenderTarget_CreateLayer
(
rt
,
&
size
,
&
layer
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create layer, hr %#x.
\n
"
,
hr
);
size
=
ID2D1Layer_GetSize
(
layer
);
ok
(
size
.
width
==
800
.
0
f
,
"Got unexpected width %.8e.
\n
"
,
size
.
width
);
ok
(
size
.
height
==
600
.
0
f
,
"Got unexpected height %.8e.
\n
"
,
size
.
height
);
ID2D1Layer_Release
(
layer
);
ID2D1RenderTarget_Release
(
rt
);
...
...
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