Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1506)

Unified Diff: Source/core/rendering/RenderView.cpp

Issue 473093002: Revert "Re-land of: Allow paint invalidation containers to cross frame boundaries." (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix compile error Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/RenderObject.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderView.cpp
diff --git a/Source/core/rendering/RenderView.cpp b/Source/core/rendering/RenderView.cpp
index c257d333486830b065e532efd36ba4c215fab8d2..8397a6aa3252a91e0f030360341048b7f396cf6f 100644
--- a/Source/core/rendering/RenderView.cpp
+++ b/Source/core/rendering/RenderView.cpp
@@ -294,6 +294,10 @@ void RenderView::mapLocalToContainer(const RenderLayerModelObject* repaintContai
return;
}
}
+
+ // If a container was specified, and was not 0 or the RenderView,
+ // then we should have found it by now.
+ ASSERT_ARG(repaintContainer, !repaintContainer);
}
const RenderObject* RenderView::pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap& geometryMap) const
@@ -434,12 +438,8 @@ void RenderView::invalidateTreeIfNeeded(const PaintInvalidationState& paintInval
// We specifically need to repaint the viewRect since other renderers
// short-circuit on full-repaint.
- LayoutRect dirtyRect = viewRect();
- if (doingFullPaintInvalidation() && !dirtyRect.isEmpty()) {
- const RenderLayerModelObject* paintInvalidationContainer = &paintInvalidationState.paintInvalidationContainer();
- mapRectToPaintInvalidationBacking(paintInvalidationContainer, dirtyRect);
- invalidatePaintUsingContainer(paintInvalidationContainer, dirtyRect, InvalidationFull);
- }
+ if (doingFullPaintInvalidation() && !viewRect().isEmpty())
+ invalidatePaintForRectangle(viewRect());
RenderBlock::invalidateTreeIfNeeded(paintInvalidationState);
}
@@ -451,12 +451,24 @@ void RenderView::invalidatePaintForRectangle(const LayoutRect& paintInvalidation
if (document().printing() || !m_frameView)
return;
- ASSERT(layer()->compositingState() == PaintsIntoOwnBacking || !frame()->ownerRenderer());
-
+ // We always just invalidate the root view, since we could be an iframe that is clipped out
+ // or even invisible.
+ Element* owner = document().ownerElement();
if (layer()->compositingState() == PaintsIntoOwnBacking) {
layer()->paintInvalidator().setBackingNeedsRepaintInRect(paintInvalidationRect);
- } else {
+ } else if (!owner) {
m_frameView->contentRectangleForPaintInvalidation(pixelSnappedIntRect(paintInvalidationRect));
+ } else 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());
+ obj->invalidatePaintRectangle(rectToInvalidate);
}
}
@@ -473,6 +485,10 @@ void RenderView::invalidatePaintForViewAndCompositedLayers()
void RenderView::mapRectToPaintInvalidationBacking(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect, bool fixed, const PaintInvalidationState* paintInvalidationState) const
{
+ // If a container was specified, and was not 0 or the RenderView,
+ // then we should have found it by now.
+ ASSERT_ARG(paintInvalidationContainer, !paintInvalidationContainer || paintInvalidationContainer == this);
+
if (document().printing())
return;
@@ -496,27 +512,6 @@ void RenderView::mapRectToPaintInvalidationBacking(const RenderLayerModelObject*
// Apply our transform if we have one (because of full page zooming).
if (!paintInvalidationContainer && layer() && layer()->transform())
rect = layer()->transform()->mapRect(rect);
-
- ASSERT(paintInvalidationContainer);
-
- if (paintInvalidationContainer == this)
- return;
-
- Element* owner = document().ownerElement();
- if (!owner)
- return;
- if (RenderBox* obj = owner->renderBox()) {
- // Intersect the viewport with the paint invalidation rect.
- LayoutRect viewRectangle = viewRect();
- rect.intersect(viewRectangle);
-
- // Adjust for scroll offset of the view.
- rect.moveBy(-viewRectangle.location());
-
- // Adjust for frame border.
- rect.moveBy(obj->contentBoxRect().location());
- obj->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect);
- }
}
void RenderView::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset) const
« no previous file with comments | « Source/core/rendering/RenderObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698