Fix 1% regression on the PLT. Make sure roundToDevicePixels does no
authorhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Apr 2007 03:08:05 +0000 (03:08 +0000)
committerhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Apr 2007 03:08:05 +0000 (03:08 +0000)
        work when no scale is in effect.

        Reviewed by mjs

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@21013 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/graphics/cg/GraphicsContextCG.cpp

index e059ce1f76966e096a76c760788d56bb24c1d584..81b239251b2109d0e3058bd89f39a17c763340a2 100644 (file)
@@ -1,3 +1,10 @@
+2007-04-22  David Hyatt  <hyatt@apple.com>
+
+        Fix 1% regression on the PLT.  Make sure roundToDevicePixels does no
+        work when no scale is in effect.
+
+        Reviewed by mjs
+
 2007-04-22  Darin Adler  <darin@apple.com>
 
         Reviewed by Oliver.
index 58cc98b31963197d8cb053e79b591706d3f49310..610b2ab66ce9aee97c18dbb413a046e531e6185f 100644 (file)
@@ -744,6 +744,9 @@ FloatRect GraphicsContext::roundToDevicePixels(const FloatRect& rect)
     // rotating image like the hands of the world clock widget. We just need the scale, so 
     // we get the affine transform matrix and extract the scale.
     CGAffineTransform deviceMatrix = CGContextGetUserSpaceToDeviceSpaceTransform(platformContext());
+    if (CGAffineTransformIsIdentity(deviceMatrix))
+        return rect;
+
     float deviceScaleX = sqrtf(deviceMatrix.a * deviceMatrix.a + deviceMatrix.b * deviceMatrix.b);
     float deviceScaleY = sqrtf(deviceMatrix.c * deviceMatrix.c + deviceMatrix.d * deviceMatrix.d);