| Index: third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
|
| diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
|
| index 587c36311a9c0e3a70d419f65a675bf4bc652478..7e8e3173b147dde7c9fd888478b877e01675af68 100644
|
| --- a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
|
| +++ b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
|
| @@ -167,6 +167,9 @@ static bool ShouldCreateSubsequence(const PaintLayer& paint_layer,
|
| if (context.Printing())
|
| return false;
|
|
|
| + if (!paint_layer.SupportsSubsequenceCaching())
|
| + return false;
|
| +
|
| // Don't create subsequence for a composited layer because if it can be
|
| // cached, we can skip the whole painting in GraphicsLayer::paint() with
|
| // CachedDisplayItemList. This also avoids conflict of
|
| @@ -185,20 +188,6 @@ static bool ShouldCreateSubsequence(const PaintLayer& paint_layer,
|
| kPaintLayerPaintingOverlayScrollbars | kPaintLayerUncachedClipRects))
|
| return false;
|
|
|
| - // Create subsequence for only stacking contexts whose painting are atomic.
|
| - // SVG is also painted atomically.
|
| - if (!paint_layer.StackingNode()->IsStackingContext() &&
|
| - !paint_layer.GetLayoutObject().IsSVGRoot())
|
| - return false;
|
| -
|
| - // The layer doesn't have children. Subsequence caching is not worth because
|
| - // normally the actual painting will be cheap.
|
| - // SVG is also painted atomically.
|
| - if (!PaintLayerStackingNodeIterator(*paint_layer.StackingNode(), kAllChildren)
|
| - .Next() &&
|
| - !paint_layer.GetLayoutObject().IsSVGRoot())
|
| - return false;
|
| -
|
| // When in FOUC-avoidance mode, don't cache any subsequences, to avoid having
|
| // to invalidate all of them when leaving this mode. There is an early-out in
|
| // BlockPainter::paintContents that may result in nothing getting painted in
|
| @@ -346,6 +335,7 @@ PaintResult PaintLayerPainter::PaintLayerContents(
|
| SubsequenceRecorder::UseCachedSubsequenceIfPossible(context,
|
| paint_layer_))
|
| return result;
|
| + DCHECK(paint_layer_.SupportsSubsequenceCaching());
|
| subsequence_recorder.emplace(context, paint_layer_);
|
| } else {
|
| should_clear_empty_paint_phase_flags = true;
|
|
|