Index: third_party/WebKit/Source/core/paint/DeprecatedPaintLayerPainter.cpp |
diff --git a/third_party/WebKit/Source/core/paint/DeprecatedPaintLayerPainter.cpp b/third_party/WebKit/Source/core/paint/DeprecatedPaintLayerPainter.cpp |
index 218d7eea939d608a8398aed37ec8b72b35b7899e..d5f9a5edefc2351ebb84d31d0bb2d9ad0c91430f 100644 |
--- a/third_party/WebKit/Source/core/paint/DeprecatedPaintLayerPainter.cpp |
+++ b/third_party/WebKit/Source/core/paint/DeprecatedPaintLayerPainter.cpp |
@@ -8,6 +8,7 @@ |
#include "core/frame/Settings.h" |
#include "core/layout/ClipPathOperation.h" |
#include "core/layout/LayoutBlock.h" |
+#include "core/layout/LayoutFrame.h" |
#include "core/layout/LayoutView.h" |
#include "core/layout/svg/LayoutSVGResourceClipper.h" |
#include "core/page/Page.h" |
@@ -44,6 +45,17 @@ static inline bool shouldSuppressPaintingLayer(DeprecatedPaintLayer* layer) |
return false; |
} |
+static bool isThrottledFrameView(const LayoutObject* layoutObject) |
+{ |
+ if (!layoutObject->isLayoutPart()) |
+ return false; |
+ const LayoutPart* part = toLayoutPart(layoutObject); |
+ if (!part->widget() || !part->widget()->isFrameView()) |
+ return false; |
+ const FrameView* frameView = toFrameView(part->widget()); |
+ return frameView->shouldThrottleRenderingPipeline(); |
+} |
+ |
void DeprecatedPaintLayerPainter::paint(GraphicsContext* context, const LayoutRect& damageRect, const GlobalPaintFlags globalPaintFlags, LayoutObject* paintingRoot, PaintLayerFlags paintFlags) |
{ |
DeprecatedPaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRect(damageRect)), globalPaintFlags, LayoutSize(), paintingRoot); |
@@ -86,6 +98,10 @@ DeprecatedPaintLayerPainter::PaintResult DeprecatedPaintLayerPainter::paintLayer |
if (shouldSuppressPaintingLayer(&m_paintLayer)) |
return FullyPainted; |
+ // TODO(skyostil): Unify this early-out logic with subsequence caching. |
+ if (isThrottledFrameView(m_paintLayer.layoutObject())) |
+ return FullyPainted; |
+ |
// If this layer is totally invisible then there is nothing to paint. |
if (!m_paintLayer.layoutObject()->opacity() && !m_paintLayer.layoutObject()->hasBackdropFilter()) |
return FullyPainted; |
@@ -235,6 +251,10 @@ DeprecatedPaintLayerPainter::PaintResult DeprecatedPaintLayerPainter::paintLayer |
subsequenceRecorder.emplace(*context, m_paintLayer); |
} |
+ // TODO(skyostil): Unify this early-out logic with subsequence caching. |
+ if (isThrottledFrameView(m_paintLayer.layoutObject())) |
+ return FullyPainted; |
+ |
DeprecatedPaintLayerPaintingInfo paintingInfo = paintingInfoArg; |
// Ensure our lists are up-to-date. |