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
7cfe6d8f
Commit
7cfe6d8f
authored
Aug 05, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 05, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d2d1/commandlist: Implement FillOpacityMask() command.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
4f1dfdad
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
0 deletions
+55
-0
command_list.c
dlls/d2d1/command_list.c
+47
-0
d2d1_private.h
dlls/d2d1/d2d1_private.h
+2
-0
device.c
dlls/d2d1/device.c
+6
-0
No files found.
dlls/d2d1/command_list.c
View file @
7cfe6d8f
...
...
@@ -41,6 +41,7 @@ enum d2d_command_type
D2D_COMMAND_DRAW_RECTANGLE
,
D2D_COMMAND_DRAW_BITMAP
,
D2D_COMMAND_FILL_MESH
,
D2D_COMMAND_FILL_OPACITY_MASK
,
D2D_COMMAND_FILL_GEOMETRY
,
D2D_COMMAND_FILL_RECTANGLE
,
D2D_COMMAND_PUSH_CLIP
,
...
...
@@ -142,6 +143,15 @@ struct d2d_command_fill_mesh
ID2D1Brush
*
brush
;
};
struct
d2d_command_fill_opacity_mask
{
struct
d2d_command
c
;
ID2D1Bitmap
*
bitmap
;
ID2D1Brush
*
brush
;
D2D1_RECT_F
*
dst_rect
;
D2D1_RECT_F
*
src_rect
;
};
struct
d2d_command_fill_geometry
{
struct
d2d_command
c
;
...
...
@@ -383,6 +393,12 @@ static HRESULT STDMETHODCALLTYPE d2d_command_list_Stream(ID2D1CommandList *iface
hr
=
ID2D1CommandSink_FillMesh
(
sink
,
c
->
mesh
,
c
->
brush
);
break
;
}
case
D2D_COMMAND_FILL_OPACITY_MASK
:
{
const
struct
d2d_command_fill_opacity_mask
*
c
=
data
;
hr
=
ID2D1CommandSink_FillOpacityMask
(
sink
,
c
->
bitmap
,
c
->
brush
,
c
->
dst_rect
,
c
->
src_rect
);
break
;
}
case
D2D_COMMAND_FILL_GEOMETRY
:
{
const
struct
d2d_command_fill_geometry
*
c
=
data
;
...
...
@@ -960,3 +976,34 @@ void d2d_command_list_fill_mesh(struct d2d_command_list *command_list, const str
command
->
mesh
=
mesh
;
command
->
brush
=
brush
;
}
void
d2d_command_list_fill_opacity_mask
(
struct
d2d_command_list
*
command_list
,
const
struct
d2d_device_context
*
context
,
ID2D1Bitmap
*
bitmap
,
ID2D1Brush
*
orig_brush
,
const
D2D1_RECT_F
*
dst_rect
,
const
D2D1_RECT_F
*
src_rect
)
{
struct
d2d_command_fill_opacity_mask
*
command
;
ID2D1Brush
*
brush
;
size_t
size
;
BYTE
*
data
;
if
(
FAILED
(
d2d_command_list_create_brush
(
command_list
,
context
,
orig_brush
,
&
brush
)))
{
command_list
->
state
=
D2D_COMMAND_LIST_STATE_ERROR
;
return
;
}
size
=
sizeof
(
*
command
);
if
(
dst_rect
)
size
+=
sizeof
(
*
dst_rect
);
if
(
src_rect
)
size
+=
sizeof
(
*
src_rect
);
d2d_command_list_reference_object
(
command_list
,
bitmap
);
command
=
d2d_command_list_require_space
(
command_list
,
size
);
command
->
c
.
op
=
D2D_COMMAND_FILL_OPACITY_MASK
;
command
->
bitmap
=
bitmap
;
command
->
brush
=
brush
;
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
));
}
dlls/d2d1/d2d1_private.h
View file @
7cfe6d8f
...
...
@@ -771,6 +771,8 @@ void d2d_command_list_draw_bitmap(struct d2d_command_list *command_list, ID2D1Bi
const
D2D1_RECT_F
*
src_rect
,
const
D2D1_MATRIX_4X4_F
*
perspective_transform
)
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
,
ID2D1Bitmap
*
bitmap
,
ID2D1Brush
*
orig_brush
,
const
D2D1_RECT_F
*
dst_rect
,
const
D2D1_RECT_F
*
src_rect
)
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 @
7cfe6d8f
...
...
@@ -1115,6 +1115,9 @@ static void STDMETHODCALLTYPE d2d_device_context_FillOpacityMask(ID2D1DeviceCont
d2d_device_context_set_error
(
context
,
E_INVALIDARG
);
return
;
}
if
(
context
->
target
.
type
==
D2D_TARGET_COMMAND_LIST
)
d2d_command_list_fill_opacity_mask
(
context
->
target
.
command_list
,
context
,
mask
,
brush
,
dst_rect
,
src_rect
);
}
static
void
d2d_device_context_draw_bitmap
(
struct
d2d_device_context
*
context
,
ID2D1Bitmap
*
bitmap
,
...
...
@@ -2614,6 +2617,9 @@ static void STDMETHODCALLTYPE d2d_device_context_ID2D1DeviceContext_FillOpacityM
d2d_device_context_set_error
(
context
,
D2DERR_WRONG_STATE
);
return
;
}
if
(
context
->
target
.
type
==
D2D_TARGET_COMMAND_LIST
)
d2d_command_list_fill_opacity_mask
(
context
->
target
.
command_list
,
context
,
mask
,
brush
,
dst_rect
,
src_rect
);
}
static
HRESULT
STDMETHODCALLTYPE
d2d_device_context_CreateFilledGeometryRealization
(
ID2D1DeviceContext1
*
iface
,
...
...
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