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

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

Issue 2784963002: Optimize the pre-paint tree walk and ClipRects (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
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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 // won't cause the paint phases to become non-empty. 221 // won't cause the paint phases to become non-empty.
222 if (paintLayer.needsRepaint()) 222 if (paintLayer.needsRepaint())
223 needsRepaint = true; 223 needsRepaint = true;
224 224
225 // Repaint if layer's clip changes. 225 // Repaint if layer's clip changes.
226 if (!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { 226 if (!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) {
227 ClipRects& clipRects = 227 ClipRects& clipRects =
228 paintLayer.clipper(PaintLayer::DoNotUseGeometryMapper) 228 paintLayer.clipper(PaintLayer::DoNotUseGeometryMapper)
229 .paintingClipRects(paintingInfo.rootLayer, respectOverflowClip, 229 .paintingClipRects(paintingInfo.rootLayer, respectOverflowClip,
230 subpixelAccumulation); 230 subpixelAccumulation);
231 ClipRects* previousClipRects = paintLayer.previousPaintingClipRects(); 231 if (!paintLayer.hasPreviousPaintingClipRects() ||
232 if (&clipRects != previousClipRects && 232 clipRects != paintLayer.previousPaintingClipRects()) {
233 (!previousClipRects || clipRects != *previousClipRects)) {
234 needsRepaint = true; 233 needsRepaint = true;
235 shouldClearEmptyPaintPhaseFlags = true; 234 shouldClearEmptyPaintPhaseFlags = true;
236 } 235 }
237 paintLayer.setPreviousPaintingClipRects(clipRects); 236 paintLayer.setPreviousPaintingClipRects(clipRects);
238 } 237 }
239 238
240 // Repaint if previously the layer might be clipped by paintDirtyRect and 239 // Repaint if previously the layer might be clipped by paintDirtyRect and
241 // paintDirtyRect changes. 240 // paintDirtyRect changes.
242 if (paintLayer.previousPaintResult() == MayBeClippedByPaintDirtyRect && 241 if (paintLayer.previousPaintResult() == MayBeClippedByPaintDirtyRect &&
243 paintLayer.previousPaintDirtyRect() != paintingInfo.paintDirtyRect) { 242 paintLayer.previousPaintDirtyRect() != paintingInfo.paintDirtyRect) {
(...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after
1202 context, layoutObject, PaintPhaseClippingMask)) 1201 context, layoutObject, PaintPhaseClippingMask))
1203 return; 1202 return;
1204 1203
1205 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect()); 1204 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect());
1206 LayoutObjectDrawingRecorder drawingRecorder( 1205 LayoutObjectDrawingRecorder drawingRecorder(
1207 context, layoutObject, PaintPhaseClippingMask, snappedClipRect); 1206 context, layoutObject, PaintPhaseClippingMask, snappedClipRect);
1208 context.fillRect(snappedClipRect, Color::black); 1207 context.fillRect(snappedClipRect, Color::black);
1209 } 1208 }
1210 1209
1211 } // namespace blink 1210 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698