dwrite: Don't use drawing effect for trimming signs.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2017-08-24 14:25:06 +03:00 committed by Alexandre Julliard
parent 7316c96239
commit d58166d47c
2 changed files with 11 additions and 8 deletions

View File

@ -5030,20 +5030,15 @@ static HRESULT WINAPI dwritetrimmingsign_Draw(IDWriteInlineObject *iface, void *
FLOAT originX, FLOAT originY, BOOL is_sideways, BOOL is_rtl, IUnknown *effect)
{
struct dwrite_trimmingsign *This = impl_from_IDWriteInlineObject(iface);
DWRITE_TEXT_RANGE range = { 0, ~0u };
DWRITE_TEXT_METRICS metrics;
DWRITE_LINE_METRICS line;
UINT32 line_count;
HRESULT hr;
TRACE("(%p)->(%p %p %.2f %.2f %d %d %p)\n", This, context, renderer, originX, originY, is_sideways, is_rtl, effect);
IDWriteTextLayout_SetDrawingEffect(This->layout, effect, range);
IDWriteTextLayout_GetLineMetrics(This->layout, &line, 1, &line_count);
IDWriteTextLayout_GetMetrics(This->layout, &metrics);
hr = IDWriteTextLayout_Draw(This->layout, context, renderer, originX, originY - line.baseline);
IDWriteTextLayout_SetDrawingEffect(This->layout, NULL, range);
return hr;
return IDWriteTextLayout_Draw(This->layout, context, renderer, originX, originY - line.baseline);
}
static HRESULT WINAPI dwritetrimmingsign_GetMetrics(IDWriteInlineObject *iface, DWRITE_INLINE_OBJECT_METRICS *ret)

View File

@ -1228,12 +1228,13 @@ static void test_GetLocaleName(void)
}
static const struct drawcall_entry drawellipsis_seq[] = {
{ DRAW_GLYPHRUN, {0x2026, 0}, {'e','n','-','u','s',0}, 1 },
{ DRAW_GLYPHRUN, {0x2026, 0}, {'e','n','-','g','b',0}, 1 },
{ DRAW_LAST_KIND }
};
static void test_CreateEllipsisTrimmingSign(void)
{
static const WCHAR engbW[] = {'e','n','-','G','B',0};
DWRITE_INLINE_OBJECT_METRICS metrics;
DWRITE_BREAK_CONDITION before, after;
IDWriteTextFormat *format;
@ -1245,7 +1246,7 @@ static void test_CreateEllipsisTrimmingSign(void)
factory = create_factory();
hr = IDWriteFactory_CreateTextFormat(factory, tahomaW, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 10.0, enusW, &format);
DWRITE_FONT_STRETCH_NORMAL, 10.0, engbW, &format);
ok(hr == S_OK, "got 0x%08x\n", hr);
EXPECT_REF(format, 1);
@ -1286,12 +1287,19 @@ if (0) {/* crashes on native */
effect = create_test_effect();
EXPECT_REF(effect, 1);
flush_sequence(sequences, RENDERER_ID);
hr = IDWriteInlineObject_Draw(sign, NULL, &testrenderer, 0.0f, 0.0f, FALSE, FALSE, effect);
ok(hr == S_OK, "Failed to draw trimming sign, hr %#x.\n", hr);
ok_sequence(sequences, RENDERER_ID, drawellipsis_seq, "ellipsis sign draw with effect test", FALSE);
EXPECT_REF(effect, 1);
IUnknown_Release(effect);
flush_sequence(sequences, RENDERER_ID);
hr = IDWriteInlineObject_Draw(sign, NULL, &testrenderer, 0.0f, 0.0f, FALSE, FALSE, (void *)0xdeadbeef);
ok(hr == S_OK, "Failed to draw trimming sign, hr %#x.\n", hr);
ok_sequence(sequences, RENDERER_ID, drawellipsis_seq, "ellipsis sign draw with effect test", FALSE);
IDWriteInlineObject_Release(sign);
/* non-orthogonal flow/reading combination */