Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(532)

Unified Diff: third_party/WebKit/Source/core/paint/DeprecatedPaintLayerPainter.cpp

Issue 1246173002: Throttle rendering pipeline for invisible iframes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased to post merge awesomeness. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.

Powered by Google App Engine
This is Rietveld 408576698