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

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

Issue 2854493002: Store previous painting clip rects on FragmentData. (Closed)
Patch Set: none Created 3 years, 7 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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 // won't cause the paint phases to become non-empty. 230 // won't cause the paint phases to become non-empty.
231 if (paint_layer.NeedsRepaint()) 231 if (paint_layer.NeedsRepaint())
232 needs_repaint = true; 232 needs_repaint = true;
233 233
234 // Repaint if layer's clip changes. 234 // Repaint if layer's clip changes.
235 if (!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { 235 if (!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) {
236 ClipRects& clip_rects = 236 ClipRects& clip_rects =
237 paint_layer.Clipper(PaintLayer::kDoNotUseGeometryMapper) 237 paint_layer.Clipper(PaintLayer::kDoNotUseGeometryMapper)
238 .PaintingClipRects(painting_info.root_layer, respect_overflow_clip, 238 .PaintingClipRects(painting_info.root_layer, respect_overflow_clip,
239 subpixel_accumulation); 239 subpixel_accumulation);
240 ClipRects* previous_clip_rects = paint_layer.PreviousPaintingClipRects(); 240 ClipRects* previous_clip_rects = paint_layer.PreviousClipRects();
241 if (&clip_rects != previous_clip_rects && 241 if (&clip_rects != previous_clip_rects &&
242 (!previous_clip_rects || clip_rects != *previous_clip_rects)) { 242 (!previous_clip_rects || clip_rects != *previous_clip_rects)) {
243 needs_repaint = true; 243 needs_repaint = true;
244 should_clear_empty_paint_phase_flags = true; 244 should_clear_empty_paint_phase_flags = true;
245 } 245 }
246 paint_layer.SetPreviousPaintingClipRects(clip_rects); 246 paint_layer.SetPreviousClipRects(clip_rects);
247 } 247 }
248 248
249 // Repaint if previously the layer might be clipped by paintDirtyRect and 249 // Repaint if previously the layer might be clipped by paintDirtyRect and
250 // paintDirtyRect changes. 250 // paintDirtyRect changes.
251 if (paint_layer.PreviousPaintResult() == kMayBeClippedByPaintDirtyRect && 251 if (paint_layer.PreviousPaintResult() == kMayBeClippedByPaintDirtyRect &&
252 paint_layer.PreviousPaintDirtyRect() != painting_info.paint_dirty_rect) { 252 paint_layer.PreviousPaintDirtyRect() != painting_info.paint_dirty_rect) {
253 needs_repaint = true; 253 needs_repaint = true;
254 should_clear_empty_paint_phase_flags = true; 254 should_clear_empty_paint_phase_flags = true;
255 } 255 }
256 paint_layer.SetPreviousPaintDirtyRect(painting_info.paint_dirty_rect); 256 paint_layer.SetPreviousPaintDirtyRect(painting_info.paint_dirty_rect);
(...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after
1256 context, layout_object, kPaintPhaseClippingMask)) 1256 context, layout_object, kPaintPhaseClippingMask))
1257 return; 1257 return;
1258 1258
1259 IntRect snapped_clip_rect = PixelSnappedIntRect(clip_rect.Rect()); 1259 IntRect snapped_clip_rect = PixelSnappedIntRect(clip_rect.Rect());
1260 LayoutObjectDrawingRecorder drawing_recorder( 1260 LayoutObjectDrawingRecorder drawing_recorder(
1261 context, layout_object, kPaintPhaseClippingMask, snapped_clip_rect); 1261 context, layout_object, kPaintPhaseClippingMask, snapped_clip_rect);
1262 context.FillRect(snapped_clip_rect, Color::kBlack); 1262 context.FillRect(snapped_clip_rect, Color::kBlack);
1263 } 1263 }
1264 1264
1265 } // namespace blink 1265 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698