Index: Source/core/rendering/RenderLayerRepainter.cpp |
diff --git a/Source/core/rendering/RenderLayerRepainter.cpp b/Source/core/rendering/RenderLayerRepainter.cpp |
index 7381c8ead3d057e6ad69727147d623d550c222a8..3123f316b24db2b534e3acbd2411db02e192ca1a 100644 |
--- a/Source/core/rendering/RenderLayerRepainter.cpp |
+++ b/Source/core/rendering/RenderLayerRepainter.cpp |
@@ -45,6 +45,7 @@ |
#include "core/rendering/RenderLayerRepainter.h" |
#include "core/rendering/FilterEffectRenderer.h" |
+#include "core/rendering/LayoutRectRecorder.h" |
#include "core/rendering/RenderLayer.h" |
#include "core/rendering/RenderView.h" |
#include "core/rendering/compositing/CompositedLayerMapping.h" |
@@ -59,6 +60,9 @@ RenderLayerRepainter::RenderLayerRepainter(RenderLayerModelObject* renderer) |
void RenderLayerRepainter::repaintAfterLayout(RenderGeometryMap* geometryMap, bool shouldCheckForRepaint) |
{ |
+ if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) |
+ return; |
+ |
// FIXME: really, we're in the repaint phase here, and the following queries are legal. |
// Until those states are fully fledged, I'll just disable the ASSERTS. |
DisableCompositingQueryAsserts disabler; |
@@ -106,16 +110,26 @@ void RenderLayerRepainter::clearRepaintRects() |
void RenderLayerRepainter::computeRepaintRects(const RenderLayerModelObject* repaintContainer, const RenderGeometryMap* geometryMap) |
{ |
+ if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) |
+ return; |
+ |
m_repaintRect = m_renderer->clippedOverflowRectForRepaint(repaintContainer); |
m_outlineBox = m_renderer->outlineBoundsForRepaint(repaintContainer, geometryMap); |
} |
void RenderLayerRepainter::computeRepaintRectsIncludingDescendants() |
{ |
- // FIXME: computeRepaintRects() has to walk up the parent chain for every layer to compute the rects. |
- // We should make this more efficient. |
- // FIXME: it's wrong to call this when layout is not up-to-date, which we do. |
- computeRepaintRects(m_renderer->containerForRepaint()); |
+ if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) { |
+ // This is a little silly as we create and immediately destroy the RAII |
+ // object but it makes sure we correctly set all of the repaint flags. |
Julien - ping for review
2014/03/07 18:26:38
This should be a FIXME as we will want this whole
dsinclair
2014/03/07 19:29:48
Done. This may also go away with the work that Lev
|
+ LayoutRectRecorder recorder(*m_renderer); |
+ |
+ } else { |
+ // FIXME: computeRepaintRects() has to walk up the parent chain for every layer to compute the rects. |
+ // We should make this more efficient. |
+ // FIXME: it's wrong to call this when layout is not up-to-date, which we do. |
+ computeRepaintRects(m_renderer->containerForRepaint()); |
+ } |
for (RenderLayer* layer = m_renderer->layer()->firstChild(); layer; layer = layer->nextSibling()) |
layer->repainter().computeRepaintRectsIncludingDescendants(); |
@@ -123,6 +137,9 @@ void RenderLayerRepainter::computeRepaintRectsIncludingDescendants() |
inline bool RenderLayerRepainter::shouldRepaintAfterLayout() const |
{ |
+ if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) |
+ return false; |
+ |
if (m_repaintStatus == NeedsNormalRepaint) |
return true; |
@@ -145,7 +162,12 @@ void RenderLayerRepainter::repaintIncludingNonCompositingDescendants(RenderLayer |
LayoutRect RenderLayerRepainter::repaintRectIncludingNonCompositingDescendants() const |
{ |
- LayoutRect repaintRect = m_repaintRect; |
+ LayoutRect repaintRect; |
+ if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) |
+ repaintRect = m_renderer->newRepaintRect(); |
+ else |
+ repaintRect = m_repaintRect; |
+ |
for (RenderLayer* child = m_renderer->layer()->firstChild(); child; child = child->nextSibling()) { |
// Don't include repaint rects for composited child layers; they will paint themselves and have a different origin. |
if (child->hasCompositedLayerMapping()) |