Changeset 107461 in webkit


Ignore:
Timestamp:
Feb 10, 2012 4:58:22 PM (12 years ago)
Author:
leviw@chromium.org
Message:

Add pixelSnappedIntRect method
https://bugs.webkit.org/show_bug.cgi?id=78054

Reviewed by Eric Seidel.

This patch introduces a pixelSnappedIntRect method that will snap a sub-pixel LayoutRect to
pixel boundaries. These pixel snapped forms are what is used to communicate with the graphics
engine (to paint at whole pixel boundaries) and the embedding app (so they don't need to
understand we're using sub-pixel units).

No new tests. No change in behavior.

  • accessibility/AccessibilityRenderObject.cpp:

(WebCore::AccessibilityRenderObject::isOffScreen):
(WebCore::AccessibilityRenderObject::boundsForVisiblePositionRange):

  • dom/Range.cpp:

(WebCore::Range::boundingBox):

  • html/HTMLCanvasElement.cpp:

(WebCore::HTMLCanvasElement::paint):

  • html/shadow/TextControlInnerElements.cpp:

(WebCore::InputFieldSpeechButtonElement::startSpeechInput):

  • page/Frame.cpp:

(WebCore::Frame::nodeImage):

  • page/FrameView.cpp:

(WebCore::FrameView::repaintContentRectangle):
(WebCore::FrameView::doDeferredRepaints):
(WebCore::FrameView::windowClipRectForLayer):

  • platform/graphics/GraphicsLayer.cpp:

(WebCore::GraphicsLayer::paintGraphicsLayerContents):

  • rendering/InlineFlowBox.cpp:

(WebCore::InlineFlowBox::paint):

  • rendering/LayoutTypes.h:

(WebCore::pixelSnappedIntRect):
(WebCore):

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::paintColumnContents):
(WebCore::RenderBlock::selectionGaps):

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::paintBoxDecorations):
(WebCore::RenderBox::pushContentsClip):

  • rendering/RenderBoxModelObject.cpp:

(WebCore::RenderBoxModelObject::paintFillLayerExtended):
(WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
(WebCore::RenderBoxModelObject::drawBoxSideFromPath):
(WebCore::RenderBoxModelObject::paintBoxShadow):

  • rendering/RenderDetailsMarker.cpp:

(WebCore::RenderDetailsMarker::paint):

  • rendering/RenderFlowThread.cpp:

(WebCore::RenderFlowThread::paintIntoRegion):

  • rendering/RenderFrameSet.cpp:

(WebCore::RenderFrameSet::paintColumnBorder):
(WebCore::RenderFrameSet::paintRowBorder):
(WebCore::RenderFrameSet::positionFramesWithFlattening):

  • rendering/RenderImage.cpp:

(WebCore::RenderImage::paintReplaced):

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::scrollRectToVisible):
(WebCore::RenderLayer::positionOverflowControls):
(WebCore::RenderLayer::calculateRects):

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
(WebCore::paintScrollbar):

  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::calculateCompositedBounds):

  • rendering/RenderObject.cpp:

(WebCore::RenderObject::drawLineForBoxSide):
(WebCore::RenderObject::addPDFURLRect):

  • rendering/RenderTextControlSingleLine.cpp:

(WebCore::RenderTextControlSingleLine::showPopup):
(WebCore::RenderTextControlSingleLine::paint):

  • rendering/RenderWidget.cpp:

(WebCore::RenderWidget::paint):

  • rendering/style/RenderStyle.cpp:

(WebCore::RenderStyle::getRoundedBorderFor):
(WebCore::RenderStyle::getRoundedInnerBorderFor):

