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
da9eabd6
Commit
da9eabd6
authored
Aug 03, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 03, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d2d1/commandlist: Implement DrawBitmap() command.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
40e353a6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
11 deletions
+64
-11
command_list.c
dlls/d2d1/command_list.c
+47
-0
d2d1_private.h
dlls/d2d1/d2d1_private.h
+3
-0
device.c
dlls/d2d1/device.c
+14
-10
d2d1.c
dlls/d2d1/tests/d2d1.c
+0
-1
No files found.
dlls/d2d1/command_list.c
View file @
da9eabd6
...
...
@@ -34,6 +34,7 @@ enum d2d_command_type
D2D_COMMAND_DRAW_LINE
,
D2D_COMMAND_DRAW_GEOMETRY
,
D2D_COMMAND_DRAW_RECTANGLE
,
D2D_COMMAND_DRAW_BITMAP
,
D2D_COMMAND_FILL_GEOMETRY
,
D2D_COMMAND_FILL_RECTANGLE
,
D2D_COMMAND_PUSH_CLIP
,
...
...
@@ -153,6 +154,17 @@ struct d2d_command_draw_glyph_run
DWRITE_GLYPH_RUN_DESCRIPTION
*
run_desc
;
};
struct
d2d_command_draw_bitmap
{
struct
d2d_command
c
;
float
opacity
;
D2D1_INTERPOLATION_MODE
interpolation_mode
;
ID2D1Bitmap
*
bitmap
;
D2D1_RECT_F
*
dst_rect
;
D2D1_RECT_F
*
src_rect
;
D2D1_MATRIX_4X4_F
*
perspective_transform
;
};
static
inline
struct
d2d_command_list
*
impl_from_ID2D1CommandList
(
ID2D1CommandList
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
d2d_command_list
,
ID2D1CommandList_iface
);
...
...
@@ -314,6 +326,13 @@ static HRESULT STDMETHODCALLTYPE d2d_command_list_Stream(ID2D1CommandList *iface
c
->
stroke_style
);
break
;
}
case
D2D_COMMAND_DRAW_BITMAP
:
{
const
struct
d2d_command_draw_bitmap
*
c
=
data
;
hr
=
ID2D1CommandSink_DrawBitmap
(
sink
,
c
->
bitmap
,
c
->
dst_rect
,
c
->
opacity
,
c
->
interpolation_mode
,
c
->
src_rect
,
c
->
perspective_transform
);
break
;
}
case
D2D_COMMAND_FILL_GEOMETRY
:
{
const
struct
d2d_command_fill_geometry
*
c
=
data
;
...
...
@@ -819,3 +838,31 @@ void d2d_command_list_draw_glyph_run(struct d2d_command_list *command_list,
command
->
origin
=
origin
;
command
->
measuring_mode
=
measuring_mode
;
}
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
)
{
struct
d2d_command_draw_bitmap
*
command
;
size_t
size
;
BYTE
*
data
;
size
=
sizeof
(
*
command
);
if
(
dst_rect
)
size
+=
sizeof
(
*
dst_rect
);
if
(
src_rect
)
size
+=
sizeof
(
*
src_rect
);
if
(
perspective_transform
)
size
+=
sizeof
(
*
perspective_transform
);
d2d_command_list_reference_object
(
command_list
,
bitmap
);
command
=
d2d_command_list_require_space
(
command_list
,
size
);
command
->
c
.
op
=
D2D_COMMAND_DRAW_BITMAP
;
command
->
bitmap
=
bitmap
;
command
->
opacity
=
opacity
;
command
->
interpolation_mode
=
interpolation_mode
;
data
=
(
BYTE
*
)(
command
+
1
);
d2d_command_list_write_field
(
&
data
,
&
command
->
dst_rect
,
dst_rect
,
sizeof
(
*
dst_rect
));
d2d_command_list_write_field
(
&
data
,
&
command
->
src_rect
,
src_rect
,
sizeof
(
*
src_rect
));
d2d_command_list_write_field
(
&
data
,
&
command
->
perspective_transform
,
perspective_transform
,
sizeof
(
*
perspective_transform
));
}
dlls/d2d1/d2d1_private.h
View file @
da9eabd6
...
...
@@ -765,6 +765,9 @@ void d2d_command_list_draw_glyph_run(struct d2d_command_list *command_list,
const
struct
d2d_device_context
*
context
,
D2D1_POINT_2F
origin
,
const
DWRITE_GLYPH_RUN
*
run
,
const
DWRITE_GLYPH_RUN_DESCRIPTION
*
run_desc
,
ID2D1Brush
*
orig_brush
,
DWRITE_MEASURING_MODE
measuring_mode
)
DECLSPEC_HIDDEN
;
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
;
static
inline
BOOL
d2d_array_reserve
(
void
**
elements
,
size_t
*
capacity
,
size_t
count
,
size_t
size
)
{
...
...
dlls/d2d1/device.c
View file @
da9eabd6
...
...
@@ -1181,12 +1181,14 @@ static void STDMETHODCALLTYPE d2d_device_context_DrawBitmap(ID2D1DeviceContext1
if
(
context
->
target
.
type
==
D2D_TARGET_COMMAND_LIST
)
{
FIXME
(
"Unimplemented for command list target.
\n
"
);
return
;
d2d_command_list_draw_bitmap
(
context
->
target
.
command_list
,
bitmap
,
dst_rect
,
opacity
,
d2d1_1_interp_mode_from_d2d1
(
interpolation_mode
),
src_rect
,
NULL
);
}
else
{
d2d_device_context_draw_bitmap
(
context
,
bitmap
,
dst_rect
,
opacity
,
d2d1_1_interp_mode_from_d2d1
(
interpolation_mode
),
src_rect
,
NULL
,
NULL
);
}
d2d_device_context_draw_bitmap
(
context
,
bitmap
,
dst_rect
,
opacity
,
d2d1_1_interp_mode_from_d2d1
(
interpolation_mode
),
src_rect
,
NULL
,
NULL
);
}
static
void
STDMETHODCALLTYPE
d2d_device_context_DrawText
(
ID2D1DeviceContext1
*
iface
,
...
...
@@ -2498,12 +2500,14 @@ static void STDMETHODCALLTYPE d2d_device_context_ID2D1DeviceContext_DrawBitmap(I
if
(
context
->
target
.
type
==
D2D_TARGET_COMMAND_LIST
)
{
FIXME
(
"Unimplemented for command list target.
\n
"
);
return
;
d2d_command_list_draw_bitmap
(
context
->
target
.
command_list
,
bitmap
,
dst_rect
,
opacity
,
interpolation_mode
,
src_rect
,
perspective_transform
);
}
else
{
d2d_device_context_draw_bitmap
(
context
,
bitmap
,
dst_rect
,
opacity
,
interpolation_mode
,
src_rect
,
NULL
,
perspective_transform
);
}
d2d_device_context_draw_bitmap
(
context
,
bitmap
,
dst_rect
,
opacity
,
interpolation_mode
,
src_rect
,
NULL
,
perspective_transform
);
}
static
void
STDMETHODCALLTYPE
d2d_device_context_ID2D1DeviceContext_PushLayer
(
ID2D1DeviceContext1
*
iface
,
...
...
dlls/d2d1/tests/d2d1.c
View file @
da9eabd6
...
...
@@ -9501,7 +9501,6 @@ static void test_command_list(BOOL d3d11)
ID2D1RenderTarget_DrawBitmap
(
rt
,
bitmap
,
NULL
,
0
.
25
f
,
D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR
,
NULL
);
refcount
=
ID2D1Bitmap_Release
(
bitmap
);
todo_wine
ok
(
refcount
==
1
,
"Got unexpected refcount %lu.
\n
"
,
refcount
);
/* Solid color brush. */
...
...
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