Chromium Code Reviews| 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 6aa124823e87b7dca13e33f0cf0d8f9728cae97a..c3bc70a2a1e08ecc9423289bb9d046e784cc6b8f 100644 |
| --- a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp |
| +++ b/third_party/WebKit/Source/core/paint/PaintLayerPainter.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(PaintLayer* layer) |
| return false; |
| } |
| +static bool isThrottledFrameView(const LayoutObject* layoutObject) |
|
esprehn
2015/10/14 22:09:46
I'd put this on LayoutPart, and do
->isLayoutPar
Sami
2015/10/16 16:48:09
Thanks, much better.
|
| +{ |
| + 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->shouldThrottleRendering(); |
| +} |
| + |
| void PaintLayerPainter::paint(GraphicsContext* context, const LayoutRect& damageRect, const GlobalPaintFlags globalPaintFlags, LayoutObject* paintingRoot, PaintLayerFlags paintFlags) |
| { |
| PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRect(damageRect)), globalPaintFlags, LayoutSize(), paintingRoot); |
| @@ -86,6 +98,10 @@ PaintLayerPainter::PaintResult PaintLayerPainter::paintLayerInternal(GraphicsCon |
| 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; |
| @@ -220,6 +236,10 @@ PaintLayerPainter::PaintResult PaintLayerPainter::paintLayerContentsInternal(Gra |
| if (paintFlags & PaintLayerPaintingRootBackgroundOnly && !m_paintLayer.layoutObject()->isLayoutView() && !m_paintLayer.layoutObject()->isDocumentElement()) |
| return result; |
| + // TODO(skyostil): Unify this early-out logic with subsequence caching. |
| + if (isThrottledFrameView(m_paintLayer.layoutObject())) |
| + return FullyPainted; |
| + |
| PaintLayerPaintingInfo paintingInfo = paintingInfoArg; |
| // Ensure our lists are up-to-date. |