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

Side by Side Diff: Source/core/paint/ViewPainter.cpp

Issue 1315213002: (WIP) Paint invalidation for slimming paint v2 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/paint/PaintPhase.h ('k') | Source/platform/graphics/paint/DisplayItemList.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled())
29 m_layoutView.invalidatePaintIfNeededForSlimmingPaintV2(paintOffset);
30
28 m_layoutView.paintObject(paintInfo, paintOffset); 31 m_layoutView.paintObject(paintInfo, paintOffset);
29 BlockPainter(m_layoutView).paintOverflowControlsIfNeeded(paintInfo, paintOff set); 32 BlockPainter(m_layoutView).paintOverflowControlsIfNeeded(paintInfo, paintOff set);
30 } 33 }
31 34
32 void ViewPainter::paintBoxDecorationBackground(const PaintInfo& paintInfo) 35 void ViewPainter::paintBoxDecorationBackground(const PaintInfo& paintInfo)
33 { 36 {
34 if (!paintInfo.shouldPaintWithinRoot(&m_layoutView)) 37 if (!paintInfo.shouldPaintWithinRoot(&m_layoutView))
35 return; 38 return;
36 39
37 if (paintInfo.skipRootBackground()) 40 if (paintInfo.skipRootBackground())
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 ASSERT((*it)->clip() == BorderFillBox); 144 ASSERT((*it)->clip() == BorderFillBox);
142 BoxPainter::paintFillLayerExtended(m_layoutView, paintInfo, Color(), **i t, LayoutRect(paintRect), BackgroundBleedNone); 145 BoxPainter::paintFillLayerExtended(m_layoutView, paintInfo, Color(), **i t, LayoutRect(paintRect), BackgroundBleedNone);
143 } 146 }
144 context.restore(); 147 context.restore();
145 148
146 if (shouldDrawBackgroundInSeparateBuffer) 149 if (shouldDrawBackgroundInSeparateBuffer)
147 context.endLayer(); 150 context.endLayer();
148 } 151 }
149 152
150 } // namespace blink 153 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/PaintPhase.h ('k') | Source/platform/graphics/paint/DisplayItemList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698