[PATCH 4/5] d2d1: Implement d2d_state_block_GetDescription().

Henri Verbeet hverbeet at codeweavers.com
Wed Mar 25 04:05:30 CDT 2015


---
 dlls/d2d1/d2d1_private.h |    1 +
 dlls/d2d1/state_block.c  |   22 ++++++++++++++++------
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/dlls/d2d1/d2d1_private.h b/dlls/d2d1/d2d1_private.h
index 89d2377..bbceb7f 100644
--- a/dlls/d2d1/d2d1_private.h
+++ b/dlls/d2d1/d2d1_private.h
@@ -175,6 +175,7 @@ struct d2d_state_block
     ID2D1DrawingStateBlock ID2D1DrawingStateBlock_iface;
     LONG refcount;
 
+    D2D1_DRAWING_STATE_DESCRIPTION drawing_state;
     IDWriteRenderingParams *text_rendering_params;
 };
 
diff --git a/dlls/d2d1/state_block.c b/dlls/d2d1/state_block.c
index 978c7df..e893264 100644
--- a/dlls/d2d1/state_block.c
+++ b/dlls/d2d1/state_block.c
@@ -84,7 +84,11 @@ static void STDMETHODCALLTYPE d2d_state_block_GetFactory(ID2D1DrawingStateBlock
 static void STDMETHODCALLTYPE d2d_state_block_GetDescription(ID2D1DrawingStateBlock *iface,
         D2D1_DRAWING_STATE_DESCRIPTION *desc)
 {
-    FIXME("iface %p, desc %p stub!\n", iface, desc);
+    struct d2d_state_block *state_block = impl_from_ID2D1DrawingStateBlock(iface);
+
+    TRACE("iface %p, desc %p.\n", iface, desc);
+
+    *desc = state_block->drawing_state;
 }
 
 static void STDMETHODCALLTYPE d2d_state_block_SetDescription(ID2D1DrawingStateBlock *iface,
@@ -133,13 +137,19 @@ static const struct ID2D1DrawingStateBlockVtbl d2d_state_block_vtbl =
 void d2d_state_block_init(struct d2d_state_block *state_block, const D2D1_DRAWING_STATE_DESCRIPTION *desc,
         IDWriteRenderingParams *text_rendering_params)
 {
-    FIXME("Ignoring state block properties.\n");
+    static const D2D1_MATRIX_3X2_F identity =
+    {
+        1.0f, 0.0f,
+        0.0f, 1.0f,
+        0.0f, 0.0f,
+    };
 
     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;
+    if (desc)
+        state_block->drawing_state = *desc;
+    else
+        state_block->drawing_state.transform = identity;
+    if ((state_block->text_rendering_params = text_rendering_params))
         IDWriteRenderingParams_AddRef(state_block->text_rendering_params);
-    }
 }
-- 
1.7.10.4




More information about the wine-patches mailing list