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
fdd6a07a
Commit
fdd6a07a
authored
Jul 31, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 03, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d2d1: Allow setting command list as a target.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
753ae1d0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
2 deletions
+38
-2
command_list.c
dlls/d2d1/command_list.c
+8
-0
d2d1_private.h
dlls/d2d1/d2d1_private.h
+18
-1
device.c
dlls/d2d1/device.c
+0
-0
d2d1.c
dlls/d2d1/tests/d2d1.c
+12
-1
No files found.
dlls/d2d1/command_list.c
View file @
fdd6a07a
...
...
@@ -117,3 +117,11 @@ HRESULT d2d_command_list_create(ID2D1Factory *factory, struct d2d_command_list *
return
S_OK
;
}
struct
d2d_command_list
*
unsafe_impl_from_ID2D1CommandList
(
ID2D1CommandList
*
iface
)
{
if
(
!
iface
)
return
NULL
;
assert
(
iface
->
lpVtbl
==
(
ID2D1CommandListVtbl
*
)
&
d2d_command_list_vtbl
);
return
CONTAINING_RECORD
(
iface
,
struct
d2d_command_list
,
ID2D1CommandList_iface
);
}
dlls/d2d1/d2d1_private.h
View file @
fdd6a07a
...
...
@@ -152,6 +152,13 @@ enum d2d_device_context_sampler_limits
D2D_SAMPLER_EXTEND_MODE_COUNT
=
3
,
};
enum
d2d_device_context_target_type
{
D2D_TARGET_UNKNOWN
=
0
,
D2D_TARGET_BITMAP
,
D2D_TARGET_COMMAND_LIST
,
};
struct
d2d_device_context
{
ID2D1DeviceContext1
ID2D1DeviceContext1_iface
;
...
...
@@ -167,7 +174,16 @@ struct d2d_device_context
ID2D1Device
*
device
;
ID3D11Device1
*
d3d_device
;
ID3DDeviceContextState
*
d3d_state
;
struct
d2d_bitmap
*
target
;
struct
{
ID2D1Image
*
object
;
enum
d2d_device_context_target_type
type
;
union
{
struct
d2d_bitmap
*
bitmap
;
struct
d2d_command_list
*
command_list
;
};
}
target
;
struct
d2d_shape_resources
shape_resources
[
D2D_SHAPE_TYPE_COUNT
];
ID3D11Buffer
*
vs_cb
;
ID3D11PixelShader
*
ps
;
...
...
@@ -698,6 +714,7 @@ struct d2d_command_list
};
HRESULT
d2d_command_list_create
(
ID2D1Factory
*
factory
,
struct
d2d_command_list
**
command_list
)
DECLSPEC_HIDDEN
;
struct
d2d_command_list
*
unsafe_impl_from_ID2D1CommandList
(
ID2D1CommandList
*
iface
)
DECLSPEC_HIDDEN
;
static
inline
BOOL
d2d_array_reserve
(
void
**
elements
,
size_t
*
capacity
,
size_t
count
,
size_t
size
)
{
...
...
dlls/d2d1/device.c
View file @
fdd6a07a
This diff is collapsed.
Click to expand it.
dlls/d2d1/tests/d2d1.c
View file @
fdd6a07a
...
...
@@ -9444,6 +9444,7 @@ static void test_command_list(BOOL d3d11)
ID2D1StrokeStyle
*
stroke_style
;
ID2D1CommandList
*
command_list
;
struct
d2d1_test_context
ctx
;
D2D1_PIXEL_FORMAT
format
;
ID2D1Geometry
*
geometry
;
ID2D1RenderTarget
*
rt
;
D2D1_POINT_2F
p0
,
p1
;
...
...
@@ -9472,6 +9473,15 @@ static void test_command_list(BOOL d3d11)
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ID2D1DeviceContext_SetTarget
(
device_context
,
(
ID2D1Image
*
)
command_list
);
size
=
ID2D1DeviceContext_GetPixelSize
(
device_context
);
ok
(
!
size
.
width
,
"Got unexpected width %u.
\n
"
,
size
.
width
);
ok
(
!
size
.
height
,
"Got unexpected height %u.
\n
"
,
size
.
height
);
format
=
ID2D1DeviceContext_GetPixelFormat
(
device_context
);
ok
(
format
.
format
==
DXGI_FORMAT_UNKNOWN
&&
format
.
alphaMode
==
D2D1_ALPHA_MODE_UNKNOWN
,
"Unexpected format %u, alpha mode %u.
\n
"
,
format
.
format
,
format
.
alphaMode
);
ID2D1DeviceContext_BeginDraw
(
device_context
);
hr
=
ID2D1DeviceContext_QueryInterface
(
device_context
,
&
IID_ID2D1RenderTarget
,
(
void
**
)
&
rt
);
...
...
@@ -9627,7 +9637,6 @@ static void test_command_list(BOOL d3d11)
/* Close on attached list. */
ID2D1DeviceContext_GetTarget
(
device_context
,
&
target
);
todo_wine
ok
(
target
==
(
ID2D1Image
*
)
command_list
,
"Unexpected context target.
\n
"
);
ID2D1Image_Release
(
target
);
...
...
@@ -9665,7 +9674,9 @@ static void test_command_list(BOOL d3d11)
ID2D1DeviceContext_SetTarget
(
device_context2
,
(
ID2D1Image
*
)
command_list
);
ID2D1DeviceContext_GetTarget
(
device_context2
,
&
target
);
todo_wine
ok
(
target
==
NULL
,
"Unexpected target.
\n
"
);
if
(
target
)
ID2D1Image_Release
(
target
);
ID2D1CommandList_Release
(
command_list
);
ID2D1DeviceContext_Release
(
device_context2
);
...
...
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