Location:
trunk/Source/WebCore
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r107460 r107461  
     12012-02-09  Levi Weintraub  <leviw@chromium.org>
     2
     3        Add pixelSnappedIntRect method
     4        https://bugs.webkit.org/show_bug.cgi?id=78054
     5
     6        Reviewed by Eric Seidel.
     7
     8        This patch introduces a pixelSnappedIntRect method that will snap a sub-pixel LayoutRect to
     9        pixel boundaries. These pixel snapped forms are what is used to communicate with the graphics
     10        engine (to paint at whole pixel boundaries) and the embedding app (so they don't need to
     11        understand we're using sub-pixel units).
     12
     13        No new tests. No change in behavior.
     14
     15        * accessibility/AccessibilityRenderObject.cpp:
     16        (WebCore::AccessibilityRenderObject::isOffScreen):
     17        (WebCore::AccessibilityRenderObject::boundsForVisiblePositionRange):
     18        * dom/Range.cpp:
     19        (WebCore::Range::boundingBox):
     20        * html/HTMLCanvasElement.cpp:
     21        (WebCore::HTMLCanvasElement::paint):
     22        * html/shadow/TextControlInnerElements.cpp:
     23        (WebCore::InputFieldSpeechButtonElement::startSpeechInput):
     24        * page/Frame.cpp:
     25        (WebCore::Frame::nodeImage):
     26        * page/FrameView.cpp:
     27        (WebCore::FrameView::repaintContentRectangle):
     28        (WebCore::FrameView::doDeferredRepaints):
     29        (WebCore::FrameView::windowClipRectForLayer):
     30        * platform/graphics/GraphicsLayer.cpp:
     31        (WebCore::GraphicsLayer::paintGraphicsLayerContents):
     32        * rendering/InlineFlowBox.cpp:
     33        (WebCore::InlineFlowBox::paint):
     34        * rendering/LayoutTypes.h:
     35        (WebCore::pixelSnappedIntRect):
     36        (WebCore):
     37        * rendering/RenderBlock.cpp:
     38        (WebCore::RenderBlock::paintColumnContents):
     39        (WebCore::RenderBlock::selectionGaps):
     40        * rendering/RenderBox.cpp:
     41        (WebCore::RenderBox::paintBoxDecorations):
     42        (WebCore::RenderBox::pushContentsClip):
     43        * rendering/RenderBoxModelObject.cpp:
     44        (WebCore::RenderBoxModelObject::paintFillLayerExtended):
     45        (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
     46        (WebCore::RenderBoxModelObject::drawBoxSideFromPath):
     47        (WebCore::RenderBoxModelObject::paintBoxShadow):
     48        * rendering/RenderDetailsMarker.cpp:
     49        (WebCore::RenderDetailsMarker::paint):
     50        * rendering/RenderFlowThread.cpp:
     51        (WebCore::RenderFlowThread::paintIntoRegion):
     52        * rendering/RenderFrameSet.cpp:
     53        (WebCore::RenderFrameSet::paintColumnBorder):
     54        (WebCore::RenderFrameSet::paintRowBorder):
     55        (WebCore::RenderFrameSet::positionFramesWithFlattening):
     56        * rendering/RenderImage.cpp:
     57        (WebCore::RenderImage::paintReplaced):
     58        * rendering/RenderLayer.cpp:
     59        (WebCore::RenderLayer::scrollRectToVisible):
     60        (WebCore::RenderLayer::positionOverflowControls):
     61        (WebCore::RenderLayer::calculateRects):
     62        * rendering/RenderLayerBacking.cpp:
     63        (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
     64        (WebCore::paintScrollbar):
     65        * rendering/RenderLayerCompositor.cpp:
     66        (WebCore::RenderLayerCompositor::calculateCompositedBounds):
     67        * rendering/RenderObject.cpp:
     68        (WebCore::RenderObject::drawLineForBoxSide):
     69        (WebCore::RenderObject::addPDFURLRect):
     70        * rendering/RenderTextControlSingleLine.cpp:
     71        (WebCore::RenderTextControlSingleLine::showPopup):
     72        (WebCore::RenderTextControlSingleLine::paint):
     73        * rendering/RenderWidget.cpp:
     74        (WebCore::RenderWidget::paint):
     75        * rendering/style/RenderStyle.cpp:
     76        (WebCore::RenderStyle::getRoundedBorderFor):
     77        (WebCore::RenderStyle::getRoundedInnerBorderFor):
     78
     79<<<<<<< .mine
     802012-02-09  Levi Weintraub  <leviw@chromium.org>
     81
     82        Add pixelSnappedIntRect method
     83        https://bugs.webkit.org/show_bug.cgi?id=78054
     84
     85        Reviewed by Eric Seidel.
     86
     87        This patch introduces a pixelSnappedIntRect method that will snap a sub-pixel LayoutRect to
     88        pixel boundaries. These pixel snapped forms are what is used to communicate with the graphics
     89        engine (to paint at whole pixel boundaries) and the embedding app (so they don't need to
     90        understand we're using sub-pixel units).
     91
     92        No new tests. No change in behavior.
     93
     94        * accessibility/AccessibilityRenderObject.cpp:
     95        (WebCore::AccessibilityRenderObject::isOffScreen):
     96        (WebCore::AccessibilityRenderObject::boundsForVisiblePositionRange):
     97        * dom/Range.cpp:
     98        (WebCore::Range::boundingBox):
     99        * html/HTMLCanvasElement.cpp:
     100        (WebCore::HTMLCanvasElement::paint):
     101        * html/shadow/TextControlInnerElements.cpp:
     102        (WebCore::InputFieldSpeechButtonElement::startSpeechInput):
     103        * page/Frame.cpp:
     104        (WebCore::Frame::nodeImage):
     105        * page/FrameView.cpp:
     106        (WebCore::FrameView::repaintContentRectangle):
     107        (WebCore::FrameView::doDeferredRepaints):
     108        (WebCore::FrameView::windowClipRectForLayer):
     109        * platform/graphics/GraphicsLayer.cpp:
     110        (WebCore::GraphicsLayer::paintGraphicsLayerContents):
     111        * rendering/InlineFlowBox.cpp:
     112        (WebCore::InlineFlowBox::paint):
     113        * rendering/LayoutTypes.h:
     114        (WebCore::pixelSnappedIntRect):
     115        (WebCore):
     116        * rendering/RenderBlock.cpp:
     117        (WebCore::RenderBlock::paintColumnContents):
     118        (WebCore::RenderBlock::selectionGaps):
     119        * rendering/RenderBox.cpp:
     120        (WebCore::RenderBox::paintBoxDecorations):
     121        (WebCore::RenderBox::pushContentsClip):
     122        * rendering/RenderBoxModelObject.cpp:
     123        (WebCore::RenderBoxModelObject::paintFillLayerExtended):
     124        (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
     125        (WebCore::RenderBoxModelObject::drawBoxSideFromPath):
     126        (WebCore::RenderBoxModelObject::paintBoxShadow):
     127        * rendering/RenderDetailsMarker.cpp:
     128        (WebCore::RenderDetailsMarker::paint):
     129        * rendering/RenderFlowThread.cpp:
     130        (WebCore::RenderFlowThread::paintIntoRegion):
     131        * rendering/RenderFrameSet.cpp:
     132        (WebCore::RenderFrameSet::paintColumnBorder):
     133        (WebCore::RenderFrameSet::paintRowBorder):
     134        (WebCore::RenderFrameSet::positionFramesWithFlattening):
     135        * rendering/RenderImage.cpp:
     136        (WebCore::RenderImage::paintReplaced):
     137        * rendering/RenderLayer.cpp:
     138        (WebCore::RenderLayer::scrollRectToVisible):
     139        (WebCore::RenderLayer::positionOverflowControls):
     140        (WebCore::RenderLayer::calculateRects):
     141        * rendering/RenderLayerBacking.cpp:
     142        (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
     143        (WebCore::paintScrollbar):
     144        * rendering/RenderLayerCompositor.cpp:
     145        (WebCore::RenderLayerCompositor::calculateCompositedBounds):
     146        * rendering/RenderObject.cpp:
     147        (WebCore::RenderObject::drawLineForBoxSide):
     148        (WebCore::RenderObject::addPDFURLRect):
     149        * rendering/RenderTextControlSingleLine.cpp:
     150        (WebCore::RenderTextControlSingleLine::showPopup):
     151        (WebCore::RenderTextControlSingleLine::paint):
     152        * rendering/RenderWidget.cpp:
     153        (WebCore::RenderWidget::paint):
     154        * rendering/style/RenderStyle.cpp:
     155        (WebCore::RenderStyle::getRoundedBorderFor):
     156        (WebCore::RenderStyle::getRoundedInnerBorderFor):
     157+
     158=======
    11592012-02-10  Brian Weinstein  <bweinstein@apple.com>
    2160
     
    50208        (WebCore::PopupMenuWin::scrollToRevealSelection):
    51209
     210>>>>>>> .r107459
    522112012-02-10  Adam Klein  <adamk@chromium.org>
    53212
  • trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp

    r107296 r107461  
    708708{
    709709    ASSERT(m_renderer);
    710     LayoutRect contentRect = m_renderer->absoluteClippedOverflowRect();
     710    IntRect contentRect = pixelSnappedIntRect(m_renderer->absoluteClippedOverflowRect());
    711711    FrameView* view = m_renderer->frame()->view();
    712712    IntRect viewRect = view->visibleContentRect();
     
    26312631   
    26322632#if PLATFORM(MAC)
    2633     return m_renderer->document()->view()->contentsToScreen(ourrect);
     2633    return m_renderer->document()->view()->contentsToScreen(pixelSnappedIntRect(ourrect));
    26342634#else
    2635     return ourrect;
     2635    return pixelSnappedIntRect(ourrect);
    26362636#endif
    26372637}
  • trunk/Source/WebCore/dom/Range.cpp

    r105649 r107461  
    16791679    for (size_t i = 0; i < n; ++i)
    16801680        result.unite(rects[i]);
    1681     return result;
     1681    return pixelSnappedIntRect(result);
    16821682}
    16831683
  • trunk/Source/WebCore/html/HTMLCanvasElement.cpp

    r106772 r107461  
    283283        if (imageBuffer) {
    284284            if (m_presentedImage)
    285                 context->drawImage(m_presentedImage.get(), ColorSpaceDeviceRGB, r, CompositeSourceOver, useLowQualityScale);
     285                context->drawImage(m_presentedImage.get(), ColorSpaceDeviceRGB, pixelSnappedIntRect(r), CompositeSourceOver, useLowQualityScale);
    286286            else
    287                 context->drawImageBuffer(imageBuffer, ColorSpaceDeviceRGB, r, CompositeSourceOver, useLowQualityScale);
     287                context->drawImageBuffer(imageBuffer, ColorSpaceDeviceRGB, pixelSnappedIntRect(r), CompositeSourceOver, useLowQualityScale);
    288288        }
    289289    }
  • trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp

    r106438 r107461  
    551551    String grammar = input->getAttribute(webkitgrammarAttr);
    552552    // FIXME: this should probably respect transforms
    553     IntRect rect = renderer()->view()->frameView()->contentsToWindow(renderer()->absoluteBoundingBoxRectIgnoringTransforms());
     553    IntRect rect = pixelSnappedIntRect(renderer()->view()->frameView()->contentsToWindow(renderer()->absoluteBoundingBoxRectIgnoringTransforms()));
    554554    if (speechInput()->startRecognition(m_listenerId, rect, language, grammar, document()->securityOrigin()))
    555555        setState(Recording);
  • trunk/Source/WebCore/page/FrameView.cpp

    r107366 r107461  
    17901790            IntRect unionedRect;
    17911791            for (unsigned i = 0; i < cRepaintRectUnionThreshold; ++i)
    1792                 unionedRect.unite(m_repaintRects[i]);
     1792                unionedRect.unite(pixelSnappedIntRect(m_repaintRects[i]));
    17931793            m_repaintRects.clear();
    17941794            m_repaintRects.append(unionedRect);
     
    19051905#if USE(TILED_BACKING_STORE)
    19061906        if (frame()->tiledBackingStore()) {
    1907             frame()->tiledBackingStore()->invalidate(m_repaintRects[i]);
     1907            frame()->tiledBackingStore()->invalidate(pixelSnappedIntRect(m_repaintRects[i]));
    19081908            continue;
    19091909        }
    19101910#endif
    1911         ScrollView::repaintContentRectangle(m_repaintRects[i], false);
     1911        ScrollView::repaintContentRectangle(pixelSnappedIntRect(m_repaintRects[i]), false);
    19121912    }
    19131913    m_repaintRects.clear();
  • trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp

    r107422 r107461  
    299299        clipRect.move(offset);
    300300
    301         m_client->paintContents(this, context, m_paintingPhase, clipRect);
     301        m_client->paintContents(this, context, m_paintingPhase, pixelSnappedIntRect(clipRect));
    302302    }
    303303#ifndef NDEBUG
  • trunk/Source/WebCore/rendering/InlineFlowBox.cpp

    r103772 r107461  
    10091009    overflowRect.moveBy(paintOffset);
    10101010   
    1011     if (!paintInfo.rect.intersects(overflowRect))
     1011    if (!paintInfo.rect.intersects(pixelSnappedIntRect(overflowRect)))
    10121012        return;
    10131013
  • trunk/Source/WebCore/rendering/LayoutTypes.h

    r107366 r107461  
    5050{
    5151    return enclosingIntRect(rect);
     52}
     53
     54inline IntRect pixelSnappedIntRect(const LayoutRect& rect)
     55{
     56    return rect;
    5257}
    5358
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r107296 r107461  
    25412541        colRect.moveBy(paintOffset);
    25422542        PaintInfo info(paintInfo);
    2543         info.rect.intersect(colRect);
     2543        info.rect.intersect(pixelSnappedIntRect(colRect));
    25442544       
    25452545        if (!info.rect.isEmpty()) {
     
    30203020                rootBlock->flipForWritingMode(floatBox);
    30213021                floatBox.move(rootBlockPhysicalPosition.x(), rootBlockPhysicalPosition.y());
    3022                 paintInfo->context->clipOut(floatBox);
     3022                paintInfo->context->clipOut(pixelSnappedIntRect(floatBox));
    30233023            }
    30243024        }
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r107032 r107461  
    942942
    943943        if (style()->hasAppearance())
    944             theme()->paintDecorations(this, paintInfo, paintRect);
     944            theme()->paintDecorations(this, paintInfo, pixelSnappedIntRect(paintRect));
    945945    }
    946946    paintBoxShadow(paintInfo, paintRect, style(), Inset);
    947947
    948948    // The theme will tell us whether or not we should also paint the CSS border.
    949     if ((!style()->hasAppearance() || (!themePainted && theme()->paintBorderOnly(this, paintInfo, paintRect))) && style()->hasBorder())
     949    if ((!style()->hasAppearance() || (!themePainted && theme()->paintBorderOnly(this, paintInfo, pixelSnappedIntRect(paintRect)))) && style()->hasBorder())
    950950        paintBorder(paintInfo, paintRect, style(), bleedAvoidance);
    951951
     
    11871187        paintInfo.phase = PaintPhaseChildBlockBackgrounds;
    11881188    }
    1189     IntRect clipRect(isControlClip ? controlClipRect(accumulatedOffset) : overflowClipRect(accumulatedOffset, paintInfo.renderRegion));
     1189    IntRect clipRect = pixelSnappedIntRect(isControlClip ? controlClipRect(accumulatedOffset) : overflowClipRect(accumulatedOffset, paintInfo.renderRegion));
    11901190    paintInfo.context->save();
    11911191    if (style()->hasBorderRadius())
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp

    r107032 r107461  
    674674            context->fillRoundedRect(border, bgColor, style()->colorSpace());
    675675        } else
    676             context->fillRect(rect, bgColor, style()->colorSpace());
     676            context->fillRect(pixelSnappedIntRect(rect), bgColor, style()->colorSpace());
    677677       
    678678        return;
     
    718718        // First figure out how big the mask has to be.  It should be no bigger than what we need
    719719        // to actually render, so we should intersect the dirty rect with the border box of the background.
    720         LayoutRect maskRect = rect;
     720        IntRect maskRect = pixelSnappedIntRect(rect);
    721721        maskRect.intersect(paintInfo.rect);
    722722       
     
    778778    // Paint the color first underneath all images.
    779779    if (!bgLayer->next()) {
    780         LayoutRect backgroundRect(scrolledPaintRect);
     780        IntRect backgroundRect(pixelSnappedIntRect(scrolledPaintRect));
    781781        backgroundRect.intersect(paintInfo.rect);
    782782        // If we have an alpha and we are painting the root element, go ahead and blend with the base background color.
     
    10651065            positioningAreaSize = LayoutSize(paintRect.width() - left - right, paintRect.height() - top - bottom);
    10661066    } else {
    1067         geometry.setDestRect(viewRect());
     1067        geometry.setDestRect(pixelSnappedIntRect(viewRect()));
    10681068        positioningAreaSize = geometry.destRect().size();
    10691069    }
     
    19341934    graphicsContext->setStrokeStyle(NoStroke);
    19351935    graphicsContext->setFillColor(color, style->colorSpace());
    1936     graphicsContext->drawRect(borderRect);
     1936    graphicsContext->drawRect(pixelSnappedIntRect(borderRect));
    19371937}
    19381938#else
     
    26352635                    context->clipOutRoundedRect(rectToClipOut);
    26362636
    2637                 RoundedRect influenceRect(shadowRect, border.radii());
     2637                RoundedRect influenceRect(pixelSnappedIntRect(shadowRect), border.radii());
    26382638                influenceRect.expandRadii(2 * shadowBlur + shadowSpread);
    26392639                if (allCornersClippedOut(influenceRect, info.rect))
     
    26592659
    26602660                if (!rectToClipOut.isEmpty())
    2661                     context->clipOut(rectToClipOut);
     2661                    context->clipOut(pixelSnappedIntRect(rectToClipOut));
    26622662                context->fillRect(fillRect.rect(), Color::black, s->colorSpace());
    26632663            }
     
    26942694
    26952695            LayoutRect outerRect = areaCastingShadowInHole(border.rect(), shadowBlur, shadowSpread, shadowOffset);
    2696             RoundedRect roundedHole(holeRect, border.radii());
     2696            RoundedRect roundedHole(pixelSnappedIntRect(holeRect), border.radii());
    26972697
    26982698            GraphicsContextStateSaver stateSaver(*context);
     
    27142714                context->setShadow(shadowOffset, shadowBlur, shadowColor, s->colorSpace());
    27152715
    2716             context->fillRectWithRoundedHole(outerRect, roundedHole, fillColor, s->colorSpace());
     2716            context->fillRectWithRoundedHole(pixelSnappedIntRect(outerRect), roundedHole, fillColor, s->colorSpace());
    27172717        }
    27182718    }
  • trunk/Source/WebCore/rendering/RenderDetailsMarker.cpp

    r95901 r107461  
    133133    overflowRect.inflate(maximalOutlineSize(paintInfo.phase));
    134134
    135     if (!paintInfo.rect.intersects(overflowRect))
     135    if (!paintInfo.rect.intersects(pixelSnappedIntRect(overflowRect)))
    136136        return;
    137137
  • trunk/Source/WebCore/rendering/RenderFlowThread.cpp

    r107296 r107461  
    446446
    447447    PaintInfo info(paintInfo);
    448     info.rect.intersect(regionClippingRect);
     448    info.rect.intersect(pixelSnappedIntRect(regionClippingRect));
    449449
    450450    if (!info.rect.isEmpty()) {
  • trunk/Source/WebCore/rendering/RenderFrameSet.cpp

    r107296 r107461  
    8383void RenderFrameSet::paintColumnBorder(const PaintInfo& paintInfo, const LayoutRect& borderRect)
    8484{
    85     if (!paintInfo.rect.intersects(borderRect))
     85    if (!paintInfo.rect.intersects(pixelSnappedIntRect(borderRect)))
    8686        return;
    8787       
     
    103103void RenderFrameSet::paintRowBorder(const PaintInfo& paintInfo, const LayoutRect& borderRect)
    104104{
    105     if (!paintInfo.rect.intersects(borderRect))
     105    if (!paintInfo.rect.intersects(pixelSnappedIntRect(borderRect)))
    106106        return;
    107107
     
    572572
    573573        for (int c = 0; c < cols; c++) {
    574             IntRect oldFrameRect = child->frameRect();
     574            IntRect oldFrameRect = pixelSnappedIntRect(child->frameRect());
    575575
    576576            int width = m_cols.m_sizes[c];
     
    620620        for (int c = 0; c < cols; c++) {
    621621            // ensure the rows and columns are filled
    622             IntRect oldRect = child->frameRect();
     622            IntRect oldRect = pixelSnappedIntRect(child->frameRect());
    623623
    624624            child->setLocation(IntPoint(xPos, yPos));
  • trunk/Source/WebCore/rendering/RenderImage.cpp

    r107296 r107461  
    274274            context->setStrokeColor(Color::lightGray, style()->colorSpace());
    275275            context->setFillColor(Color::transparent, style()->colorSpace());
    276             context->drawRect(LayoutRect(paintOffset.x() + leftBorder + leftPad, paintOffset.y() + topBorder + topPad, cWidth, cHeight));
     276            context->drawRect(pixelSnappedIntRect(LayoutRect(paintOffset.x() + leftBorder + leftPad, paintOffset.y() + topBorder + topPad, cWidth, cHeight)));
    277277
    278278            bool errorPictureDrawn = false;
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r107296 r107461  
    15881588                if (Frame* frame = frameView->frame()) {
    15891589                    if (Page* page = frame->page())
    1590                         page->chrome()->scrollRectIntoView(rect);
     1590                        page->chrome()->scrollRectIntoView(pixelSnappedIntRect(rect));
    15911591                }
    15921592            }
     
    21552155        return;
    21562156
    2157     const IntRect borderBox = box->borderBoxRect();
     2157    const IntRect borderBox = pixelSnappedIntRect(box->borderBoxRect());
    21582158    const IntRect& scrollCorner = scrollCornerRect();
    21592159    IntRect absBounds(borderBox.location() + offsetFromLayer, borderBox.size());
     
    37483748        } else {
    37493749            // Shift the bounds to be for our region only.
    3750             LayoutRect bounds = renderBox()->borderBoxRectInRegion(region);
     3750            LayoutRect bounds = pixelSnappedIntRect(renderBox()->borderBoxRectInRegion(region));
    37513751            bounds.moveBy(offset);
    37523752            backgroundRect.intersect(bounds);
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r107422 r107461  
    417417   
    418418    // We compute everything relative to the enclosing compositing layer.
    419     LayoutRect ancestorCompositingBounds;
     419    IntRect ancestorCompositingBounds;
    420420    if (compAncestor) {
    421421        ASSERT(compAncestor->backing());
    422         ancestorCompositingBounds = compAncestor->backing()->compositedBounds();
    423     }
    424 
    425     LayoutRect localCompositingBounds = compositedBounds();
    426 
    427     LayoutRect relativeCompositingBounds(localCompositingBounds);
    428     LayoutPoint delta;
     422        ancestorCompositingBounds = pixelSnappedIntRect(compAncestor->backing()->compositedBounds());
     423    }
     424
     425    IntRect localCompositingBounds = pixelSnappedIntRect(compositedBounds());
     426
     427    IntRect relativeCompositingBounds(localCompositingBounds);
     428    IntPoint delta;
    429429    m_owningLayer->convertToLayerCoords(compAncestor, delta);
    430430    relativeCompositingBounds.moveBy(delta);
     
    434434        // If the compositing ancestor has a layer to clip children, we parent in that, and therefore
    435435        // position relative to it.
    436         LayoutRect clippingBox = clipBox(toRenderBox(compAncestor->renderer()));
     436        IntRect clippingBox = pixelSnappedIntRect(clipBox(toRenderBox(compAncestor->renderer())));
    437437        graphicsLayerParentLocation = clippingBox.location();
    438438    } else if (compAncestor)
     
    445445        // layer. Note that we call it with temporaryClipRects = true because normally when computing clip rects
    446446        // for a compositing layer, rootLayer is the layer itself.
    447         LayoutRect parentClipRect = m_owningLayer->backgroundClipRect(compAncestor, 0, true).rect(); // FIXME: Incorrect for CSS regions.
     447        IntRect parentClipRect = pixelSnappedIntRect(m_owningLayer->backgroundClipRect(compAncestor, 0, true).rect()); // FIXME: Incorrect for CSS regions.
    448448        ASSERT(parentClipRect != PaintInfo::infiniteRect());
    449449        m_ancestorClippingLayer->setPosition(FloatPoint() + (parentClipRect.location() - graphicsLayerParentLocation));
     
    458458
    459459    m_graphicsLayer->setPosition(FloatPoint() + (relativeCompositingBounds.location() - graphicsLayerParentLocation));
    460     m_graphicsLayer->setOffsetFromRenderer(localCompositingBounds.location() - LayoutPoint());
     460    m_graphicsLayer->setOffsetFromRenderer(localCompositingBounds.location() - IntPoint());
    461461   
    462462    FloatSize oldSize = m_graphicsLayer->size();
     
    471471
    472472    // If we have a layer that clips children, position it.
    473     LayoutRect clippingBox;
     473    IntRect clippingBox;
    474474    if (m_clippingLayer) {
    475         clippingBox = clipBox(toRenderBox(renderer()));
     475        clippingBox = pixelSnappedIntRect(clipBox(toRenderBox(renderer())));
    476476        m_clippingLayer->setPosition(FloatPoint() + (clippingBox.location() - localCompositingBounds.location()));
    477477        m_clippingLayer->setSize(clippingBox.size());
     
    489489   
    490490    if (m_owningLayer->hasTransform()) {
    491         const LayoutRect borderBox = toRenderBox(renderer())->borderBoxRect();
     491        const IntRect borderBox = pixelSnappedIntRect(toRenderBox(renderer())->borderBoxRect());
    492492
    493493        // Get layout bounds in the coords of compAncestor to match relativeCompositingBounds.
    494         LayoutRect layerBounds = LayoutRect(delta, borderBox.size());
     494        IntRect layerBounds = IntRect(delta, borderBox.size());
    495495
    496496        // Update properties that depend on layer dimensions
     
    525525        FloatPoint foregroundPosition;
    526526        FloatSize foregroundSize = newSize;
    527         LayoutSize foregroundOffset = m_graphicsLayer->offsetFromRenderer();
     527        IntSize foregroundOffset = m_graphicsLayer->offsetFromRenderer();
    528528        if (m_clippingLayer) {
    529529            // If we have a clipping layer (which clips descendants), then the foreground layer is a child of it,
    530530            // so that it gets correctly sorted with children. In that case, position relative to the clipping layer.
    531531            foregroundSize = FloatSize(clippingBox.size());
    532             foregroundOffset = clippingBox.location() - LayoutPoint();
     532            foregroundOffset = clippingBox.location() - IntPoint();
    533533        }
    534534
     
    549549    }
    550550
    551     m_graphicsLayer->setContentsRect(contentsBox());
     551    m_graphicsLayer->setContentsRect(pixelSnappedIntRect(contentsBox()));
    552552    updateDrawsContent();
    553553    updateAfterWidgetResize();
     
    11351135    LayoutRect transformedClip = clip;
    11361136    transformedClip.moveBy(scrollbarRect.location());
    1137     scrollbar->paint(&context, transformedClip);
     1137    scrollbar->paint(&context, pixelSnappedIntRect(transformedClip));
    11381138    context.restore();
    11391139}
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r107364 r107461  
    482482        layer->convertToLayerCoords(ancestorLayer, ancestorRelOffset);
    483483        boundingBoxRect.moveBy(ancestorRelOffset);
    484         return boundingBoxRect;
     484        return pixelSnappedIntRect(boundingBoxRect);
    485485    }
    486486
     
    537537    unionBounds.moveBy(ancestorRelOffset);
    538538
    539     return unionBounds;
     539    return pixelSnappedIntRect(unionBounds);
    540540}
    541541
  • trunk/Source/WebCore/rendering/RenderObject.cpp

    r106281 r107461  
    966966                bool wasAntialiased = graphicsContext->shouldAntialias();
    967967                graphicsContext->setShouldAntialias(antialias);
    968                 graphicsContext->drawRect(IntRect(x1, y1, x2 - x1, y2 - y1));
     968                graphicsContext->drawRect(pixelSnappedIntRect(LayoutRect(x1, y1, x2 - x1, y2 - y1)));
    969969                graphicsContext->setShouldAntialias(wasAntialiased);
    970970                graphicsContext->setStrokeStyle(oldStrokeStyle);
     
    11111111    if (href.isNull())
    11121112        return;
    1113     context->setURLForRect(n->document()->completeURL(href), rect);
     1113    context->setURLForRect(n->document()->completeURL(href), pixelSnappedIntRect(rect));
    11141114}
    11151115
  • trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp

    r106880 r107461  
    176176    }
    177177
    178     m_searchPopup->popupMenu()->show(absoluteBoundingBoxRect(), document()->view(), -1);
     178    m_searchPopup->popupMenu()->show(pixelSnappedIntRect(absoluteBoundingBoxRect()), document()->view(), -1);
    179179}
    180180
     
    197197        // Convert the rect into the coords used for painting the content
    198198        contentsRect.moveBy(paintOffset + location());
    199         theme()->paintCapsLockIndicator(this, paintInfo, contentsRect);
     199        theme()->paintCapsLockIndicator(this, paintInfo, pixelSnappedIntRect(contentsRect));
    200200    }
    201201}
  • trunk/Source/WebCore/rendering/RenderWidget.cpp

    r98304 r107461  
    309309    if (isSelected() && !document()->printing()) {
    310310        // FIXME: selectionRect() is in absolute, not painting coordinates.
    311         paintInfo.context->fillRect(selectionRect(), selectionBackgroundColor(), style()->colorSpace());
     311        paintInfo.context->fillRect(pixelSnappedIntRect(selectionRect()), selectionBackgroundColor(), style()->colorSpace());
    312312    }
    313313}
  • trunk/Source/WebCore/rendering/style/RenderStyle.cpp

    r107289 r107461  
    887887RoundedRect RenderStyle::getRoundedBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const
    888888{
    889     RoundedRect roundedRect(borderRect);
     889    RoundedRect roundedRect(pixelSnappedIntRect(borderRect));
    890890    if (hasBorderRadius()) {
    891891        RoundedRect::Radii radii = calcRadiiFor(surround->border, borderRect.size());
     
    916916               borderRect.height() - topWidth - bottomWidth);
    917917
    918     RoundedRect roundedRect(innerRect);
     918    RoundedRect roundedRect(pixelSnappedIntRect(innerRect));
    919919
    920920    if (hasBorderRadius()) {
Note: See TracChangeset for help on using the changeset viewer.