Module: wine Branch: master Commit: 9749caf78e4167b96f58755e28279a6cc033758b URL: https://gitlab.winehq.org/wine/wine/-/commit/9749caf78e4167b96f58755e28279a6...
Author: Bartosz Kosiorek gang65@poczta.onet.pl Date: Tue Dec 20 17:21:16 2022 +0100
gdiplus: Improve performance of gdip_transform_points.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53947
---
dlls/gdiplus/graphics.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index fca66c8654b..6831cfcb247 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -6887,13 +6887,15 @@ GpStatus get_graphics_transform(GpGraphics *graphics, GpCoordinateSpace dst_spac
if (dst_space != src_space) { - scale_x = units_to_pixels(1.0, graphics->unit, graphics->xres, graphics->printer_display); - scale_y = units_to_pixels(1.0, graphics->unit, graphics->yres, graphics->printer_display); - if(graphics->unit != UnitDisplay) { - scale_x *= graphics->scale; - scale_y *= graphics->scale; + scale_x = units_to_pixels(graphics->scale, graphics->unit, graphics->xres, graphics->printer_display); + scale_y = units_to_pixels(graphics->scale, graphics->unit, graphics->yres, graphics->printer_display); + } + else + { + scale_x = units_to_pixels(1.0, graphics->unit, graphics->xres, graphics->printer_display); + scale_y = units_to_pixels(1.0, graphics->unit, graphics->yres, graphics->printer_display); }
if (dst_space < src_space) @@ -6903,12 +6905,11 @@ GpStatus get_graphics_transform(GpGraphics *graphics, GpCoordinateSpace dst_spac { case WineCoordinateSpaceGdiDevice: { - GpMatrix gdixform; - gdixform = graphics->gdi_transform; + GpMatrix gdixform = graphics->gdi_transform; stat = GdipInvertMatrix(&gdixform); if (stat != Ok) break; - GdipMultiplyMatrix(matrix, &gdixform, MatrixOrderAppend); + memcpy(matrix->matrix, gdixform.matrix, sizeof(matrix->matrix)); if (dst_space == CoordinateSpaceDevice) break; /* else fall-through */ @@ -6934,7 +6935,7 @@ GpStatus get_graphics_transform(GpGraphics *graphics, GpCoordinateSpace dst_spac switch ((int)src_space) { case CoordinateSpaceWorld: - GdipMultiplyMatrix(matrix, &graphics->worldtrans, MatrixOrderAppend); + memcpy(matrix->matrix, &graphics->worldtrans, sizeof(matrix->matrix)); if (dst_space == CoordinateSpacePage) break; /* else fall-through */