Fix 1% regression on the PLT. Make sure roundToDevicePixels does no
[WebKit-https.git] / WebCore / platform / graphics / cg / GraphicsContextCG.cpp
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);