From: Tingzhong Luo luotingzhong@uniontech.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/dwrite/tests/font.c | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c index 4bd193af4cb..642bfc31c74 100644 --- a/dlls/dwrite/tests/font.c +++ b/dlls/dwrite/tests/font.c @@ -1225,6 +1225,7 @@ static void test_CreateBitmapRenderTarget(void) SIZE size; ULONG ref; UINT32 ch; + RECT box; HDC hdc; int ret;
@@ -1507,6 +1508,14 @@ static void test_CreateBitmapRenderTarget(void) &run, params, RGB(255, 0, 0), NULL); ok(hr == S_OK, "Failed to draw a run, hr %#lx.\n", hr);
+ /* Glyph bitmap outside of the target bitmap. */ + SetRectEmpty(&box); + hr = IDWriteBitmapRenderTarget_DrawGlyphRun(target, -500.0f, -500.0f, DWRITE_MEASURING_MODE_GDI_NATURAL, + &run, params, RGB(255, 0, 0), &box); + ok(hr == S_OK, "Failed to draw a run, hr %#lx.\n", hr); + todo_wine + ok(!IsRectEmpty(&box), "Got unexpected rectangle %s.\n", wine_dbgstr_rect(&box)); + IDWriteRenderingParams_Release(params);
/* Zero sized target returns earlier. */
From: Tingzhong Luo luotingzhong@uniontech.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/dwrite/gdiinterop.c | 4 ++++ dlls/dwrite/tests/font.c | 1 - 2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/dwrite/gdiinterop.c b/dlls/dwrite/gdiinterop.c index 5b542d93e32..5326096f9f7 100644 --- a/dlls/dwrite/gdiinterop.c +++ b/dlls/dwrite/gdiinterop.c @@ -479,6 +479,10 @@ static HRESULT WINAPI rendertarget_DrawGlyphRun(IDWriteBitmapRenderTarget1 *ifac
free(bitmap); } + else if (bbox_ret) + { + *bbox_ret = bounds; + }
IDWriteGlyphRunAnalysis_Release(analysis);
diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c index 642bfc31c74..d299d994273 100644 --- a/dlls/dwrite/tests/font.c +++ b/dlls/dwrite/tests/font.c @@ -1513,7 +1513,6 @@ static void test_CreateBitmapRenderTarget(void) hr = IDWriteBitmapRenderTarget_DrawGlyphRun(target, -500.0f, -500.0f, DWRITE_MEASURING_MODE_GDI_NATURAL, &run, params, RGB(255, 0, 0), &box); ok(hr == S_OK, "Failed to draw a run, hr %#lx.\n", hr); - todo_wine ok(!IsRectEmpty(&box), "Got unexpected rectangle %s.\n", wine_dbgstr_rect(&box));
IDWriteRenderingParams_Release(params);
From: Tingzhong Luo luotingzhong@uniontech.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/dwrite/dwrite_private.h | 12 ++++++++++++ dlls/dwrite/gdiinterop.c | 9 +++++---- dlls/dwrite/main.c | 12 ------------ 3 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/dlls/dwrite/dwrite_private.h b/dlls/dwrite/dwrite_private.h index f8d0b9add19..b200ce58eb6 100644 --- a/dlls/dwrite/dwrite_private.h +++ b/dlls/dwrite/dwrite_private.h @@ -126,6 +126,18 @@ static inline BOOL is_simulation_valid(DWRITE_FONT_SIMULATIONS simulations) DWRITE_FONT_SIMULATIONS_OBLIQUE)) == 0; }
+static inline void dwrite_matrix_multiply(DWRITE_MATRIX *a, const DWRITE_MATRIX *b) +{ + DWRITE_MATRIX tmp = *a; + + a->m11 = tmp.m11 * b->m11 + tmp.m12 * b->m21; + a->m12 = tmp.m11 * b->m12 + tmp.m12 * b->m22; + a->m21 = tmp.m21 * b->m11 + tmp.m22 * b->m21; + a->m22 = tmp.m21 * b->m12 + tmp.m22 * b->m22; + a->dx = tmp.dx * b->m11 + tmp.dy * b->m21 + b->dx; + a->dy = tmp.dy * b->m12 + tmp.dy * b->m22 + b->dx; +} + struct textlayout_desc { IDWriteFactory7 *factory; diff --git a/dlls/dwrite/gdiinterop.c b/dlls/dwrite/gdiinterop.c index 5326096f9f7..3e456a04a41 100644 --- a/dlls/dwrite/gdiinterop.c +++ b/dlls/dwrite/gdiinterop.c @@ -347,7 +347,7 @@ static HRESULT WINAPI rendertarget_DrawGlyphRun(IDWriteBitmapRenderTarget1 *ifac DWRITE_RENDERING_MODE1 rendermode; DWRITE_GRID_FIT_MODE gridfitmode; DWRITE_TEXTURE_TYPE texturetype; - DWRITE_GLYPH_RUN scaled_run; + DWRITE_MATRIX m, scale = { 0 }; IDWriteFontFace3 *fontface; RECT target_rect, bounds; HRESULT hr; @@ -429,9 +429,10 @@ static HRESULT WINAPI rendertarget_DrawGlyphRun(IDWriteBitmapRenderTarget1 *ifac return hr; }
- scaled_run = *run; - scaled_run.fontEmSize *= target->ppdip; - hr = IDWriteFactory7_CreateGlyphRunAnalysis(target->factory, &scaled_run, &target->m, rendermode, measuring_mode, + m = target->m; + scale.m11 = scale.m22 = target->ppdip; + dwrite_matrix_multiply(&m, &scale); + hr = IDWriteFactory7_CreateGlyphRunAnalysis(target->factory, run, &m, rendermode, measuring_mode, gridfitmode, target->antialiasmode, originX, originY, &analysis); if (FAILED(hr)) { diff --git a/dlls/dwrite/main.c b/dlls/dwrite/main.c index e8765f0672e..1dc5ae48baa 100644 --- a/dlls/dwrite/main.c +++ b/dlls/dwrite/main.c @@ -1296,18 +1296,6 @@ static HRESULT WINAPI dwritefactory_CreateNumberSubstitution(IDWriteFactory7 *if return create_numbersubstitution(method, locale, ignore_user_override, substitution); }
-static inline void dwrite_matrix_multiply(DWRITE_MATRIX *a, const DWRITE_MATRIX *b) -{ - DWRITE_MATRIX tmp = *a; - - a->m11 = tmp.m11 * b->m11 + tmp.m12 * b->m21; - a->m12 = tmp.m11 * b->m12 + tmp.m12 * b->m22; - a->m21 = tmp.m21 * b->m11 + tmp.m22 * b->m21; - a->m22 = tmp.m21 * b->m12 + tmp.m22 * b->m22; - a->dx = tmp.dx * b->m11 + tmp.dy * b->m21 + b->dx; - a->dy = tmp.dy * b->m12 + tmp.dy * b->m22 + b->dx; -} - static HRESULT WINAPI dwritefactory_CreateGlyphRunAnalysis(IDWriteFactory7 *iface, DWRITE_GLYPH_RUN const *run, FLOAT ppdip, DWRITE_MATRIX const* transform, DWRITE_RENDERING_MODE rendering_mode, DWRITE_MEASURING_MODE measuring_mode, FLOAT originX, FLOAT originY, IDWriteGlyphRunAnalysis **analysis)
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=149950
Your paranoid android.
=== debian11b (64 bit WoW report) ===
user32: input.c:4305: Test succeeded inside todo block: button_down_hwnd_todo 1: got MSG_TEST_WIN hwnd 00000000018C00F0, msg WM_LBUTTONDOWN, wparam 0x1, lparam 0x320032 monitor.c:390: Test failed: WaitForSingleObject returned 102. monitor.c:390: Test failed: WaitForSingleObject returned 102. monitor.c:1311: Test failed: WaitForSingleObject returned 102. win.c:4070: Test failed: Expected active window 000000000529016E, got 0000000000000000. win.c:4071: Test failed: Expected focus window 000000000529016E, got 0000000000000000.
This merge request was approved by Nikolay Sivov.