Nikolay Sivov : dwrite/tests: Additional test for Draw().

Alexandre Julliard julliard at wine.codeweavers.com
Tue Jan 20 15:20:10 CST 2015


Module: wine
Branch: master
Commit: aef50786fb5df36002cf06426ed53fb29208916f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=aef50786fb5df36002cf06426ed53fb29208916f

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Wed Jan 14 08:13:12 2015 +0300

dwrite/tests: Additional test for Draw().

---

 dlls/dwrite/tests/layout.c | 27 ++++++++++++++++++++++++---
 1 file changed, 24 insertions(+), 3 deletions(-)

diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c
index 1a1cfd9..760c34f 100644
--- a/dlls/dwrite/tests/layout.c
+++ b/dlls/dwrite/tests/layout.c
@@ -785,7 +785,17 @@ static const struct drawcall_entry draw_seq[] = {
     { DRAW_LAST_KIND }
 };
 
-static void test_draw_sequence(void)
+static const struct drawcall_entry draw_seq2[] = {
+    { DRAW_GLYPHRUN },
+    { DRAW_GLYPHRUN },
+    { DRAW_GLYPHRUN },
+    { DRAW_GLYPHRUN },
+    { DRAW_GLYPHRUN },
+    { DRAW_GLYPHRUN },
+    { DRAW_LAST_KIND }
+};
+
+static void test_Draw(void)
 {
     static const WCHAR strW[] = {'s','t','r','i','n','g',0};
     static const WCHAR ruW[] = {'r','u',0};
@@ -831,9 +841,20 @@ static void test_draw_sequence(void)
 todo_wine
     ok(hr == S_OK, "got 0x%08x\n", hr);
     ok_sequence(sequences, RENDERER_ID, draw_seq, "draw test", TRUE);
+    IDWriteTextLayout_Release(layout);
+
+    /* with reduced width DrawGlyphRun() is called for every line */
+    hr = IDWriteFactory_CreateTextLayout(factory, strW, 6, format, 5.0, 100.0, &layout);
+    ok(hr == S_OK, "got 0x%08x\n", hr);
+    flush_sequence(sequences, RENDERER_ID);
+    hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0);
+todo_wine
+    ok(hr == S_OK, "got 0x%08x\n", hr);
+    ok_sequence(sequences, RENDERER_ID, draw_seq2, "draw test 2", TRUE);
 
-    IDWriteTextFormat_Release(format);
     IDWriteTextLayout_Release(layout);
+
+    IDWriteTextFormat_Release(format);
 }
 
 static void test_typography(void)
@@ -1010,7 +1031,7 @@ START_TEST(layout)
     test_CreateEllipsisTrimmingSign();
     test_fontweight();
     test_SetInlineObject();
-    test_draw_sequence();
+    test_Draw();
     test_typography();
     test_GetClusterMetrics();
     test_SetLocaleName();




More information about the wine-cvs mailing list