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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp

Issue 2791883002: Optimize ClipRects in the PrePaintTreeWalk (Closed)
Patch Set: none Created 3 years, 8 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PrePaintTreeWalk.h » ('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 "core/paint/PaintLayerPainter.h" 5 #include "core/paint/PaintLayerPainter.h"
6 6
7 #include "core/frame/LocalFrame.h" 7 #include "core/frame/LocalFrame.h"
8 #include "core/layout/LayoutView.h" 8 #include "core/layout/LayoutView.h"
9 #include "core/paint/ClipPathClipper.h" 9 #include "core/paint/ClipPathClipper.h"
10 #include "core/paint/FilterPainter.h" 10 #include "core/paint/FilterPainter.h"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 DCHECK(m_paintLayer.isSelfPaintingLayer() || 147 DCHECK(m_paintLayer.isSelfPaintingLayer() ||
148 m_paintLayer.hasSelfPaintingLayerDescendant()); 148 m_paintLayer.hasSelfPaintingLayerDescendant());
149 149
150 PaintLayerFlags localPaintFlags = paintFlags & ~(PaintLayerAppliedTransform); 150 PaintLayerFlags localPaintFlags = paintFlags & ~(PaintLayerAppliedTransform);
151 localPaintFlags |= PaintLayerPaintingCompositingAllPhases; 151 localPaintFlags |= PaintLayerPaintingCompositingAllPhases;
152 return paintLayerContents(context, paintingInfo, localPaintFlags, 152 return paintLayerContents(context, paintingInfo, localPaintFlags,
153 fragmentPolicy); 153 fragmentPolicy);
154 } 154 }
155 155
156 static bool shouldCreateSubsequence(const PaintLayer& paintLayer, 156 static bool shouldCreateSubsequence(const PaintLayer& paintLayer,
157 GraphicsContext& context, 157 const GraphicsContext& context,
158 const PaintLayerPaintingInfo& paintingInfo, 158 const PaintLayerPaintingInfo& paintingInfo,
159 PaintLayerFlags paintFlags) { 159 PaintLayerFlags paintFlags) {
160 // Caching is not needed during printing. 160 // Caching is not needed during printing.
161 if (context.printing()) 161 if (context.printing())
162 return false; 162 return false;
163 163
164 // Don't create subsequence for a composited layer because if it can be 164 // Don't create subsequence for a composited layer because if it can be
165 // cached, we can skip the whole painting in GraphicsLayer::paint() with 165 // cached, we can skip the whole painting in GraphicsLayer::paint() with
166 // CachedDisplayItemList. This also avoids conflict of 166 // CachedDisplayItemList. This also avoids conflict of
167 // PaintLayer::previousXXX() when paintLayer is composited scrolling and is 167 // PaintLayer::previousXXX() when paintLayer is composited scrolling and is
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
1198 context, layoutObject, PaintPhaseClippingMask)) 1198 context, layoutObject, PaintPhaseClippingMask))
1199 return; 1199 return;
1200 1200
1201 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect()); 1201 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect());
1202 LayoutObjectDrawingRecorder drawingRecorder( 1202 LayoutObjectDrawingRecorder drawingRecorder(
1203 context, layoutObject, PaintPhaseClippingMask, snappedClipRect); 1203 context, layoutObject, PaintPhaseClippingMask, snappedClipRect);
1204 context.fillRect(snappedClipRect, Color::black); 1204 context.fillRect(snappedClipRect, Color::black);
1205 } 1205 }
1206 1206
1207 } // namespace blink 1207 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PrePaintTreeWalk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698