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

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

Issue 2668823002: Invalidate subsequence caching & empty paint phases if clips changed. (Closed)
Patch Set: none Created 3 years, 10 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 219
220 // Repaint subsequence if the layer is marked for needing repaint. 220 // Repaint subsequence if the layer is marked for needing repaint.
221 // We don't set needsResetEmptyPaintPhase here, but clear the empty paint 221 // We don't set needsResetEmptyPaintPhase here, but clear the empty paint
222 // phase flags in PaintLayer::setNeedsPaintPhaseXXX(), to ensure that we won't 222 // phase flags in PaintLayer::setNeedsPaintPhaseXXX(), to ensure that we won't
223 // clear previousPaintPhaseXXXEmpty flags when unrelated things changed which 223 // clear previousPaintPhaseXXXEmpty flags when unrelated things changed which
224 // won't cause the paint phases to become non-empty. 224 // won't cause the paint phases to become non-empty.
225 if (paintLayer.needsRepaint()) 225 if (paintLayer.needsRepaint())
226 needsRepaint = true; 226 needsRepaint = true;
227 227
228 // Repaint if layer's clip changes. 228 // Repaint if layer's clip changes.
229 // TODO(chrishtr): implement detecting clipping changes in SPv2. 229 if (!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) {
230 // crbug.com/645667
231 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
232 ClipRects& clipRects = paintLayer.clipper().paintingClipRects( 230 ClipRects& clipRects = paintLayer.clipper().paintingClipRects(
233 paintingInfo.rootLayer, respectOverflowClip, subpixelAccumulation); 231 paintingInfo.rootLayer, respectOverflowClip, subpixelAccumulation);
234 ClipRects* previousClipRects = paintLayer.previousPaintingClipRects(); 232 ClipRects* previousClipRects = paintLayer.previousPaintingClipRects();
235 if (&clipRects != previousClipRects && 233 if (&clipRects != previousClipRects &&
236 (!previousClipRects || clipRects != *previousClipRects)) { 234 (!previousClipRects || clipRects != *previousClipRects)) {
237 needsRepaint = true; 235 needsRepaint = true;
238 shouldClearEmptyPaintPhaseFlags = true; 236 shouldClearEmptyPaintPhaseFlags = true;
239 } 237 }
240 paintLayer.setPreviousPaintingClipRects(clipRects); 238 paintLayer.setPreviousPaintingClipRects(clipRects);
241 } 239 }
(...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after
1188 context, layoutObject, PaintPhaseClippingMask)) 1186 context, layoutObject, PaintPhaseClippingMask))
1189 return; 1187 return;
1190 1188
1191 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect()); 1189 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect());
1192 LayoutObjectDrawingRecorder drawingRecorder( 1190 LayoutObjectDrawingRecorder drawingRecorder(
1193 context, layoutObject, PaintPhaseClippingMask, snappedClipRect); 1191 context, layoutObject, PaintPhaseClippingMask, snappedClipRect);
1194 context.fillRect(snappedClipRect, Color::black); 1192 context.fillRect(snappedClipRect, Color::black);
1195 } 1193 }
1196 1194
1197 } // namespace blink 1195 } // 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