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

Issue 469383003: Revert of Re-land of: Allow paint invalidation containers to cross frame boundaries.

Created:
6 years, 4 months ago by leviw_travelin_and_unemployed
Modified:
6 years, 4 months ago
Reviewers:
chrishtr
CC:
blink-layers+watch_chromium.org, blink-reviews, blink-reviews-rendering, eae+blinkwatch, jchaffraix+rendering, leviw+renderwatch, pdr., rune+blink, zoltan1
Project:
blink
Visibility:
Public.

Description

Revert of Re-land of: Allow paint invalidation containers to cross frame boundaries. (patchset #1 of https://codereview.chromium.org/455883002/) Reason for revert: Broke iframe repainting: https://code.google.com/p/chromium/issues/detail?id=403734. Original issue's description: > Re-land of: Allow paint invalidation containers to cross frame boundaries. > > The previous version had an infinite loop bug in RenderObject when there are two nested frames. > > Previously, the *actual* paint invalidation container, meaning the enclosing > compositing layer / root RenderView, could already have been across a frame boundary. The logic to do this correctly was done via special code in RenderView. > > Instead, generalize the existing mechanisms to find a paint invalidation container > and map rects to repaint container coordinate space to cross frame boundaries. > This simplifies the code, and also causes paint invalidation rects to always be stored > in the coordinate space of their graphics layer backing. The latter is important if we want > to use these rects for determining which parts of a graphics layer need to be painted. > > BUG=401156 > > Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=179858 TBR=chrishtr@chromium.org NOTREECHECKS=true NOTRY=true BUG=401156

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+61 lines, -56 lines) Patch
M Source/core/frame/FrameView.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderLayerRepainter.cpp View 1 chunk +16 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderObject.h View 1 chunk +4 lines, -1 line 0 comments Download
M Source/core/rendering/RenderObject.cpp View 5 chunks +15 lines, -24 lines 0 comments Download
M Source/core/rendering/RenderView.cpp View 5 chunks +25 lines, -30 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
leviw_travelin_and_unemployed
Created Revert of Re-land of: Allow paint invalidation containers to cross frame boundaries.
6 years, 4 months ago (2014-08-14 23:39:02 UTC) #1
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/leviw@chromium.org/469383003/1
6 years, 4 months ago (2014-08-14 23:40:58 UTC) #2
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 4 months ago (2014-08-14 23:41:06 UTC) #3
commit-bot: I haz the power
6 years, 4 months ago (2014-08-14 23:41:07 UTC) #4
Failed to apply patch for Source/core/rendering/RenderView.cpp:
While running patch -p1 --forward --force --no-backup-if-mismatch;
  patching file Source/core/rendering/RenderView.cpp
  Hunk #1 succeeded at 294 (offset 9 lines).
  Hunk #2 succeeded at 438 (offset 9 lines).
  Hunk #3 FAILED at 442.
  Hunk #4 succeeded at 473 (offset 9 lines).
  Hunk #5 succeeded at 500 (offset 9 lines).
  1 out of 5 hunks FAILED -- saving rejects to file
Source/core/rendering/RenderView.cpp.rej

Patch:       Source/core/rendering/RenderView.cpp
Index: Source/core/rendering/RenderView.cpp
diff --git a/Source/core/rendering/RenderView.cpp
b/Source/core/rendering/RenderView.cpp
index
5957edda0b9d4d031ccceff3ccb6384ca88a5929..2a8a362e8794d6477e16653e7c5291bdcb72ac0a
100644
--- a/Source/core/rendering/RenderView.cpp
+++ b/Source/core/rendering/RenderView.cpp
@@ -285,6 +285,10 @@
             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
@@ -425,12 +429,8 @@
 
     // 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);
 }
@@ -442,12 +442,24 @@
     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()->repainter().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);
     }
 }
 
@@ -464,6 +476,10 @@
 
 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;
 
@@ -487,27 +503,6 @@
     // 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

Powered by Google App Engine
This is Rietveld 408576698