Reviewed by Eric Seidel.
Switch paintReplaced to use IntPoint
https://bugs.webkit.org/show_bug.cgi?id=61891
Switching paintReplaced to use IntPoint to represent the paint offset instead
of a pair of ints.
Also renaming the IntPoint flavor of IntRect::move to moveBy to clear up the
fact that the IntPoint is added as an offset as opposed to being relocated
to that point.
No tests because this is just a refactoring.
* page/FrameView.cpp:
(WebCore::FrameView::invalidateScrollbarRect):
(WebCore::FrameView::convertFromRenderer):
(WebCore::FrameView::convertToRenderer):
* platform/ScrollView.cpp:
(WebCore::ScrollView::wheelEvent):
* platform/ScrollbarThemeComposite.cpp:
(WebCore::ScrollbarThemeComposite::invalidatePart):
* platform/graphics/gpu/Texture.cpp
(WebCore::Texture::updateSubRect)
* platform/graphics/IntRect.h:
(WebCore::IntRect::moveBy):
* platform/mac/WidgetMac.mm:
(WebCore::Widget::paint):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::paint):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::logicalRectToPhysicalRect):
(WebCore::RenderBlock::selectionGaps):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::offsetFromContainer):
(WebCore::RenderBox::computeRectForRepaint):
(WebCore::RenderBox::localCaretRect):
* rendering/RenderDetailsMarker.cpp:
(WebCore::RenderDetailsMarker::paint):
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::paintReplaced):
* rendering/RenderEmbeddedObject.h:
* rendering/RenderHTMLCanvas.cpp:
(WebCore::RenderHTMLCanvas::paintReplaced):
* rendering/RenderHTMLCanvas.h:
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintReplaced):
* rendering/RenderImage.h:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::culledInlineVisualOverflowBoundingBox):
* rendering/RenderLayer.cpp:
(WebCore::expandClipRectForDescendantsAndReflection):
(WebCore::RenderLayer::paintScrollCorner):
(WebCore::RenderLayer::paintResizer):
(WebCore::RenderLayer::paintChildLayerIntoColumns):
(WebCore::RenderLayer::hitTestChildLayerColumns):
(WebCore::RenderLayer::boundingBox):
(WebCore::RenderLayer::setBackingNeedsRepaintInRect):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
(WebCore::paintScrollbar):
(WebCore::RenderLayerBacking::paintContents):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::calculateCompositedBounds):
(WebCore::RenderLayerCompositor::layerWillBeRemoved):
(WebCore::paintScrollbar):
(WebCore::RenderLayerCompositor::paintContents):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::controlClipRect):
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::positionListMarker):
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::paint):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::paint):
* rendering/RenderReplaced.h:
(WebCore::RenderReplaced::paintReplaced):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::computeRectForRepaint):
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::controlClipRect):
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::paintReplaced):
* rendering/RenderVideo.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::repaintViewRectangle):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@87989
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-06-02 Levi Weintraub <leviw@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Switch paintReplaced to use IntPoint
+ https://bugs.webkit.org/show_bug.cgi?id=61891
+
+ Switching paintReplaced to use IntPoint to represent the paint offset instead
+ of a pair of ints.
+
+ Also renaming the IntPoint flavor of IntRect::move to moveBy to clear up the
+ fact that the IntPoint is added as an offset as opposed to being relocated
+ to that point.
+
+ No tests because this is just a refactoring.
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::invalidateScrollbarRect):
+ (WebCore::FrameView::convertFromRenderer):
+ (WebCore::FrameView::convertToRenderer):
+ * platform/ScrollView.cpp:
+ (WebCore::ScrollView::wheelEvent):
+ * platform/ScrollbarThemeComposite.cpp:
+ (WebCore::ScrollbarThemeComposite::invalidatePart):
+ * platform/graphics/gpu/Texture.cpp
+ (WebCore::Texture::updateSubRect)
+ * platform/graphics/IntRect.h:
+ (WebCore::IntRect::moveBy):
+ * platform/mac/WidgetMac.mm:
+ (WebCore::Widget::paint):
+ * rendering/InlineFlowBox.cpp:
+ (WebCore::InlineFlowBox::paint):
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::logicalRectToPhysicalRect):
+ (WebCore::RenderBlock::selectionGaps):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::offsetFromContainer):
+ (WebCore::RenderBox::computeRectForRepaint):
+ (WebCore::RenderBox::localCaretRect):
+ * rendering/RenderDetailsMarker.cpp:
+ (WebCore::RenderDetailsMarker::paint):
+ * rendering/RenderEmbeddedObject.cpp:
+ (WebCore::RenderEmbeddedObject::paintReplaced):
+ * rendering/RenderEmbeddedObject.h:
+ * rendering/RenderHTMLCanvas.cpp:
+ (WebCore::RenderHTMLCanvas::paintReplaced):
+ * rendering/RenderHTMLCanvas.h:
+ * rendering/RenderImage.cpp:
+ (WebCore::RenderImage::paintReplaced):
+ * rendering/RenderImage.h:
+ * rendering/RenderInline.cpp:
+ (WebCore::RenderInline::culledInlineVisualOverflowBoundingBox):
+ * rendering/RenderLayer.cpp:
+ (WebCore::expandClipRectForDescendantsAndReflection):
+ (WebCore::RenderLayer::paintScrollCorner):
+ (WebCore::RenderLayer::paintResizer):
+ (WebCore::RenderLayer::paintChildLayerIntoColumns):
+ (WebCore::RenderLayer::hitTestChildLayerColumns):
+ (WebCore::RenderLayer::boundingBox):
+ (WebCore::RenderLayer::setBackingNeedsRepaintInRect):
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
+ (WebCore::paintScrollbar):
+ (WebCore::RenderLayerBacking::paintContents):
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::calculateCompositedBounds):
+ (WebCore::RenderLayerCompositor::layerWillBeRemoved):
+ (WebCore::paintScrollbar):
+ (WebCore::RenderLayerCompositor::paintContents):
+ * rendering/RenderListBox.cpp:
+ (WebCore::RenderListBox::controlClipRect):
+ * rendering/RenderListItem.cpp:
+ (WebCore::RenderListItem::positionListMarker):
+ * rendering/RenderListMarker.cpp:
+ (WebCore::RenderListMarker::paint):
+ * rendering/RenderReplaced.cpp:
+ (WebCore::RenderReplaced::paint):
+ * rendering/RenderReplaced.h:
+ (WebCore::RenderReplaced::paintReplaced):
+ * rendering/RenderTableCell.cpp:
+ (WebCore::RenderTableCell::computeRectForRepaint):
+ * rendering/RenderTextControlSingleLine.cpp:
+ (WebCore::RenderTextControlSingleLine::controlClipRect):
+ * rendering/RenderVideo.cpp:
+ (WebCore::RenderVideo::paintReplaced):
+ * rendering/RenderVideo.h:
+ * rendering/RenderView.cpp:
+ (WebCore::RenderView::repaintViewRectangle):
+
2011-06-02 James Robinson <jamesr@chromium.org>
Reviewed by Dimitri Glazkov.
{
// Add in our offset within the FrameView.
IntRect dirtyRect = rect;
- dirtyRect.move(scrollbar->location());
+ dirtyRect.moveBy(scrollbar->location());
invalidateRect(dirtyRect);
}
IntRect rect = renderer->localToAbsoluteQuad(FloatRect(rendererRect)).enclosingBoundingBox();
// Convert from page ("absolute") to FrameView coordinates.
- rect.move(-scrollPosition());
+ rect.moveBy(-scrollPosition());
return rect;
}
IntRect rect = viewRect;
// Convert from FrameView coords into page ("absolute") coordinates.
- rect.move(scrollPosition());
+ rect.moveBy(scrollPosition());
// FIXME: we don't have a way to map an absolute rect down to a local quad, so just
// move the rect for now.
GraphicsContextStateSaver stateSaver(*context);
context->translate(x(), y());
- documentDirtyRect.move(-location());
+ documentDirtyRect.moveBy(-location());
if (!paintsEntireContents()) {
context->translate(-scrollX(), -scrollY());
- documentDirtyRect.move(scrollPosition());
+ documentDirtyRect.moveBy(scrollPosition());
context->clip(visibleContentRect());
}
IntRect scrollViewDirtyRect = rect;
scrollViewDirtyRect.intersect(frameRect());
context->translate(x(), y());
- scrollViewDirtyRect.move(-location());
+ scrollViewDirtyRect.moveBy(-location());
paintScrollbars(context, scrollViewDirtyRect);
}
{
// Scrollbars won't be transformed within us
IntRect newRect = localRect;
- newRect.move(scrollbar->location());
+ newRect.moveBy(scrollbar->location());
return newRect;
}
{
IntRect newRect = parentRect;
// Scrollbars won't be transformed within us
- newRect.move(-scrollbar->location());
+ newRect.moveBy(-scrollbar->location());
return newRect;
}
result = thumbRect;
}
}
- result.move(-scrollbar->location());
+ result.moveBy(-scrollbar->location());
scrollbar->invalidateRect(result);
}
IntPoint center() const { return IntPoint(x() + width() / 2, y() + height() / 2); }
void move(const IntSize& size) { m_location += size; }
- void move(const IntPoint& offset) { m_location.move(offset.x(), offset.y()); }
+ void moveBy(const IntPoint& offset) { m_location.move(offset.x(), offset.y()); }
void move(int dx, int dy) { m_location.move(dx, dy); }
void expand(const IntSize& size) { m_location += size; }
updateRectIntersected.intersect(tileBoundsWithBorder);
IntRect dstRect = updateRectIntersected;
- dstRect.move(-tileBoundsWithBorder.location());
+ dstRect.moveBy(-tileBoundsWithBorder.location());
if (updateRectIntersected.isEmpty())
continue;
CGContextTranslateCTM(context, -transformOrigin.x(), -transformOrigin.y());
IntRect dirtyRect = r;
- dirtyRect.move(-transformOrigin);
+ dirtyRect.moveBy(-transformOrigin);
if (![view isFlipped])
dirtyRect.setY([view bounds].size.height - dirtyRect.maxY());
CGContextScaleCTM(cgContext, 1, -1);
IntRect dirtyRect = r;
- dirtyRect.move(-transformOrigin);
+ dirtyRect.moveBy(-transformOrigin);
if (![view isFlipped])
dirtyRect.setY([view bounds].size.height - dirtyRect.maxY());
IntRect overflowRect(visualOverflowRect(lineTop, lineBottom));
overflowRect.inflate(renderer()->maximalOutlineSize(paintInfo.phase));
flipForWritingMode(overflowRect);
- overflowRect.move(paintOffset);
+ overflowRect.moveBy(paintOffset);
if (!paintInfo.rect.intersects(overflowRect))
return;
else
result = IntRect(logicalRect.y(), logicalRect.x(), logicalRect.height(), logicalRect.width());
flipForWritingMode(result);
- result.move(rootBlockPhysicalPosition);
+ result.moveBy(rootBlockPhysicalPosition);
return result;
}
// Note that we don't clip out overflow for positioned objects. We just stick to the border box.
IntRect flippedBlockRect = IntRect(offsetFromRootBlock.width(), offsetFromRootBlock.height(), width(), height());
rootBlock->flipForWritingMode(flippedBlockRect);
- flippedBlockRect.move(rootBlockPhysicalPosition);
+ flippedBlockRect.moveBy(rootBlockPhysicalPosition);
clipOutPositionedObjects(paintInfo, flippedBlockRect.location(), m_positionedObjects.get());
if (isBody() || isRoot()) // The <body> must make sure to examine its containingBlock's positioned objects.
for (RenderBlock* cb = containingBlock(); cb && !cb->isRenderView(); cb = cb->containingBlock())
IntRect columnRect(frameRect());
toRenderBlock(o)->flipForWritingModeIncludingColumns(columnRect);
offset += IntSize(columnRect.location().x(), columnRect.location().y());
- columnRect.move(point);
+ columnRect.moveBy(point);
o->adjustForColumns(offset, columnRect.location());
} else
offset += locationOffsetIncludingFlipping();
if (style()->position() == RelativePosition && layer())
rect.move(layer()->relativePositionOffset());
- rect.move(location());
+ rect.moveBy(location());
rect.move(layoutState->m_paintOffset);
if (layoutState->m_clipped)
rect.intersect(layoutState->m_clipRect);
*extraWidthToEndOfLine = x() + width() - rect.maxX();
// Move to local coords
- rect.move(-location());
+ rect.moveBy(-location());
return rect;
}
IntPoint boxOrigin(tx + x(), ty + y());
IntRect overflowRect(visualOverflowRect());
- overflowRect.move(boxOrigin);
+ overflowRect.moveBy(boxOrigin);
overflowRect.inflate(maximalOutlineSize(paintInfo.phase));
if (!paintInfo.rect.intersects(overflowRect))
RenderPart::paint(paintInfo, tx, ty);
}
-void RenderEmbeddedObject::paintReplaced(PaintInfo& paintInfo, int tx, int ty)
+void RenderEmbeddedObject::paintReplaced(PaintInfo& paintInfo, const IntPoint& paintOffset)
{
if (!pluginCrashedOrWasMissing())
return;
Font font;
TextRun run("");
float textWidth;
- if (!getReplacementTextGeometry(tx, ty, contentRect, path, replacementTextRect, font, run, textWidth))
+ if (!getReplacementTextGeometry(paintOffset.x(), paintOffset.y(), contentRect, path, replacementTextRect, font, run, textWidth))
return;
GraphicsContextStateSaver stateSaver(*context);
virtual const char* renderName() const { return "RenderEmbeddedObject"; }
virtual bool isEmbeddedObject() const { return true; }
- virtual void paintReplaced(PaintInfo&, int, int);
+ virtual void paintReplaced(PaintInfo&, const IntPoint&);
virtual void paint(PaintInfo& paintInfo, int, int);
#if USE(ACCELERATED_COMPOSITING)
return canvas && canvas->renderingContext() && canvas->renderingContext()->isAccelerated();
}
-void RenderHTMLCanvas::paintReplaced(PaintInfo& paintInfo, int tx, int ty)
+void RenderHTMLCanvas::paintReplaced(PaintInfo& paintInfo, const IntPoint& paintOffset)
{
IntRect rect = contentBoxRect();
- rect.move(tx, ty);
+ rect.moveBy(paintOffset);
bool useLowQualityScale = style()->imageRendering() == ImageRenderingOptimizeContrast;
static_cast<HTMLCanvasElement*>(node())->paint(paintInfo.context, rect, useLowQualityScale);
}
private:
virtual const char* renderName() const { return "RenderHTMLCanvas"; }
- virtual void paintReplaced(PaintInfo&, int tx, int ty);
+ virtual void paintReplaced(PaintInfo&, const IntPoint&);
virtual void intrinsicSizeChanged() { canvasSizeChanged(); }
};
#endif
}
-void RenderImage::paintReplaced(PaintInfo& paintInfo, int tx, int ty)
+void RenderImage::paintReplaced(PaintInfo& paintInfo, const IntPoint& paintOffset)
{
int cWidth = contentWidth();
int cHeight = contentHeight();
context->setStrokeStyle(SolidStroke);
context->setStrokeColor(Color::lightGray, style()->colorSpace());
context->setFillColor(Color::transparent, style()->colorSpace());
- context->drawRect(IntRect(tx + leftBorder + leftPad, ty + topBorder + topPad, cWidth, cHeight));
+ context->drawRect(IntRect(paintOffset.x() + leftBorder + leftPad, paintOffset.y() + topBorder + topPad, cWidth, cHeight));
bool errorPictureDrawn = false;
- int imageX = 0;
- int imageY = 0;
+ IntSize imageOffset;
// When calculating the usable dimensions, exclude the pixels of
// the ouline rect so the error image/alt text doesn't draw on it.
int usableWidth = cWidth - 2;
int centerY = (usableHeight - image->height()) / 2;
if (centerY < 0)
centerY = 0;
- imageX = leftBorder + leftPad + centerX + 1;
- imageY = topBorder + topPad + centerY + 1;
- context->drawImage(image.get(), style()->colorSpace(), IntPoint(tx + imageX, ty + imageY));
+ imageOffset = IntSize(leftBorder + leftPad + centerX + 1, topBorder + topPad + centerY + 1);
+ context->drawImage(image.get(), style()->colorSpace(), paintOffset + imageOffset);
errorPictureDrawn = true;
}
if (!m_altText.isEmpty()) {
String text = document()->displayStringModifiedByEncoding(m_altText);
context->setFillColor(style()->visitedDependentColor(CSSPropertyColor), style()->colorSpace());
- int ax = tx + leftBorder + leftPad;
- int ay = ty + topBorder + topPad;
const Font& font = style()->font();
const FontMetrics& fontMetrics = font.fontMetrics();
int ascent = fontMetrics.ascent();
+ IntPoint altTextOffset = paintOffset;
+ altTextOffset.move(leftBorder + leftPad, topBorder + topPad + ascent);
// Only draw the alt text if it'll fit within the content box,
// and only if it fits above the error image.
TextRun textRun = RenderBlock::constructTextRun(this, font, text, style());
int textWidth = font.width(textRun);
if (errorPictureDrawn) {
- if (usableWidth >= textWidth && fontMetrics.height() <= imageY)
- context->drawText(font, textRun, IntPoint(ax, ay + ascent));
+ if (usableWidth >= textWidth && fontMetrics.height() <= imageOffset.height())
+ context->drawText(font, textRun, altTextOffset);
} else if (usableWidth >= textWidth && cHeight >= fontMetrics.height())
- context->drawText(font, textRun, IntPoint(ax, ay + ascent));
+ context->drawText(font, textRun, altTextOffset);
}
}
} else if (m_imageResource->hasImage() && cWidth > 0 && cHeight > 0) {
#if PLATFORM(MAC)
if (style()->highlight() != nullAtom && !paintInfo.context->paintingDisabled())
- paintCustomHighlight(IntPoint(tx - x(), ty - y()), style()->highlight(), true);
+ paintCustomHighlight(toPoint(paintOffset - location()), style()->highlight(), true);
#endif
IntSize contentSize(cWidth, cHeight);
- IntRect rect(IntPoint(tx + leftBorder + leftPad, ty + topBorder + topPad), contentSize);
- paintIntoRect(context, rect);
+ IntPoint contentLocation = paintOffset;
+ contentLocation.move(leftBorder + leftPad, topBorder + topPad);
+ paintIntoRect(context, IntRect(contentLocation, contentSize));
}
}
virtual bool isImage() const { return true; }
virtual bool isRenderImage() const { return true; }
- virtual void paintReplaced(PaintInfo&, int tx, int ty);
+ virtual void paintReplaced(PaintInfo&, const IntPoint&);
virtual int minimumReplacedHeight() const;
if (!currBox->hasSelfPaintingLayer() && currBox->inlineBoxWrapper()) {
IntRect logicalRect = currBox->logicalVisualOverflowRectForPropagation(style());
if (isHorizontal) {
- logicalRect.move(currBox->location());
+ logicalRect.moveBy(currBox->location());
result.uniteIfNonZero(logicalRect);
} else {
- logicalRect.move(currBox->location());
+ logicalRect.moveBy(currBox->location());
result.uniteIfNonZero(logicalRect.transposedRect());
}
}
// Move the rect into partRenderer's coords.
buttonRect.move(offsetFromInputRenderer);
// Account for the local drawing offset.
- buttonRect.move(rect.location());
+ buttonRect.moveBy(rect.location());
DEFINE_STATIC_LOCAL(RefPtr<Image>, imageStateNormal, (Image::loadPlatformResource("inputSpeech")));
DEFINE_STATIC_LOCAL(RefPtr<Image>, imageStateRecording, (Image::loadPlatformResource("inputSpeechRecording")));
l->convertToLayerCoords(rootLayer, delta);
clipRect.move(-delta.x(), -delta.y());
clipRect.unite(l->renderBox()->reflectedRect(clipRect));
- clipRect.move(delta);
+ clipRect.moveBy(delta);
}
}
ASSERT(box);
IntRect absRect = scrollCornerRect();
- absRect.move(paintOffset);
+ absRect.moveBy(paintOffset);
if (!absRect.intersects(damageRect))
return;
ASSERT(box);
IntRect absRect = resizerCornerRect(this, box->borderBoxRect());
- absRect.move(paintOffset);
+ absRect.moveBy(paintOffset);
if (!absRect.intersects(damageRect))
return;
int logicalLeftOffset = (isHorizontal ? colRect.x() : colRect.y()) - columnBlock->logicalLeftOffsetForContent();
IntSize offset = isHorizontal ? IntSize(logicalLeftOffset, currLogicalTopOffset) : IntSize(currLogicalTopOffset, logicalLeftOffset);
- colRect.move(layerOffset);
+ colRect.moveBy(layerOffset);
IntRect localDirtyRect(paintDirtyRect);
localDirtyRect.intersect(colRect);
currLogicalTopOffset -= blockDelta;
else
currLogicalTopOffset += blockDelta;
- colRect.move(layerOffset);
+ colRect.moveBy(layerOffset);
IntRect localClipRect(hitTestRect);
localClipRect.intersect(colRect);
renderer()->containingBlock()->flipForWritingMode(result);
IntPoint delta;
convertToLayerCoords(ancestorLayer, delta);
- result.move(delta);
+ result.moveBy(delta);
return result;
}
IntRect absRect(r);
IntPoint delta;
convertToLayerCoords(root(), delta);
- absRect.move(delta);
+ absRect.moveBy(delta);
RenderView* view = renderer()->view();
if (view)
IntRect relativeCompositingBounds(localCompositingBounds);
IntPoint delta;
m_owningLayer->convertToLayerCoords(compAncestor, delta);
- relativeCompositingBounds.move(delta);
+ relativeCompositingBounds.moveBy(delta);
IntPoint graphicsLayerParentLocation;
if (compAncestor && compAncestor->backing()->hasClippingLayer()) {
const IntRect& scrollbarRect = scrollbar->frameRect();
context.translate(-scrollbarRect.x(), -scrollbarRect.y());
IntRect transformedClip = clip;
- transformedClip.move(scrollbarRect.location());
+ transformedClip.moveBy(scrollbarRect.location());
scrollbar->paint(&context, transformedClip);
context.restore();
}
context.save();
context.translate(-scrollCornerAndResizer.x(), -scrollCornerAndResizer.y());
IntRect transformedClip = clip;
- transformedClip.move(scrollCornerAndResizer.location());
+ transformedClip.moveBy(scrollCornerAndResizer.location());
m_owningLayer->paintScrollCorner(&context, IntPoint(), transformedClip);
m_owningLayer->paintResizer(&context, IntPoint(), transformedClip);
context.restore();
if (layer->renderer()->hasOverflowClip() || layer->renderer()->hasMask()) {
IntPoint ancestorRelOffset;
layer->convertToLayerCoords(ancestorLayer, ancestorRelOffset);
- boundingBoxRect.move(ancestorRelOffset);
+ boundingBoxRect.moveBy(ancestorRelOffset);
return boundingBoxRect;
}
IntPoint ancestorRelOffset;
layer->convertToLayerCoords(ancestorLayer, ancestorRelOffset);
- unionBounds.move(ancestorRelOffset);
+ unionBounds.moveBy(ancestorRelOffset);
return unionBounds;
}
IntPoint offset;
child->convertToLayerCoords(compLayer, offset);
- compBounds.move(offset);
+ compBounds.moveBy(offset);
compLayer->setBackingNeedsRepaintInRect(compBounds);
const IntRect& scrollbarRect = scrollbar->frameRect();
context.translate(-scrollbarRect.x(), -scrollbarRect.y());
IntRect transformedClip = clip;
- transformedClip.move(scrollbarRect.location());
+ transformedClip.moveBy(scrollbarRect.location());
scrollbar->paint(&context, transformedClip);
context.restore();
}
context.save();
context.translate(-scrollCorner.x(), -scrollCorner.y());
IntRect transformedClip = clip;
- transformedClip.move(scrollCorner.location());
+ transformedClip.moveBy(scrollCorner.location());
m_renderView->frameView()->paintScrollCorner(&context, transformedClip);
context.restore();
}
IntRect RenderListBox::controlClipRect(const IntPoint& additionalOffset) const
{
IntRect clipRect = contentBoxRect();
- clipRect.move(additionalOffset);
+ clipRect.moveBy(additionalOffset);
return clipRect;
}
propagateLayoutOverflow = false;
if (o->hasSelfPaintingLayer())
propagateVisualOverflow = false;
- markerRect.move(-o->location());
+ markerRect.moveBy(-o->location());
} while (o != this && propagateVisualOverflow && propagateLayoutOverflow);
}
}
IntPoint boxOrigin(tx + x(), ty + y());
IntRect overflowRect(visualOverflowRect());
- overflowRect.move(boxOrigin);
+ overflowRect.moveBy(boxOrigin);
overflowRect.inflate(maximalOutlineSize(paintInfo.phase));
if (!paintInfo.rect.intersects(overflowRect))
IntRect box(boxOrigin, IntSize(width(), height()));
IntRect marker = getRelativeMarkerRect();
- marker.move(boxOrigin);
+ marker.moveBy(boxOrigin);
GraphicsContext* context = paintInfo.context;
context->drawImage(m_image->image(this, marker.size()).get(), style()->colorSpace(), marker);
if (selectionState() != SelectionNone) {
IntRect selRect = localSelectionRect();
- selRect.move(boxOrigin);
+ selRect.moveBy(boxOrigin);
context->fillRect(selRect, selectionBackgroundColor(), style()->colorSpace());
}
return;
if (selectionState() != SelectionNone) {
IntRect selRect = localSelectionRect();
- selRect.move(boxOrigin);
+ selRect.moveBy(boxOrigin);
context->fillRect(selRect, selectionBackgroundColor(), style()->colorSpace());
}
GraphicsContextStateSaver stateSaver(*context, false);
if (!style()->isHorizontalWritingMode()) {
- marker.move(-boxOrigin);
+ marker.moveBy(-boxOrigin);
marker = marker.transposedRect();
marker.move(box.x(), box.y() - logicalHeight());
stateSaver.save();
}
if (!completelyClippedOut) {
- paintReplaced(paintInfo, tx, ty);
+ paintReplaced(paintInfo, IntPoint(tx, ty));
if (style()->hasBorderRadius())
paintInfo.context->restore();
int calcAspectRatioLogicalWidth() const;
int calcAspectRatioLogicalHeight() const;
- virtual void paintReplaced(PaintInfo&, int /*tx*/, int /*ty*/) { }
+ virtual void paintReplaced(PaintInfo&, const IntPoint&) { }
virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer);
r.setY(r.y());
RenderView* v = view();
if ((!v || !v->layoutStateEnabled() || repaintContainer) && parent())
- r.move(-parentBox()->location()); // Rows are in the same coordinate space, so don't add their offset in.
+ r.moveBy(-parentBox()->location()); // Rows are in the same coordinate space, so don't add their offset in.
RenderBlock::computeRectForRepaint(repaintContainer, r, fixed);
}
ASSERT(hasControlClip());
IntRect clipRect = IntRect(innerBlockElement()->renderBox()->frameRect());
- clipRect.move(additionalOffset);
+ clipRect.moveBy(additionalOffset);
return clipRect;
}
return !videoElement()->shouldDisplayPosterImage();
}
-void RenderVideo::paintReplaced(PaintInfo& paintInfo, int tx, int ty)
+void RenderVideo::paintReplaced(PaintInfo& paintInfo, const IntPoint& paintOffset)
{
MediaPlayer* mediaPlayer = mediaElement()->player();
bool displayingPoster = videoElement()->shouldDisplayPosterImage();
IntRect rect = videoBox();
if (rect.isEmpty())
return;
- rect.move(tx, ty);
+ rect.moveBy(paintOffset);
if (displayingPoster)
paintIntoRect(paintInfo.context, rect);
virtual bool requiresLayer() const { return true; }
virtual bool isVideo() const { return true; }
- virtual void paintReplaced(PaintInfo&, int tx, int ty);
+ virtual void paintReplaced(PaintInfo&, const IntPoint&);
virtual void layout();
// Subtract out the contentsX and contentsY offsets to get our coords within the viewing
// rectangle.
- r.move(-vr.location());
+ r.moveBy(-vr.location());
// FIXME: Hardcoded offsets here are not good.
r.move(obj->borderLeft() + obj->paddingLeft(),