[3/3] gdiplus: Allocate a copy of the graphics transformation matrix on the stack instead of cloning it.
Dmitry Timoshkov
dmitry at baikal.ru
Fri Nov 2 05:18:14 CDT 2012
---
dlls/gdiplus/graphics.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 23edda8..5296163 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -312,7 +312,7 @@ static void transform_and_round_points(GpGraphics *graphics, POINT *pti,
GpPointF *ptf, INT count, GDIPCONST GpMatrix *extra)
{
REAL scale_x, scale_y;
- GpMatrix *matrix;
+ GpMatrix matrix;
int i;
scale_x = units_to_pixels(1.0, graphics->unit, graphics->xres);
@@ -325,15 +325,14 @@ static void transform_and_round_points(GpGraphics *graphics, POINT *pti,
scale_y *= graphics->scale;
}
- GdipCloneMatrix(graphics->worldtrans, &matrix);
- GdipScaleMatrix(matrix, scale_x, scale_y, MatrixOrderAppend);
+ matrix = *graphics->worldtrans;
+ GdipScaleMatrix(&matrix, scale_x, scale_y, MatrixOrderAppend);
if (extra)
{
GpMatrix xform = *extra;
- GdipMultiplyMatrix(matrix, &xform, MatrixOrderAppend);
+ GdipMultiplyMatrix(&matrix, &xform, MatrixOrderAppend);
}
- GdipTransformMatrixPoints(matrix, ptf, count);
- GdipDeleteMatrix(matrix);
+ GdipTransformMatrixPoints(&matrix, ptf, count);
for(i = 0; i < count; i++){
pti[i].x = gdip_round(ptf[i].X);
--
1.7.12.4
More information about the wine-patches
mailing list