+2012-05-17 Emil A Eklund <eae@chromium.org>
+
+ Fix rounding in RenderFlowThread::paintIntoRegion
+ https://bugs.webkit.org/show_bug.cgi?id=86695
+
+ Reviewed by Eric Seidel.
+
+ Fix rounding of offset in paintIntoRegion to ensure that we paint on
+ device pixel boundaries.
+
+ Covered by existing tests in fast/regions.
+
+ * platform/graphics/FractionalLayoutPoint.h:
+ (WebCore::roundedIntPoint):
+ Add roundedIntPoint(FractionalLayoutSize) function.
+ (WebCore):
+ * rendering/RenderFlowThread.cpp:
+ (WebCore::RenderFlowThread::paintIntoRegion):
+
2012-05-17 Andreas Kling <kling@webkit.org>
Parser: Avoid unnecessary ref count churn in token constructors.
return IntPoint(point.x().round(), point.y().round());
}
+inline IntPoint roundedIntPoint(const FractionalLayoutSize& size)
+{
+ return IntPoint(size.width().round(), size.height().round());
+}
+
inline IntPoint ceiledIntPoint(const FractionalLayoutPoint& point)
{
return IntPoint(point.x().ceil(), point.y().ceil());
// RenderFlowThread should start painting its content in a position that is offset
// from the region rect's current position. The amount of offset is equal to the location of
// region in flow coordinates.
- LayoutPoint renderFlowThreadOffset;
+ IntPoint renderFlowThreadOffset;
if (style()->isFlippedBlocksWritingMode()) {
LayoutRect flippedRegionRect(regionRect);
flipForWritingMode(flippedRegionRect);
- renderFlowThreadOffset = LayoutPoint(paintOffset - flippedRegionRect.location());
+ renderFlowThreadOffset = roundedIntPoint(paintOffset - flippedRegionRect.location());
} else
- renderFlowThreadOffset = LayoutPoint(paintOffset - regionRect.location());
+ renderFlowThreadOffset = roundedIntPoint(paintOffset - regionRect.location());
context->translate(renderFlowThreadOffset.x(), renderFlowThreadOffset.y());
- info.rect.moveBy(-roundedIntPoint(renderFlowThreadOffset));
+ info.rect.moveBy(-renderFlowThreadOffset);
layer()->paint(context, info.rect, 0, 0, region, RenderLayer::PaintLayerTemporaryClipRects);