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

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

Issue 1246173002: Throttle rendering pipeline for invisible iframes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Keep animation time consistent. 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: Source/core/paint/DeprecatedPaintLayerPainter.cpp
diff --git a/Source/core/paint/DeprecatedPaintLayerPainter.cpp b/Source/core/paint/DeprecatedPaintLayerPainter.cpp
index b377cdfe02ee91c70e0e96d8affed000d1cd5b5d..79cbbf85516fa2c6e9bec8d1536b4fa7295e7dff 100644
--- a/Source/core/paint/DeprecatedPaintLayerPainter.cpp
+++ b/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"
@@ -43,6 +44,17 @@ static inline bool shouldSuppressPaintingLayer(DeprecatedPaintLayer* layer)
return false;
}
+static bool isThrottledFrameView(const LayoutObject* layoutObject)
+{
+ if (!layoutObject->isFrame())
+ return false;
+ const LayoutFrame* frame = toLayoutFrame(layoutObject);
+ if (!frame->widget()->isFrameView())
+ return false;
+ const FrameView* frameView = toFrameView(frame->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);
@@ -80,6 +92,9 @@ void DeprecatedPaintLayerPainter::paintLayer(GraphicsContext* context, const Dep
if (shouldSuppressPaintingLayer(&m_paintLayer))
return;
+ if (isThrottledFrameView(m_paintLayer.layoutObject()))
chrishtr 2015/09/04 17:32:04 Add TODO here and below about subsequence caching.
Sami 2015/09/07 17:27:17 Done.
+ return;
+
// If this layer is totally invisible then there is nothing to paint.
if (!m_paintLayer.layoutObject()->opacity() && !m_paintLayer.layoutObject()->hasBackdropFilter())
return;
@@ -203,6 +218,9 @@ void DeprecatedPaintLayerPainter::paintLayerContents(GraphicsContext* context, c
if (paintFlags & PaintLayerPaintingRootBackgroundOnly && !m_paintLayer.layoutObject()->isLayoutView() && !m_paintLayer.layoutObject()->isDocumentElement())
return;
+ if (isThrottledFrameView(m_paintLayer.layoutObject()))
+ return;
+
// Ensure our lists are up-to-date.
m_paintLayer.stackingNode()->updateLayerListsIfNeeded();

Powered by Google App Engine
This is Rietveld 408576698