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

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

Issue 2843223003: [blink] Skip ancestor clip in PaintLayerPainter for squashed layers. (Closed)
Patch Set: 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
« no previous file with comments | « third_party/WebKit/LayoutTests/compositing/squashing/squash-transformed-with-clip-expected.html ('k') | no next file » | 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 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 kIgnorePlatformOverlayScrollbarSize, respect_overflow_clip, nullptr, 740 kIgnorePlatformOverlayScrollbarSize, respect_overflow_clip, nullptr,
741 painting_info.sub_pixel_accumulation, &transformed_extent); 741 painting_info.sub_pixel_accumulation, &transformed_extent);
742 } 742 }
743 743
744 Optional<DisplayItemCacheSkipper> cache_skipper; 744 Optional<DisplayItemCacheSkipper> cache_skipper;
745 if (layer_fragments.size() > 1) 745 if (layer_fragments.size() > 1)
746 cache_skipper.emplace(context); 746 cache_skipper.emplace(context);
747 747
748 ClipRect ancestor_background_clip_rect; 748 ClipRect ancestor_background_clip_rect;
749 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { 749 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
750 if (parent_layer) { 750 if (painting_info.root_layer == &paint_layer_) {
751 // This works around a bug in squashed-layer painting.
752 // Squashed layers paint into a backing in its compositing container's
753 // space, but painting_info.root_layer points to the squashed layer
754 // itself, thus PaintLayerClipper would return a clip rect in the
755 // squashed layer's local space, instead of the backing's space.
756 // Fortunately, CompositedLayerMapping::DoPaintTask already applied
757 // appropriate ancestor clip for us, we can simply skip it.
758 DCHECK_EQ(paint_layer_.GetCompositingState(), kPaintsIntoGroupedBacking);
759 ancestor_background_clip_rect.SetRect(FloatClipRect());
760 } else if (parent_layer) {
751 // Calculate the clip rectangle that the ancestors establish. 761 // Calculate the clip rectangle that the ancestors establish.
752 ClipRectsContext clip_rects_context( 762 ClipRectsContext clip_rects_context(
753 painting_info.root_layer, 763 painting_info.root_layer,
754 (paint_flags & kPaintLayerUncachedClipRects) ? kUncachedClipRects 764 (paint_flags & kPaintLayerUncachedClipRects) ? kUncachedClipRects
755 : kPaintingClipRects, 765 : kPaintingClipRects,
756 kIgnorePlatformOverlayScrollbarSize); 766 kIgnorePlatformOverlayScrollbarSize);
757 if (ShouldRespectOverflowClip(paint_flags, 767 if (ShouldRespectOverflowClip(paint_flags,
758 paint_layer_.GetLayoutObject()) == 768 paint_layer_.GetLayoutObject()) ==
759 kIgnoreOverflowClip) 769 kIgnoreOverflowClip)
760 clip_rects_context.SetIgnoreOverflowClip(); 770 clip_rects_context.SetIgnoreOverflowClip();
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
1225 context, layout_object, kPaintPhaseClippingMask)) 1235 context, layout_object, kPaintPhaseClippingMask))
1226 return; 1236 return;
1227 1237
1228 IntRect snapped_clip_rect = PixelSnappedIntRect(clip_rect.Rect()); 1238 IntRect snapped_clip_rect = PixelSnappedIntRect(clip_rect.Rect());
1229 LayoutObjectDrawingRecorder drawing_recorder( 1239 LayoutObjectDrawingRecorder drawing_recorder(
1230 context, layout_object, kPaintPhaseClippingMask, snapped_clip_rect); 1240 context, layout_object, kPaintPhaseClippingMask, snapped_clip_rect);
1231 context.FillRect(snapped_clip_rect, Color::kBlack); 1241 context.FillRect(snapped_clip_rect, Color::kBlack);
1232 } 1242 }
1233 1243
1234 } // namespace blink 1244 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/compositing/squashing/squash-transformed-with-clip-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698