Chromium Code Reviews| Index: Source/core/rendering/RenderLayerRepainter.cpp |
| diff --git a/Source/core/rendering/RenderLayerRepainter.cpp b/Source/core/rendering/RenderLayerRepainter.cpp |
| index a06d55f468d9496c03b507a573deb2e8e0e9ec71..07444b694065e3924ca269b298ae621605f2aca5 100644 |
| --- a/Source/core/rendering/RenderLayerRepainter.cpp |
| +++ b/Source/core/rendering/RenderLayerRepainter.cpp |
| @@ -46,6 +46,7 @@ |
| #include "core/rendering/CompositedLayerMapping.h" |
| #include "core/rendering/FilterEffectRenderer.h" |
| +#include "core/rendering/LayoutRectRecorder.h" |
| #include "core/rendering/RenderLayer.h" |
| #include "core/rendering/RenderView.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()) |
|
Julien - ping for review
2014/02/14 18:05:48
My naive view is that this code shouldn't run at a
dsinclair
2014/02/14 18:15:27
When you say this code, do you mean anything in th
|
| + 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. |
| + LayoutRectRecorder recorder(*m_renderer); |
|
Julien - ping for review
2014/02/14 18:05:48
Won't this force m_oldRepaintRect == m_newRepaintR
dsinclair
2014/02/14 18:15:27
Possibly? If we've already updated oldRepaintRect
|
| + |
| + } 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()) |