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

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

Issue 160903002: Move RenderLayer repainting to repaint-after-layout framework. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Rebase to master Created 6 years, 9 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.h ('k') | Source/core/rendering/RenderView.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderObject.cpp
diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp
index d18901ebb09148a86ab36a8046f0f14cbc69c7b6..abf18a19db3a383031b586fe820310ee6a97f9d1 100644
--- a/Source/core/rendering/RenderObject.cpp
+++ b/Source/core/rendering/RenderObject.cpp
@@ -741,7 +741,10 @@ void RenderObject::invalidateContainerPreferredLogicalWidths()
void RenderObject::setLayerNeedsFullRepaint()
{
ASSERT(hasLayer());
- toRenderLayerModelObject(this)->layer()->repainter().setRepaintStatus(NeedsFullRepaint);
+ if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled())
+ setShouldDoFullRepaintAfterLayout(true);
+ else
+ toRenderLayerModelObject(this)->layer()->repainter().setRepaintStatus(NeedsFullRepaint);
}
void RenderObject::setLayerNeedsFullRepaintForPositionedMovementLayout()
@@ -1622,6 +1625,9 @@ void RenderObject::repaintOverflowIfNeeded()
bool RenderObject::checkForRepaint() const
{
+ if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled())
+ return !document().view()->needsFullRepaint() && everHadLayout();
+
return !document().view()->needsFullRepaint() && !hasLayer() && everHadLayout();
}
@@ -3314,6 +3320,64 @@ bool RenderObject::isRelayoutBoundaryForInspector() const
return objectIsRelayoutBoundary(this);
}
+LayoutRect RenderObject::newOutlineRect()
+{
+ ASSERT(hasOutline());
+
+ OutlineRects& outlineRects = view()->outlineRects();
+ OutlineRects::iterator it = outlineRects.find(this);
+ if (it == outlineRects.end())
+ return outlineBoundsForRepaint(containerForRepaint());
+ return it->value->newOutlineRect;
+}
+
+void RenderObject::setNewOutlineRect(const LayoutRect& rect)
+{
+ ASSERT(hasOutline());
+
+ OutlineRects& outlineRects = view()->outlineRects();
+ OutlineRects::iterator it = outlineRects.find(this);
+ if (it == outlineRects.end())
+ outlineRects.set(this, adoptPtr(new OutlineRectInfo()));
+
+ outlineRects.get(this)->newOutlineRect = rect;
+}
+
+LayoutRect RenderObject::oldOutlineRect()
+{
+ ASSERT(hasOutline());
+
+ OutlineRects& outlineRects = view()->outlineRects();
+ OutlineRects::iterator it = outlineRects.find(this);
+ if (it == outlineRects.end())
+ return LayoutRect();
+ return it->value->oldOutlineRect;
+}
+
+void RenderObject::setOldOutlineRect(const LayoutRect& rect)
+{
+ ASSERT(hasOutline());
+
+ OutlineRects& outlineRects = view()->outlineRects();
+ OutlineRects::iterator it = outlineRects.find(this);
+ if (it == outlineRects.end())
+ outlineRects.set(this, adoptPtr(new OutlineRectInfo()));
+ outlineRects.get(this)->oldOutlineRect = rect;
+}
+
+void RenderObject::clearRepaintState()
+{
+ setShouldDoFullRepaintAfterLayout(false);
+ setShouldDoFullRepaintIfSelfPaintingLayer(false);
+ setShouldRepaintOverflow(false);
+ setLayoutDidGetCalled(false);
+
+ OutlineRects& outlineRects = view()->outlineRects();
+ OutlineRects::iterator it = outlineRects.find(this);
+ if (it != outlineRects.end())
+ outlineRects.remove(it);
+}
+
} // namespace WebCore
#ifndef NDEBUG
« no previous file with comments | « Source/core/rendering/RenderObject.h ('k') | Source/core/rendering/RenderView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698