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

Side by Side Diff: third_party/WebKit/Source/core/paint/ViewPainter.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, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/paint/ViewPainter.h" 6 #include "core/paint/ViewPainter.h"
7 7
8 #include "core/frame/FrameView.h" 8 #include "core/frame/FrameView.h"
9 #include "core/frame/Settings.h" 9 #include "core/frame/Settings.h"
10 #include "core/layout/LayoutBox.h" 10 #include "core/layout/LayoutBox.h"
11 #include "core/layout/LayoutView.h" 11 #include "core/layout/LayoutView.h"
12 #include "core/paint/BlockPainter.h" 12 #include "core/paint/BlockPainter.h"
13 #include "core/paint/BoxPainter.h" 13 #include "core/paint/BoxPainter.h"
14 #include "core/paint/DeprecatedPaintLayer.h" 14 #include "core/paint/DeprecatedPaintLayer.h"
15 #include "core/paint/LayoutObjectDrawingRecorder.h" 15 #include "core/paint/LayoutObjectDrawingRecorder.h"
16 #include "core/paint/PaintInfo.h" 16 #include "core/paint/PaintInfo.h"
17 #include "platform/RuntimeEnabledFeatures.h" 17 #include "platform/RuntimeEnabledFeatures.h"
18 18
19 namespace blink { 19 namespace blink {
20 20
21 void ViewPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOffs et) 21 void ViewPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOffs et)
22 { 22 {
23 // If we ever require layout but receive a paint anyway, something has gone horribly wrong. 23 // If we ever require layout but receive a paint anyway, something has gone horribly wrong.
24 ASSERT(!m_layoutView.needsLayout()); 24 ASSERT(!m_layoutView.needsLayout());
25 // LayoutViews should never be called to paint with an offset not on device pixels. 25 // LayoutViews should never be called to paint with an offset not on device pixels.
26 ASSERT(LayoutPoint(IntPoint(paintOffset.x(), paintOffset.y())) == paintOffse t); 26 ASSERT(LayoutPoint(IntPoint(paintOffset.x(), paintOffset.y())) == paintOffse t);
27 27
28 const FrameView* frameView = m_layoutView.frameView();
29 if (frameView->shouldThrottleRenderingPipeline())
30 return;
31
28 m_layoutView.paintObject(paintInfo, paintOffset); 32 m_layoutView.paintObject(paintInfo, paintOffset);
29 BlockPainter(m_layoutView).paintOverflowControlsIfNeeded(paintInfo, paintOff set); 33 BlockPainter(m_layoutView).paintOverflowControlsIfNeeded(paintInfo, paintOff set);
30 } 34 }
31 35
32 void ViewPainter::paintBoxDecorationBackground(const PaintInfo& paintInfo) 36 void ViewPainter::paintBoxDecorationBackground(const PaintInfo& paintInfo)
33 { 37 {
34 if (!paintInfo.shouldPaintWithinRoot(&m_layoutView)) 38 if (!paintInfo.shouldPaintWithinRoot(&m_layoutView))
35 return; 39 return;
36 40
37 if (paintInfo.skipRootBackground()) 41 if (paintInfo.skipRootBackground())
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 BoxPainter::paintFillLayerExtended(m_layoutView, paintInfo, Color(), **it, LayoutRect(paintRect), BackgroundBleedNone); 151 BoxPainter::paintFillLayerExtended(m_layoutView, paintInfo, Color(), **it, LayoutRect(paintRect), BackgroundBleedNone);
148 context.restore(); 152 context.restore();
149 } 153 }
150 } 154 }
151 155
152 if (shouldDrawBackgroundInSeparateBuffer) 156 if (shouldDrawBackgroundInSeparateBuffer)
153 context.endLayer(); 157 context.endLayer();
154 } 158 }
155 159
156 } // namespace blink 160 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698