Chromium Code Reviews| Index: Source/core/rendering/RenderView.cpp |
| diff --git a/Source/core/rendering/RenderView.cpp b/Source/core/rendering/RenderView.cpp |
| index 0c32889e8dcef547e8b2ea050c69cbb050c09a6d..e496c111d8f1749d3f75dbc7d7cdaef5dbe492de 100644 |
| --- a/Source/core/rendering/RenderView.cpp |
| +++ b/Source/core/rendering/RenderView.cpp |
| @@ -456,6 +456,29 @@ void RenderView::invalidateTreeAfterLayout(const PaintInvalidationState& paintIn |
| RenderBlock::invalidateTreeAfterLayout(paintInvalidationState); |
| } |
| +LayoutRect RenderView::rectForPaintInvalidation(const LayoutRect* repaintRectPtr) const |
| +{ |
| + if (document().printing() || !m_frameView) |
| + return LayoutRect(); |
| + LayoutRect repaintRect = repaintRectPtr ? *repaintRectPtr : viewRect(); |
|
chrishtr
2014/07/16 20:00:25
You need to put line 463 at the top of the functio
|
| + Element* owner = document().ownerElement(); |
| + if (layer()->compositingState() == PaintsIntoOwnBacking || !owner) |
| + return repaintRect; |
| + if (RenderBox* obj = owner->renderBox()) { |
| + LayoutRect viewRectangle = viewRect(); |
| + LayoutRect rectToRepaint = intersection(repaintRect, viewRectangle); |
| + |
| + // Subtract out the contentsX and contentsY offsets to get our coords within the viewing |
| + // rectangle. |
| + rectToRepaint.moveBy(-viewRectangle.location()); |
| + |
| + // FIXME: Hardcoded offsets here are not good. |
| + rectToRepaint.moveBy(obj->contentBoxRect().location()); |
| + return rectToRepaint; |
| + } |
| + return LayoutRect(); |
|
chrishtr
2014/07/16 20:00:25
return repaintRect;
|
| +} |
| + |
| void RenderView::repaintViewRectangle(const LayoutRect& repaintRect) const |
| { |
| ASSERT(!repaintRect.isEmpty()); |
| @@ -471,16 +494,7 @@ void RenderView::repaintViewRectangle(const LayoutRect& repaintRect) const |
| } else if (!owner) { |
| m_frameView->contentRectangleForPaintInvalidation(pixelSnappedIntRect(repaintRect)); |
| } else if (RenderBox* obj = owner->renderBox()) { |
| - LayoutRect viewRectangle = viewRect(); |
| - LayoutRect rectToRepaint = intersection(repaintRect, viewRectangle); |
| - |
| - // Subtract out the contentsX and contentsY offsets to get our coords within the viewing |
| - // rectangle. |
| - rectToRepaint.moveBy(-viewRectangle.location()); |
| - |
| - // FIXME: Hardcoded offsets here are not good. |
| - rectToRepaint.moveBy(obj->contentBoxRect().location()); |
| - obj->invalidatePaintRectangle(rectToRepaint); |
| + obj->invalidatePaintRectangle(rectForPaintInvalidation(&repaintRect)); |
| } |
| } |