mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-02 09:03:38 +00:00
d2d1/commandlist: Implement Clear() command.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
parent
eba21e7502
commit
ccfdeec3a1
|
@ -28,6 +28,7 @@ enum d2d_command_type
|
|||
D2D_COMMAND_SET_TRANSFORM,
|
||||
D2D_COMMAND_SET_PRIMITIVE_BLEND,
|
||||
D2D_COMMAND_SET_UNIT_MODE,
|
||||
D2D_COMMAND_CLEAR,
|
||||
D2D_COMMAND_PUSH_CLIP,
|
||||
D2D_COMMAND_POP_CLIP,
|
||||
};
|
||||
|
@ -74,6 +75,12 @@ struct d2d_command_set_unit_mode
|
|||
D2D1_UNIT_MODE mode;
|
||||
};
|
||||
|
||||
struct d2d_command_clear
|
||||
{
|
||||
struct d2d_command c;
|
||||
D2D1_COLOR_F color;
|
||||
};
|
||||
|
||||
struct d2d_command_push_clip
|
||||
{
|
||||
struct d2d_command c;
|
||||
|
@ -199,6 +206,12 @@ static HRESULT STDMETHODCALLTYPE d2d_command_list_Stream(ID2D1CommandList *iface
|
|||
hr = ID2D1CommandSink_SetUnitMode(sink, c->mode);
|
||||
break;
|
||||
}
|
||||
case D2D_COMMAND_CLEAR:
|
||||
{
|
||||
const struct d2d_command_clear *c = data;
|
||||
hr = ID2D1CommandSink_Clear(sink, &c->color);
|
||||
break;
|
||||
}
|
||||
case D2D_COMMAND_PUSH_CLIP:
|
||||
{
|
||||
const struct d2d_command_push_clip *c = data;
|
||||
|
@ -380,3 +393,13 @@ void d2d_command_list_pop_clip(struct d2d_command_list *command_list)
|
|||
command = d2d_command_list_require_space(command_list, sizeof(*command));
|
||||
command->op = D2D_COMMAND_POP_CLIP;
|
||||
}
|
||||
|
||||
void d2d_command_list_clear(struct d2d_command_list *command_list, const D2D1_COLOR_F *color)
|
||||
{
|
||||
struct d2d_command_clear *command;
|
||||
|
||||
command = d2d_command_list_require_space(command_list, sizeof(*command));
|
||||
command->c.op = D2D_COMMAND_CLEAR;
|
||||
if (color) command->color = *color;
|
||||
else memset(&command->color, 0, sizeof(command->color));
|
||||
}
|
||||
|
|
|
@ -741,6 +741,7 @@ void d2d_command_list_set_transform(struct d2d_command_list *command_list,
|
|||
void d2d_command_list_push_clip(struct d2d_command_list *command_list, const D2D1_RECT_F *rect,
|
||||
D2D1_ANTIALIAS_MODE antialias_mode) DECLSPEC_HIDDEN;
|
||||
void d2d_command_list_pop_clip(struct d2d_command_list *command_list) DECLSPEC_HIDDEN;
|
||||
void d2d_command_list_clear(struct d2d_command_list *command_list, const D2D1_COLOR_F *color) DECLSPEC_HIDDEN;
|
||||
|
||||
static inline BOOL d2d_array_reserve(void **elements, size_t *capacity, size_t count, size_t size)
|
||||
{
|
||||
|
|
|
@ -1703,7 +1703,7 @@ static void STDMETHODCALLTYPE d2d_device_context_Clear(ID2D1DeviceContext1 *ifac
|
|||
|
||||
if (context->target.type == D2D_TARGET_COMMAND_LIST)
|
||||
{
|
||||
FIXME("Unimplemented for command list target.\n");
|
||||
d2d_command_list_clear(context->target.command_list, colour);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue