d2d1: Implement d2d_d3d_render_target_SaveDrawingState().

This commit is contained in:
Henri Verbeet 2015-03-30 09:17:01 +02:00 committed by Alexandre Julliard
parent 8303199cbe
commit 3f97056424
3 changed files with 20 additions and 1 deletions

View File

@ -184,5 +184,6 @@ struct d2d_state_block
void d2d_state_block_init(struct d2d_state_block *state_block, const D2D1_DRAWING_STATE_DESCRIPTION *desc,
IDWriteRenderingParams *text_rendering_params) DECLSPEC_HIDDEN;
struct d2d_state_block *unsafe_impl_from_ID2D1DrawingStateBlock(ID2D1DrawingStateBlock *iface) DECLSPEC_HIDDEN;
#endif /* __WINE_D2D1_PRIVATE_H */

View File

@ -933,7 +933,17 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_Flush(ID2D1RenderTarget *
static void STDMETHODCALLTYPE d2d_d3d_render_target_SaveDrawingState(ID2D1RenderTarget *iface,
ID2D1DrawingStateBlock *state_block)
{
FIXME("iface %p, state_block %p stub!\n", iface, state_block);
struct d2d_state_block *state_block_impl = unsafe_impl_from_ID2D1DrawingStateBlock(state_block);
struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface);
TRACE("iface %p, state_block %p.\n", iface, state_block);
state_block_impl->drawing_state = render_target->drawing_state;
if (render_target->text_rendering_params)
IDWriteRenderingParams_AddRef(render_target->text_rendering_params);
if (state_block_impl->text_rendering_params)
IDWriteRenderingParams_Release(state_block_impl->text_rendering_params);
state_block_impl->text_rendering_params = render_target->text_rendering_params;
}
static void STDMETHODCALLTYPE d2d_d3d_render_target_RestoreDrawingState(ID2D1RenderTarget *iface,

View File

@ -157,3 +157,11 @@ void d2d_state_block_init(struct d2d_state_block *state_block, const D2D1_DRAWIN
if ((state_block->text_rendering_params = text_rendering_params))
IDWriteRenderingParams_AddRef(state_block->text_rendering_params);
}
struct d2d_state_block *unsafe_impl_from_ID2D1DrawingStateBlock(ID2D1DrawingStateBlock *iface)
{
if (!iface)
return NULL;
assert(iface->lpVtbl == &d2d_state_block_vtbl);
return CONTAINING_RECORD(iface, struct d2d_state_block, ID2D1DrawingStateBlock_iface);
}