Changeset 117476 in webkit


Ignore:
Timestamp:
May 17, 2012 12:04:53 PM (12 years ago)
Author:
eae@chromium.org
Message:

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):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r117473 r117476  
     12012-05-17  Emil A Eklund  <eae@chromium.org>
     2
     3        Fix rounding in RenderFlowThread::paintIntoRegion
     4        https://bugs.webkit.org/show_bug.cgi?id=86695
     5
     6        Reviewed by Eric Seidel.
     7
     8        Fix rounding of offset in paintIntoRegion to ensure that we paint on
     9        device pixel boundaries.
     10
     11        Covered by existing tests in fast/regions.
     12
     13        * platform/graphics/FractionalLayoutPoint.h:
     14        (WebCore::roundedIntPoint):
     15        Add roundedIntPoint(FractionalLayoutSize) function.
     16        (WebCore):
     17        * rendering/RenderFlowThread.cpp:
     18        (WebCore::RenderFlowThread::paintIntoRegion):
     19
    1202012-05-17  Andreas Kling  <kling@webkit.org>
    221
  • trunk/Source/WebCore/platform/graphics/FractionalLayoutPoint.h

    r116767 r117476  
    168168}
    169169
     170inline IntPoint roundedIntPoint(const FractionalLayoutSize& size)
     171{
     172    return IntPoint(size.width().round(), size.height().round());
     173}
     174
    170175inline IntPoint ceiledIntPoint(const FractionalLayoutPoint& point)
    171176{
  • trunk/Source/WebCore/rendering/RenderFlowThread.cpp

    r113842 r117476  
    293293        // from the region rect's current position. The amount of offset is equal to the location of
    294294        // region in flow coordinates.
    295         LayoutPoint renderFlowThreadOffset;
     295        IntPoint renderFlowThreadOffset;
    296296        if (style()->isFlippedBlocksWritingMode()) {
    297297            LayoutRect flippedRegionRect(regionRect);
    298298            flipForWritingMode(flippedRegionRect);
    299             renderFlowThreadOffset = LayoutPoint(paintOffset - flippedRegionRect.location());
     299            renderFlowThreadOffset = roundedIntPoint(paintOffset - flippedRegionRect.location());
    300300        } else
    301             renderFlowThreadOffset = LayoutPoint(paintOffset - regionRect.location());
     301            renderFlowThreadOffset = roundedIntPoint(paintOffset - regionRect.location());
    302302
    303303        context->translate(renderFlowThreadOffset.x(), renderFlowThreadOffset.y());
    304         info.rect.moveBy(-roundedIntPoint(renderFlowThreadOffset));
     304        info.rect.moveBy(-renderFlowThreadOffset);
    305305       
    306306        layer()->paint(context, info.rect, 0, 0, region, RenderLayer::PaintLayerTemporaryClipRects);
Note: See TracChangeset for help on using the changeset viewer.