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

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

Issue 2662313003: Invalidate subsequence caching & empty paint phases if clips changed. (Closed)
Patch Set: 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
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 230 LOG(ERROR) << "oh";
231 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
232 ClipRects& clipRects = paintLayer.clipper().paintingClipRects( 231 ClipRects& clipRects = paintLayer.clipper().paintingClipRects(
233 paintingInfo.rootLayer, respectOverflowClip, subpixelAccumulation); 232 paintingInfo.rootLayer, respectOverflowClip, subpixelAccumulation);
234 ClipRects* previousClipRects = paintLayer.previousPaintingClipRects(); 233 ClipRects* previousClipRects = paintLayer.previousPaintingClipRects();
235 if (&clipRects != previousClipRects && 234 if (&clipRects != previousClipRects &&
236 (!previousClipRects || clipRects != *previousClipRects)) { 235 (!previousClipRects || clipRects != *previousClipRects)) {
237 needsRepaint = true; 236 needsRepaint = true;
238 shouldClearEmptyPaintPhaseFlags = true; 237 shouldClearEmptyPaintPhaseFlags = true;
239 } 238 }
240 paintLayer.setPreviousPaintingClipRects(clipRects); 239 paintLayer.setPreviousPaintingClipRects(clipRects);
241 } 240 }
(...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after
1188 context, layoutObject, PaintPhaseClippingMask)) 1187 context, layoutObject, PaintPhaseClippingMask))
1189 return; 1188 return;
1190 1189
1191 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect()); 1190 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect());
1192 LayoutObjectDrawingRecorder drawingRecorder( 1191 LayoutObjectDrawingRecorder drawingRecorder(
1193 context, layoutObject, PaintPhaseClippingMask, snappedClipRect); 1192 context, layoutObject, PaintPhaseClippingMask, snappedClipRect);
1194 context.fillRect(snappedClipRect, Color::black); 1193 context.fillRect(snappedClipRect, Color::black);
1195 } 1194 }
1196 1195
1197 } // namespace blink 1196 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698