Chromium Code Reviews| Index: Source/core/rendering/RenderView.cpp |
| diff --git a/Source/core/rendering/RenderView.cpp b/Source/core/rendering/RenderView.cpp |
| index 55b16e741275b455a4eb3547caa2a5cae790331c..0d9dfd5ed81cff2c4cd781d687a373bca3074b5b 100644 |
| --- a/Source/core/rendering/RenderView.cpp |
| +++ b/Source/core/rendering/RenderView.cpp |
| @@ -333,6 +333,29 @@ void RenderView::invalidateTreeIfNeeded(const PaintInvalidationState& paintInval |
| RenderBlock::invalidateTreeIfNeeded(paintInvalidationState); |
| } |
| +LayoutRect RenderView::rectForPaintInvalidation(const LayoutRect* paintInvalidationRectPtr) const |
|
enne (OOO)
2015/02/10 00:17:49
I see your comment about this existing before and
MikeB
2015/03/18 21:18:34
I updated this to be more in-line with using prope
|
| +{ |
| + LayoutRect paintInvalidationRect = |
| + paintInvalidationRectPtr ? *paintInvalidationRectPtr : viewRect(); |
| + Element* owner = document().ownerElement(); |
| + if (document().printing() || !m_frameView |
| + || layer()->compositingState() == PaintsIntoOwnBacking || !owner) |
| + return paintInvalidationRect; |
| + if (RenderBox* obj = owner->renderBox()) { |
| + // Intersect the viewport with the paint invalidation rect. |
| + LayoutRect viewRectangle = viewRect(); |
| + LayoutRect rectToInvalidate = intersection(paintInvalidationRect, viewRectangle); |
| + |
| + // Adjust for scroll offset of the view. |
| + rectToInvalidate.moveBy(-viewRectangle.location()); |
| + |
| + // Adjust for frame border. |
| + rectToInvalidate.moveBy(obj->contentBoxRect().location()); |
| + return rectToInvalidate; |
| + } |
| + return paintInvalidationRect; |
| +} |
| + |
| void RenderView::invalidatePaintForRectangle(const LayoutRect& paintInvalidationRect, PaintInvalidationReason invalidationReason) const |
| { |
| ASSERT(!paintInvalidationRect.isEmpty()); |