Changeset 107461 in webkit
- Timestamp:
- Feb 10, 2012 4:58:22 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r107460 r107461 1 2012-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 80 2012-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 ======= 1 159 2012-02-10 Brian Weinstein <bweinstein@apple.com> 2 160 … … 50 208 (WebCore::PopupMenuWin::scrollToRevealSelection): 51 209 210 >>>>>>> .r107459 52 211 2012-02-10 Adam Klein <adamk@chromium.org> 53 212 -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
r107296 r107461 708 708 { 709 709 ASSERT(m_renderer); 710 LayoutRect contentRect = m_renderer->absoluteClippedOverflowRect();710 IntRect contentRect = pixelSnappedIntRect(m_renderer->absoluteClippedOverflowRect()); 711 711 FrameView* view = m_renderer->frame()->view(); 712 712 IntRect viewRect = view->visibleContentRect(); … … 2631 2631 2632 2632 #if PLATFORM(MAC) 2633 return m_renderer->document()->view()->contentsToScreen( ourrect);2633 return m_renderer->document()->view()->contentsToScreen(pixelSnappedIntRect(ourrect)); 2634 2634 #else 2635 return ourrect;2635 return pixelSnappedIntRect(ourrect); 2636 2636 #endif 2637 2637 } -
trunk/Source/WebCore/dom/Range.cpp
r105649 r107461 1679 1679 for (size_t i = 0; i < n; ++i) 1680 1680 result.unite(rects[i]); 1681 return result;1681 return pixelSnappedIntRect(result); 1682 1682 } 1683 1683 -
trunk/Source/WebCore/html/HTMLCanvasElement.cpp
r106772 r107461 283 283 if (imageBuffer) { 284 284 if (m_presentedImage) 285 context->drawImage(m_presentedImage.get(), ColorSpaceDeviceRGB, r, CompositeSourceOver, useLowQualityScale);285 context->drawImage(m_presentedImage.get(), ColorSpaceDeviceRGB, pixelSnappedIntRect(r), CompositeSourceOver, useLowQualityScale); 286 286 else 287 context->drawImageBuffer(imageBuffer, ColorSpaceDeviceRGB, r, CompositeSourceOver, useLowQualityScale);287 context->drawImageBuffer(imageBuffer, ColorSpaceDeviceRGB, pixelSnappedIntRect(r), CompositeSourceOver, useLowQualityScale); 288 288 } 289 289 } -
trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp
r106438 r107461 551 551 String grammar = input->getAttribute(webkitgrammarAttr); 552 552 // 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())); 554 554 if (speechInput()->startRecognition(m_listenerId, rect, language, grammar, document()->securityOrigin())) 555 555 setState(Recording); -
trunk/Source/WebCore/page/FrameView.cpp
r107366 r107461 1790 1790 IntRect unionedRect; 1791 1791 for (unsigned i = 0; i < cRepaintRectUnionThreshold; ++i) 1792 unionedRect.unite( m_repaintRects[i]);1792 unionedRect.unite(pixelSnappedIntRect(m_repaintRects[i])); 1793 1793 m_repaintRects.clear(); 1794 1794 m_repaintRects.append(unionedRect); … … 1905 1905 #if USE(TILED_BACKING_STORE) 1906 1906 if (frame()->tiledBackingStore()) { 1907 frame()->tiledBackingStore()->invalidate( m_repaintRects[i]);1907 frame()->tiledBackingStore()->invalidate(pixelSnappedIntRect(m_repaintRects[i])); 1908 1908 continue; 1909 1909 } 1910 1910 #endif 1911 ScrollView::repaintContentRectangle( m_repaintRects[i], false);1911 ScrollView::repaintContentRectangle(pixelSnappedIntRect(m_repaintRects[i]), false); 1912 1912 } 1913 1913 m_repaintRects.clear(); -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp
r107422 r107461 299 299 clipRect.move(offset); 300 300 301 m_client->paintContents(this, context, m_paintingPhase, clipRect);301 m_client->paintContents(this, context, m_paintingPhase, pixelSnappedIntRect(clipRect)); 302 302 } 303 303 #ifndef NDEBUG -
trunk/Source/WebCore/rendering/InlineFlowBox.cpp
r103772 r107461 1009 1009 overflowRect.moveBy(paintOffset); 1010 1010 1011 if (!paintInfo.rect.intersects( overflowRect))1011 if (!paintInfo.rect.intersects(pixelSnappedIntRect(overflowRect))) 1012 1012 return; 1013 1013 -
trunk/Source/WebCore/rendering/LayoutTypes.h
r107366 r107461 50 50 { 51 51 return enclosingIntRect(rect); 52 } 53 54 inline IntRect pixelSnappedIntRect(const LayoutRect& rect) 55 { 56 return rect; 52 57 } 53 58 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r107296 r107461 2541 2541 colRect.moveBy(paintOffset); 2542 2542 PaintInfo info(paintInfo); 2543 info.rect.intersect( colRect);2543 info.rect.intersect(pixelSnappedIntRect(colRect)); 2544 2544 2545 2545 if (!info.rect.isEmpty()) { … … 3020 3020 rootBlock->flipForWritingMode(floatBox); 3021 3021 floatBox.move(rootBlockPhysicalPosition.x(), rootBlockPhysicalPosition.y()); 3022 paintInfo->context->clipOut( floatBox);3022 paintInfo->context->clipOut(pixelSnappedIntRect(floatBox)); 3023 3023 } 3024 3024 } -
trunk/Source/WebCore/rendering/RenderBox.cpp
r107032 r107461 942 942 943 943 if (style()->hasAppearance()) 944 theme()->paintDecorations(this, paintInfo, p aintRect);944 theme()->paintDecorations(this, paintInfo, pixelSnappedIntRect(paintRect)); 945 945 } 946 946 paintBoxShadow(paintInfo, paintRect, style(), Inset); 947 947 948 948 // The theme will tell us whether or not we should also paint the CSS border. 949 if ((!style()->hasAppearance() || (!themePainted && theme()->paintBorderOnly(this, paintInfo, p aintRect))) && style()->hasBorder())949 if ((!style()->hasAppearance() || (!themePainted && theme()->paintBorderOnly(this, paintInfo, pixelSnappedIntRect(paintRect)))) && style()->hasBorder()) 950 950 paintBorder(paintInfo, paintRect, style(), bleedAvoidance); 951 951 … … 1187 1187 paintInfo.phase = PaintPhaseChildBlockBackgrounds; 1188 1188 } 1189 IntRect clipRect (isControlClip ? controlClipRect(accumulatedOffset) : overflowClipRect(accumulatedOffset, paintInfo.renderRegion));1189 IntRect clipRect = pixelSnappedIntRect(isControlClip ? controlClipRect(accumulatedOffset) : overflowClipRect(accumulatedOffset, paintInfo.renderRegion)); 1190 1190 paintInfo.context->save(); 1191 1191 if (style()->hasBorderRadius()) -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r107032 r107461 674 674 context->fillRoundedRect(border, bgColor, style()->colorSpace()); 675 675 } else 676 context->fillRect( rect, bgColor, style()->colorSpace());676 context->fillRect(pixelSnappedIntRect(rect), bgColor, style()->colorSpace()); 677 677 678 678 return; … … 718 718 // First figure out how big the mask has to be. It should be no bigger than what we need 719 719 // 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); 721 721 maskRect.intersect(paintInfo.rect); 722 722 … … 778 778 // Paint the color first underneath all images. 779 779 if (!bgLayer->next()) { 780 LayoutRect backgroundRect(scrolledPaintRect);780 IntRect backgroundRect(pixelSnappedIntRect(scrolledPaintRect)); 781 781 backgroundRect.intersect(paintInfo.rect); 782 782 // If we have an alpha and we are painting the root element, go ahead and blend with the base background color. … … 1065 1065 positioningAreaSize = LayoutSize(paintRect.width() - left - right, paintRect.height() - top - bottom); 1066 1066 } else { 1067 geometry.setDestRect( viewRect());1067 geometry.setDestRect(pixelSnappedIntRect(viewRect())); 1068 1068 positioningAreaSize = geometry.destRect().size(); 1069 1069 } … … 1934 1934 graphicsContext->setStrokeStyle(NoStroke); 1935 1935 graphicsContext->setFillColor(color, style->colorSpace()); 1936 graphicsContext->drawRect( borderRect);1936 graphicsContext->drawRect(pixelSnappedIntRect(borderRect)); 1937 1937 } 1938 1938 #else … … 2635 2635 context->clipOutRoundedRect(rectToClipOut); 2636 2636 2637 RoundedRect influenceRect( shadowRect, border.radii());2637 RoundedRect influenceRect(pixelSnappedIntRect(shadowRect), border.radii()); 2638 2638 influenceRect.expandRadii(2 * shadowBlur + shadowSpread); 2639 2639 if (allCornersClippedOut(influenceRect, info.rect)) … … 2659 2659 2660 2660 if (!rectToClipOut.isEmpty()) 2661 context->clipOut( rectToClipOut);2661 context->clipOut(pixelSnappedIntRect(rectToClipOut)); 2662 2662 context->fillRect(fillRect.rect(), Color::black, s->colorSpace()); 2663 2663 } … … 2694 2694 2695 2695 LayoutRect outerRect = areaCastingShadowInHole(border.rect(), shadowBlur, shadowSpread, shadowOffset); 2696 RoundedRect roundedHole( holeRect, border.radii());2696 RoundedRect roundedHole(pixelSnappedIntRect(holeRect), border.radii()); 2697 2697 2698 2698 GraphicsContextStateSaver stateSaver(*context); … … 2714 2714 context->setShadow(shadowOffset, shadowBlur, shadowColor, s->colorSpace()); 2715 2715 2716 context->fillRectWithRoundedHole( outerRect, roundedHole, fillColor, s->colorSpace());2716 context->fillRectWithRoundedHole(pixelSnappedIntRect(outerRect), roundedHole, fillColor, s->colorSpace()); 2717 2717 } 2718 2718 } -
trunk/Source/WebCore/rendering/RenderDetailsMarker.cpp
r95901 r107461 133 133 overflowRect.inflate(maximalOutlineSize(paintInfo.phase)); 134 134 135 if (!paintInfo.rect.intersects( overflowRect))135 if (!paintInfo.rect.intersects(pixelSnappedIntRect(overflowRect))) 136 136 return; 137 137 -
trunk/Source/WebCore/rendering/RenderFlowThread.cpp
r107296 r107461 446 446 447 447 PaintInfo info(paintInfo); 448 info.rect.intersect( regionClippingRect);448 info.rect.intersect(pixelSnappedIntRect(regionClippingRect)); 449 449 450 450 if (!info.rect.isEmpty()) { -
trunk/Source/WebCore/rendering/RenderFrameSet.cpp
r107296 r107461 83 83 void RenderFrameSet::paintColumnBorder(const PaintInfo& paintInfo, const LayoutRect& borderRect) 84 84 { 85 if (!paintInfo.rect.intersects( borderRect))85 if (!paintInfo.rect.intersects(pixelSnappedIntRect(borderRect))) 86 86 return; 87 87 … … 103 103 void RenderFrameSet::paintRowBorder(const PaintInfo& paintInfo, const LayoutRect& borderRect) 104 104 { 105 if (!paintInfo.rect.intersects( borderRect))105 if (!paintInfo.rect.intersects(pixelSnappedIntRect(borderRect))) 106 106 return; 107 107 … … 572 572 573 573 for (int c = 0; c < cols; c++) { 574 IntRect oldFrameRect = child->frameRect();574 IntRect oldFrameRect = pixelSnappedIntRect(child->frameRect()); 575 575 576 576 int width = m_cols.m_sizes[c]; … … 620 620 for (int c = 0; c < cols; c++) { 621 621 // ensure the rows and columns are filled 622 IntRect oldRect = child->frameRect();622 IntRect oldRect = pixelSnappedIntRect(child->frameRect()); 623 623 624 624 child->setLocation(IntPoint(xPos, yPos)); -
trunk/Source/WebCore/rendering/RenderImage.cpp
r107296 r107461 274 274 context->setStrokeColor(Color::lightGray, style()->colorSpace()); 275 275 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))); 277 277 278 278 bool errorPictureDrawn = false; -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r107296 r107461 1588 1588 if (Frame* frame = frameView->frame()) { 1589 1589 if (Page* page = frame->page()) 1590 page->chrome()->scrollRectIntoView( rect);1590 page->chrome()->scrollRectIntoView(pixelSnappedIntRect(rect)); 1591 1591 } 1592 1592 } … … 2155 2155 return; 2156 2156 2157 const IntRect borderBox = box->borderBoxRect();2157 const IntRect borderBox = pixelSnappedIntRect(box->borderBoxRect()); 2158 2158 const IntRect& scrollCorner = scrollCornerRect(); 2159 2159 IntRect absBounds(borderBox.location() + offsetFromLayer, borderBox.size()); … … 3748 3748 } else { 3749 3749 // Shift the bounds to be for our region only. 3750 LayoutRect bounds = renderBox()->borderBoxRectInRegion(region);3750 LayoutRect bounds = pixelSnappedIntRect(renderBox()->borderBoxRectInRegion(region)); 3751 3751 bounds.moveBy(offset); 3752 3752 backgroundRect.intersect(bounds); -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r107422 r107461 417 417 418 418 // We compute everything relative to the enclosing compositing layer. 419 LayoutRect ancestorCompositingBounds;419 IntRect ancestorCompositingBounds; 420 420 if (compAncestor) { 421 421 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; 429 429 m_owningLayer->convertToLayerCoords(compAncestor, delta); 430 430 relativeCompositingBounds.moveBy(delta); … … 434 434 // If the compositing ancestor has a layer to clip children, we parent in that, and therefore 435 435 // position relative to it. 436 LayoutRect clippingBox = clipBox(toRenderBox(compAncestor->renderer()));436 IntRect clippingBox = pixelSnappedIntRect(clipBox(toRenderBox(compAncestor->renderer()))); 437 437 graphicsLayerParentLocation = clippingBox.location(); 438 438 } else if (compAncestor) … … 445 445 // layer. Note that we call it with temporaryClipRects = true because normally when computing clip rects 446 446 // 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. 448 448 ASSERT(parentClipRect != PaintInfo::infiniteRect()); 449 449 m_ancestorClippingLayer->setPosition(FloatPoint() + (parentClipRect.location() - graphicsLayerParentLocation)); … … 458 458 459 459 m_graphicsLayer->setPosition(FloatPoint() + (relativeCompositingBounds.location() - graphicsLayerParentLocation)); 460 m_graphicsLayer->setOffsetFromRenderer(localCompositingBounds.location() - LayoutPoint());460 m_graphicsLayer->setOffsetFromRenderer(localCompositingBounds.location() - IntPoint()); 461 461 462 462 FloatSize oldSize = m_graphicsLayer->size(); … … 471 471 472 472 // If we have a layer that clips children, position it. 473 LayoutRect clippingBox;473 IntRect clippingBox; 474 474 if (m_clippingLayer) { 475 clippingBox = clipBox(toRenderBox(renderer()));475 clippingBox = pixelSnappedIntRect(clipBox(toRenderBox(renderer()))); 476 476 m_clippingLayer->setPosition(FloatPoint() + (clippingBox.location() - localCompositingBounds.location())); 477 477 m_clippingLayer->setSize(clippingBox.size()); … … 489 489 490 490 if (m_owningLayer->hasTransform()) { 491 const LayoutRect borderBox = toRenderBox(renderer())->borderBoxRect();491 const IntRect borderBox = pixelSnappedIntRect(toRenderBox(renderer())->borderBoxRect()); 492 492 493 493 // 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()); 495 495 496 496 // Update properties that depend on layer dimensions … … 525 525 FloatPoint foregroundPosition; 526 526 FloatSize foregroundSize = newSize; 527 LayoutSize foregroundOffset = m_graphicsLayer->offsetFromRenderer();527 IntSize foregroundOffset = m_graphicsLayer->offsetFromRenderer(); 528 528 if (m_clippingLayer) { 529 529 // If we have a clipping layer (which clips descendants), then the foreground layer is a child of it, 530 530 // so that it gets correctly sorted with children. In that case, position relative to the clipping layer. 531 531 foregroundSize = FloatSize(clippingBox.size()); 532 foregroundOffset = clippingBox.location() - LayoutPoint();532 foregroundOffset = clippingBox.location() - IntPoint(); 533 533 } 534 534 … … 549 549 } 550 550 551 m_graphicsLayer->setContentsRect( contentsBox());551 m_graphicsLayer->setContentsRect(pixelSnappedIntRect(contentsBox())); 552 552 updateDrawsContent(); 553 553 updateAfterWidgetResize(); … … 1135 1135 LayoutRect transformedClip = clip; 1136 1136 transformedClip.moveBy(scrollbarRect.location()); 1137 scrollbar->paint(&context, transformedClip);1137 scrollbar->paint(&context, pixelSnappedIntRect(transformedClip)); 1138 1138 context.restore(); 1139 1139 } -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r107364 r107461 482 482 layer->convertToLayerCoords(ancestorLayer, ancestorRelOffset); 483 483 boundingBoxRect.moveBy(ancestorRelOffset); 484 return boundingBoxRect;484 return pixelSnappedIntRect(boundingBoxRect); 485 485 } 486 486 … … 537 537 unionBounds.moveBy(ancestorRelOffset); 538 538 539 return unionBounds;539 return pixelSnappedIntRect(unionBounds); 540 540 } 541 541 -
trunk/Source/WebCore/rendering/RenderObject.cpp
r106281 r107461 966 966 bool wasAntialiased = graphicsContext->shouldAntialias(); 967 967 graphicsContext->setShouldAntialias(antialias); 968 graphicsContext->drawRect( IntRect(x1, y1, x2 - x1, y2 - y1));968 graphicsContext->drawRect(pixelSnappedIntRect(LayoutRect(x1, y1, x2 - x1, y2 - y1))); 969 969 graphicsContext->setShouldAntialias(wasAntialiased); 970 970 graphicsContext->setStrokeStyle(oldStrokeStyle); … … 1111 1111 if (href.isNull()) 1112 1112 return; 1113 context->setURLForRect(n->document()->completeURL(href), rect);1113 context->setURLForRect(n->document()->completeURL(href), pixelSnappedIntRect(rect)); 1114 1114 } 1115 1115 -
trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp
r106880 r107461 176 176 } 177 177 178 m_searchPopup->popupMenu()->show( absoluteBoundingBoxRect(), document()->view(), -1);178 m_searchPopup->popupMenu()->show(pixelSnappedIntRect(absoluteBoundingBoxRect()), document()->view(), -1); 179 179 } 180 180 … … 197 197 // Convert the rect into the coords used for painting the content 198 198 contentsRect.moveBy(paintOffset + location()); 199 theme()->paintCapsLockIndicator(this, paintInfo, contentsRect);199 theme()->paintCapsLockIndicator(this, paintInfo, pixelSnappedIntRect(contentsRect)); 200 200 } 201 201 } -
trunk/Source/WebCore/rendering/RenderWidget.cpp
r98304 r107461 309 309 if (isSelected() && !document()->printing()) { 310 310 // 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()); 312 312 } 313 313 } -
trunk/Source/WebCore/rendering/style/RenderStyle.cpp
r107289 r107461 887 887 RoundedRect RenderStyle::getRoundedBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const 888 888 { 889 RoundedRect roundedRect( borderRect);889 RoundedRect roundedRect(pixelSnappedIntRect(borderRect)); 890 890 if (hasBorderRadius()) { 891 891 RoundedRect::Radii radii = calcRadiiFor(surround->border, borderRect.size()); … … 916 916 borderRect.height() - topWidth - bottomWidth); 917 917 918 RoundedRect roundedRect( innerRect);918 RoundedRect roundedRect(pixelSnappedIntRect(innerRect)); 919 919 920 920 if (hasBorderRadius()) {
Note: See TracChangeset
for help on using the changeset viewer.