Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d2d1/device.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c index 1e420514a8..122008592e 100644 --- a/dlls/d2d1/device.c +++ b/dlls/d2d1/device.c @@ -1350,11 +1350,14 @@ static void STDMETHODCALLTYPE d2d_device_context_DrawGlyphRun(ID2D1DeviceContext DWRITE_TEXT_ANTIALIAS_MODE antialias_mode = DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE; IDWriteRenderingParams *rendering_params; DWRITE_RENDERING_MODE rendering_mode; - HRESULT hr; + HRESULT hr = S_OK;
TRACE("iface %p, baseline_origin %s, glyph_run %p, brush %p, measuring_mode %#x.\n", iface, debug_d2d_point_2f(&baseline_origin), glyph_run, brush, measuring_mode);
+ if (FAILED(context->error.code)) + return; + rendering_params = context->text_rendering_params ? context->text_rendering_params : context->default_text_rendering_params;
@@ -1368,26 +1371,29 @@ static void STDMETHODCALLTYPE d2d_device_context_DrawGlyphRun(ID2D1DeviceContext || rendering_mode == DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL || rendering_mode == DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC) { - d2d_device_context_set_error(context, E_INVALIDARG); + hr = E_INVALIDARG; } break; case D2D1_TEXT_ANTIALIAS_MODE_CLEARTYPE: if (rendering_mode == DWRITE_RENDERING_MODE_ALIASED || rendering_mode == DWRITE_RENDERING_MODE_OUTLINE) { - d2d_device_context_set_error(context, E_INVALIDARG); + hr = E_INVALIDARG; } break; case D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE: if (rendering_mode == DWRITE_RENDERING_MODE_ALIASED) - d2d_device_context_set_error(context, E_INVALIDARG); + hr = E_INVALIDARG; break; default: ; }
- if (FAILED(context->error.code)) + if (FAILED(hr)) + { + d2d_device_context_set_error(context, hr); return; + }
rendering_mode = DWRITE_RENDERING_MODE_DEFAULT; switch (context->drawing_state.textAntialiasMode)