Title: [114549] branches/subpixellayout/Source/WebCore/platform/graphics
Diff
Modified: branches/subpixellayout/Source/WebCore/platform/graphics/FloatRect.cpp (114548 => 114549)
--- branches/subpixellayout/Source/WebCore/platform/graphics/FloatRect.cpp 2012-04-18 20:05:10 UTC (rev 114548)
+++ branches/subpixellayout/Source/WebCore/platform/graphics/FloatRect.cpp 2012-04-18 20:08:00 UTC (rev 114549)
@@ -236,6 +236,11 @@
return IntRect(x, y, width, height);
}
+IntRect roundedIntRect(const FloatRect& rect)
+{
+ return IntRect(roundedIntPoint(rect.location()), roundedIntSize(rect.size()));
+}
+
FloatRect mapRect(const FloatRect& r, const FloatRect& srcRect, const FloatRect& destRect)
{
if (srcRect.width() == 0 || srcRect.height() == 0)
Modified: branches/subpixellayout/Source/WebCore/platform/graphics/FloatRect.h (114548 => 114549)
--- branches/subpixellayout/Source/WebCore/platform/graphics/FloatRect.h 2012-04-18 20:05:10 UTC (rev 114548)
+++ branches/subpixellayout/Source/WebCore/platform/graphics/FloatRect.h 2012-04-18 20:08:00 UTC (rev 114549)
@@ -288,6 +288,8 @@
// Returns a valid IntRect contained within the given FloatRect.
IntRect enclosedIntRect(const FloatRect&);
+IntRect roundedIntRect(const FloatRect&);
+
// Map rect r from srcRect to an equivalent rect in destRect.
FloatRect mapRect(const FloatRect& r, const FloatRect& srcRect, const FloatRect& destRect);
Modified: branches/subpixellayout/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp (114548 => 114549)
--- branches/subpixellayout/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp 2012-04-18 20:05:10 UTC (rev 114548)
+++ branches/subpixellayout/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp 2012-04-18 20:08:00 UTC (rev 114549)
@@ -1302,11 +1302,6 @@
return AffineTransform(CGContextGetCTM(platformContext()));
}
-static inline FloatRect roundedFloatRect(const FloatRect& rect)
-{
- return FloatRect(lroundf(rect.x()), lroundf(rect.y()), lroundf(rect.width()), lroundf(rect.height()));
-}
-
FloatRect GraphicsContext::roundToDevicePixels(const FloatRect& rect, RoundingMode roundingMode)
{
#if PLATFORM(CHROMIUM)
@@ -1318,12 +1313,12 @@
// we get the affine transform matrix and extract the scale.
if (m_data->m_userToDeviceTransformKnownToBeIdentity)
- return roundedFloatRect(rect);
+ return roundedIntRect(rect);
CGAffineTransform deviceMatrix = CGContextGetUserSpaceToDeviceSpaceTransform(platformContext());
if (CGAffineTransformIsIdentity(deviceMatrix)) {
m_data->m_userToDeviceTransformKnownToBeIdentity = true;
- return roundedFloatRect(rect);
+ return roundedIntRect(rect);
}
float deviceScaleX = sqrtf(deviceMatrix.a * deviceMatrix.a + deviceMatrix.b * deviceMatrix.b);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes