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 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
743 if (parentLayer) { | 743 if (parentLayer) { |
744 // Calculate the clip rectangle that the ancestors establish. | 744 // Calculate the clip rectangle that the ancestors establish. |
745 ClipRectsContext clipRectsContext( | 745 ClipRectsContext clipRectsContext( |
746 paintingInfo.rootLayer, | 746 paintingInfo.rootLayer, |
747 (paintFlags & PaintLayerUncachedClipRects) ? UncachedClipRects | 747 (paintFlags & PaintLayerUncachedClipRects) ? UncachedClipRects |
748 : PaintingClipRects, | 748 : PaintingClipRects, |
749 IgnoreOverlayScrollbarSize); | 749 IgnoreOverlayScrollbarSize); |
750 if (shouldRespectOverflowClip(paintFlags, m_paintLayer.layoutObject()) == | 750 if (shouldRespectOverflowClip(paintFlags, m_paintLayer.layoutObject()) == |
751 IgnoreOverflowClip) | 751 IgnoreOverflowClip) |
752 clipRectsContext.setIgnoreOverflowClip(); | 752 clipRectsContext.setIgnoreOverflowClip(); |
753 m_paintLayer.clipper(geometryMapperOption) | 753 ancestorBackgroundClipRect = m_paintLayer.clipper(geometryMapperOption) |
754 .calculateBackgroundClipRect(clipRectsContext, | 754 .backgroundClipRect(clipRectsContext); |
755 ancestorBackgroundClipRect); | |
756 } | 755 } |
757 } | 756 } |
758 | 757 |
759 PaintResult result = FullyPainted; | 758 PaintResult result = FullyPainted; |
760 for (const auto& fragment : layerFragments) { | 759 for (const auto& fragment : layerFragments) { |
761 Optional<LayerClipRecorder> clipRecorder; | 760 Optional<LayerClipRecorder> clipRecorder; |
762 if (parentLayer && !RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 761 if (parentLayer && !RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
763 ClipRect clipRectForFragment(ancestorBackgroundClipRect); | 762 ClipRect clipRectForFragment(ancestorBackgroundClipRect); |
764 // A fixed-position object is repeated on every page instead of paginated, | 763 // A fixed-position object is repeated on every page instead of paginated, |
765 // so we should apply the original ancestor clip rect. | 764 // so we should apply the original ancestor clip rect. |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1209 context, layoutObject, PaintPhaseClippingMask)) | 1208 context, layoutObject, PaintPhaseClippingMask)) |
1210 return; | 1209 return; |
1211 | 1210 |
1212 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect()); | 1211 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect()); |
1213 LayoutObjectDrawingRecorder drawingRecorder( | 1212 LayoutObjectDrawingRecorder drawingRecorder( |
1214 context, layoutObject, PaintPhaseClippingMask, snappedClipRect); | 1213 context, layoutObject, PaintPhaseClippingMask, snappedClipRect); |
1215 context.fillRect(snappedClipRect, Color::black); | 1214 context.fillRect(snappedClipRect, Color::black); |
1216 } | 1215 } |
1217 | 1216 |
1218 } // namespace blink | 1217 } // namespace blink |
OLD | NEW |