| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |