From 063080f747375bbb6df6afb46a2a6938efbbf825 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Wed, 25 Mar 2015 10:05:28 +0100 Subject: [PATCH] d2d1: Implement d2d_state_block_GetTextRenderingParams(). --- dlls/d2d1/d2d1_private.h | 2 ++ dlls/d2d1/state_block.c | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/dlls/d2d1/d2d1_private.h b/dlls/d2d1/d2d1_private.h index 42694d2d86d..89d237735c0 100644 --- a/dlls/d2d1/d2d1_private.h +++ b/dlls/d2d1/d2d1_private.h @@ -174,6 +174,8 @@ struct d2d_state_block { ID2D1DrawingStateBlock ID2D1DrawingStateBlock_iface; LONG refcount; + + IDWriteRenderingParams *text_rendering_params; }; void d2d_state_block_init(struct d2d_state_block *state_block, const D2D1_DRAWING_STATE_DESCRIPTION *desc, diff --git a/dlls/d2d1/state_block.c b/dlls/d2d1/state_block.c index 4aa8cd49a1c..62458fbf29d 100644 --- a/dlls/d2d1/state_block.c +++ b/dlls/d2d1/state_block.c @@ -65,7 +65,11 @@ static ULONG STDMETHODCALLTYPE d2d_state_block_Release(ID2D1DrawingStateBlock *i TRACE("%p decreasing refcount to %u.\n", iface, refcount); if (!refcount) + { + if (state_block->text_rendering_params) + IDWriteRenderingParams_Release(state_block->text_rendering_params); HeapFree(GetProcessHeap(), 0, state_block); + } return refcount; } @@ -98,7 +102,12 @@ static void STDMETHODCALLTYPE d2d_state_block_SetTextRenderingParams(ID2D1Drawin static void STDMETHODCALLTYPE d2d_state_block_GetTextRenderingParams(ID2D1DrawingStateBlock *iface, IDWriteRenderingParams **text_rendering_params) { - FIXME("iface %p, text_rendering_params %p stub!\n", iface, text_rendering_params); + struct d2d_state_block *state_block = impl_from_ID2D1DrawingStateBlock(iface); + + TRACE("iface %p, text_rendering_params %p.\n", iface, text_rendering_params); + + if ((*text_rendering_params = state_block->text_rendering_params)) + IDWriteRenderingParams_AddRef(*text_rendering_params); } static const struct ID2D1DrawingStateBlockVtbl d2d_state_block_vtbl = @@ -120,4 +129,9 @@ void d2d_state_block_init(struct d2d_state_block *state_block, const D2D1_DRAWIN state_block->ID2D1DrawingStateBlock_iface.lpVtbl = &d2d_state_block_vtbl; state_block->refcount = 1; + if (text_rendering_params) + { + state_block->text_rendering_params = text_rendering_params; + IDWriteRenderingParams_AddRef(state_block->text_rendering_params); + } }