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
a52ba8d9
Commit
a52ba8d9
authored
Aug 06, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 09, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d2d1/commandlist: Implement DrawImage() command.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
6ed5d851
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
1 deletion
+49
-1
command_list.c
dlls/d2d1/command_list.c
+44
-0
d2d1_private.h
dlls/d2d1/d2d1_private.h
+3
-0
device.c
dlls/d2d1/device.c
+2
-1
No files found.
dlls/d2d1/command_list.c
View file @
a52ba8d9
...
...
@@ -40,6 +40,7 @@ enum d2d_command_type
D2D_COMMAND_DRAW_GEOMETRY
,
D2D_COMMAND_DRAW_RECTANGLE
,
D2D_COMMAND_DRAW_BITMAP
,
D2D_COMMAND_DRAW_IMAGE
,
D2D_COMMAND_FILL_MESH
,
D2D_COMMAND_FILL_OPACITY_MASK
,
D2D_COMMAND_FILL_GEOMETRY
,
...
...
@@ -188,6 +189,16 @@ struct d2d_command_draw_bitmap
D2D1_MATRIX_4X4_F
*
perspective_transform
;
};
struct
d2d_command_draw_image
{
struct
d2d_command
c
;
ID2D1Image
*
image
;
D2D1_INTERPOLATION_MODE
interpolation_mode
;
D2D1_COMPOSITE_MODE
composite_mode
;
D2D1_POINT_2F
*
target_offset
;
D2D1_RECT_F
*
image_rect
;
};
static
inline
struct
d2d_command_list
*
impl_from_ID2D1CommandList
(
ID2D1CommandList
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
d2d_command_list
,
ID2D1CommandList_iface
);
...
...
@@ -387,6 +398,13 @@ static HRESULT STDMETHODCALLTYPE d2d_command_list_Stream(ID2D1CommandList *iface
c
->
interpolation_mode
,
c
->
src_rect
,
c
->
perspective_transform
);
break
;
}
case
D2D_COMMAND_DRAW_IMAGE
:
{
const
struct
d2d_command_draw_image
*
c
=
data
;
hr
=
ID2D1CommandSink_DrawImage
(
sink
,
c
->
image
,
c
->
target_offset
,
c
->
image_rect
,
c
->
interpolation_mode
,
c
->
composite_mode
);
break
;
}
case
D2D_COMMAND_FILL_MESH
:
{
const
struct
d2d_command_fill_mesh
*
c
=
data
;
...
...
@@ -957,6 +975,32 @@ void d2d_command_list_draw_bitmap(struct d2d_command_list *command_list, ID2D1Bi
d2d_command_list_write_field
(
&
data
,
&
command
->
perspective_transform
,
perspective_transform
,
sizeof
(
*
perspective_transform
));
}
void
d2d_command_list_draw_image
(
struct
d2d_command_list
*
command_list
,
ID2D1Image
*
image
,
const
D2D1_POINT_2F
*
target_offset
,
const
D2D1_RECT_F
*
image_rect
,
D2D1_INTERPOLATION_MODE
interpolation_mode
,
D2D1_COMPOSITE_MODE
composite_mode
)
{
struct
d2d_command_draw_image
*
command
;
size_t
size
;
BYTE
*
data
;
size
=
sizeof
(
*
command
);
if
(
target_offset
)
size
+=
sizeof
(
*
target_offset
);
if
(
image_rect
)
size
+=
sizeof
(
*
image_rect
);
d2d_command_list_reference_object
(
command_list
,
image
);
command
=
d2d_command_list_require_space
(
command_list
,
size
);
command
->
c
.
op
=
D2D_COMMAND_DRAW_IMAGE
;
command
->
image
=
image
;
command
->
interpolation_mode
=
interpolation_mode
;
command
->
composite_mode
=
composite_mode
;
data
=
(
BYTE
*
)(
command
+
1
);
d2d_command_list_write_field
(
&
data
,
&
command
->
target_offset
,
target_offset
,
sizeof
(
*
target_offset
));
d2d_command_list_write_field
(
&
data
,
&
command
->
image_rect
,
image_rect
,
sizeof
(
*
image_rect
));
}
void
d2d_command_list_fill_mesh
(
struct
d2d_command_list
*
command_list
,
const
struct
d2d_device_context
*
context
,
ID2D1Mesh
*
mesh
,
ID2D1Brush
*
orig_brush
)
{
...
...
dlls/d2d1/d2d1_private.h
View file @
a52ba8d9
...
...
@@ -769,6 +769,9 @@ void d2d_command_list_draw_glyph_run(struct d2d_command_list *command_list,
void
d2d_command_list_draw_bitmap
(
struct
d2d_command_list
*
command_list
,
ID2D1Bitmap
*
bitmap
,
const
D2D1_RECT_F
*
dst_rect
,
float
opacity
,
D2D1_INTERPOLATION_MODE
interpolation_mode
,
const
D2D1_RECT_F
*
src_rect
,
const
D2D1_MATRIX_4X4_F
*
perspective_transform
)
DECLSPEC_HIDDEN
;
void
d2d_command_list_draw_image
(
struct
d2d_command_list
*
command_list
,
ID2D1Image
*
image
,
const
D2D1_POINT_2F
*
target_offset
,
const
D2D1_RECT_F
*
image_rect
,
D2D1_INTERPOLATION_MODE
interpolation_mode
,
D2D1_COMPOSITE_MODE
composite_mode
)
DECLSPEC_HIDDEN
;
void
d2d_command_list_fill_mesh
(
struct
d2d_command_list
*
command_list
,
const
struct
d2d_device_context
*
context
,
ID2D1Mesh
*
mesh
,
ID2D1Brush
*
orig_brush
)
DECLSPEC_HIDDEN
;
void
d2d_command_list_fill_opacity_mask
(
struct
d2d_command_list
*
command_list
,
const
struct
d2d_device_context
*
context
,
...
...
dlls/d2d1/device.c
View file @
a52ba8d9
...
...
@@ -2511,7 +2511,8 @@ static void STDMETHODCALLTYPE d2d_device_context_DrawImage(ID2D1DeviceContext1 *
if
(
context
->
target
.
type
==
D2D_TARGET_COMMAND_LIST
)
{
FIXME
(
"Unimplemented for command list target.
\n
"
);
d2d_command_list_draw_image
(
context
->
target
.
command_list
,
image
,
target_offset
,
image_rect
,
interpolation_mode
,
composite_mode
);
return
;
}
...
...
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