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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && | 260 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && |
261 RuntimeEnabledFeatures::rootLayerScrollingEnabled() && | 261 RuntimeEnabledFeatures::rootLayerScrollingEnabled() && |
262 m_paintLayer.layoutObject() && | 262 m_paintLayer.layoutObject() && |
263 m_paintLayer.layoutObject()->isLayoutView()) { | 263 m_paintLayer.layoutObject()->isLayoutView()) { |
264 const auto* objectPaintProperties = | 264 const auto* objectPaintProperties = |
265 m_paintLayer.layoutObject()->paintProperties(); | 265 m_paintLayer.layoutObject()->paintProperties(); |
266 DCHECK(objectPaintProperties && | 266 DCHECK(objectPaintProperties && |
267 objectPaintProperties->localBorderBoxProperties()); | 267 objectPaintProperties->localBorderBoxProperties()); |
268 PaintChunkProperties properties( | 268 PaintChunkProperties properties( |
269 context.getPaintController().currentPaintChunkProperties()); | 269 context.getPaintController().currentPaintChunkProperties()); |
270 auto& localBorderBoxProperties = | 270 properties.propertyTreeState = |
271 *objectPaintProperties->localBorderBoxProperties(); | 271 *objectPaintProperties->localBorderBoxProperties(); |
272 properties.propertyTreeState = localBorderBoxProperties.propertyTreeState; | |
273 properties.backfaceHidden = | 272 properties.backfaceHidden = |
274 m_paintLayer.layoutObject()->hasHiddenBackface(); | 273 m_paintLayer.layoutObject()->hasHiddenBackface(); |
275 scopedPaintChunkProperties.emplace(context.getPaintController(), | 274 scopedPaintChunkProperties.emplace(context.getPaintController(), |
276 m_paintLayer, properties); | 275 m_paintLayer, properties); |
277 } | 276 } |
278 | 277 |
279 DCHECK(m_paintLayer.isSelfPaintingLayer() || | 278 DCHECK(m_paintLayer.isSelfPaintingLayer() || |
280 m_paintLayer.hasSelfPaintingLayerDescendant()); | 279 m_paintLayer.hasSelfPaintingLayerDescendant()); |
281 DCHECK(!(paintFlags & PaintLayerAppliedTransform)); | 280 DCHECK(!(paintFlags & PaintLayerAppliedTransform)); |
282 | 281 |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 // the top of this method, in scopedPaintChunkProperties. | 496 // the top of this method, in scopedPaintChunkProperties. |
498 DCHECK(!(RuntimeEnabledFeatures::rootLayerScrollingEnabled() && | 497 DCHECK(!(RuntimeEnabledFeatures::rootLayerScrollingEnabled() && |
499 m_paintLayer.layoutObject() && | 498 m_paintLayer.layoutObject() && |
500 m_paintLayer.layoutObject()->isLayoutView())); | 499 m_paintLayer.layoutObject()->isLayoutView())); |
501 const auto* objectPaintProperties = | 500 const auto* objectPaintProperties = |
502 m_paintLayer.layoutObject()->paintProperties(); | 501 m_paintLayer.layoutObject()->paintProperties(); |
503 DCHECK(objectPaintProperties && | 502 DCHECK(objectPaintProperties && |
504 objectPaintProperties->localBorderBoxProperties()); | 503 objectPaintProperties->localBorderBoxProperties()); |
505 PaintChunkProperties properties( | 504 PaintChunkProperties properties( |
506 context.getPaintController().currentPaintChunkProperties()); | 505 context.getPaintController().currentPaintChunkProperties()); |
507 auto& localBorderBoxProperties = | 506 properties.propertyTreeState = |
508 *objectPaintProperties->localBorderBoxProperties(); | 507 *objectPaintProperties->localBorderBoxProperties(); |
509 properties.propertyTreeState = localBorderBoxProperties.propertyTreeState; | |
510 properties.backfaceHidden = | 508 properties.backfaceHidden = |
511 m_paintLayer.layoutObject()->hasHiddenBackface(); | 509 m_paintLayer.layoutObject()->hasHiddenBackface(); |
512 contentScopedPaintChunkProperties.emplace(context.getPaintController(), | 510 contentScopedPaintChunkProperties.emplace(context.getPaintController(), |
513 m_paintLayer, properties); | 511 m_paintLayer, properties); |
514 } | 512 } |
515 | 513 |
516 bool isPaintingRootLayer = (&m_paintLayer) == paintingInfo.rootLayer; | 514 bool isPaintingRootLayer = (&m_paintLayer) == paintingInfo.rootLayer; |
517 bool shouldPaintBackground = | 515 bool shouldPaintBackground = |
518 shouldPaintContent && !selectionOnly && | 516 shouldPaintContent && !selectionOnly && |
519 (isPaintingCompositedBackground || | 517 (isPaintingCompositedBackground || |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
959 } | 957 } |
960 | 958 |
961 LayoutRect newCullRect(clipRect.rect()); | 959 LayoutRect newCullRect(clipRect.rect()); |
962 Optional<ScrollRecorder> scrollRecorder; | 960 Optional<ScrollRecorder> scrollRecorder; |
963 LayoutPoint paintOffset = -m_paintLayer.layoutBoxLocation(); | 961 LayoutPoint paintOffset = -m_paintLayer.layoutBoxLocation(); |
964 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 962 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
965 const auto* objectPaintProperties = | 963 const auto* objectPaintProperties = |
966 m_paintLayer.layoutObject()->paintProperties(); | 964 m_paintLayer.layoutObject()->paintProperties(); |
967 DCHECK(objectPaintProperties && | 965 DCHECK(objectPaintProperties && |
968 objectPaintProperties->localBorderBoxProperties()); | 966 objectPaintProperties->localBorderBoxProperties()); |
969 paintOffset += | 967 paintOffset += m_paintLayer.layoutObject()->paintOffset(); |
970 toSize(objectPaintProperties->localBorderBoxProperties()->paintOffset); | |
971 newCullRect.move(paintingInfo.scrollOffsetAccumulation); | 968 newCullRect.move(paintingInfo.scrollOffsetAccumulation); |
972 } else { | 969 } else { |
973 paintOffset += toSize(fragment.layerBounds.location()); | 970 paintOffset += toSize(fragment.layerBounds.location()); |
974 if (!paintingInfo.scrollOffsetAccumulation.isZero()) { | 971 if (!paintingInfo.scrollOffsetAccumulation.isZero()) { |
975 // As a descendant of the root layer, m_paintLayer's painting is not | 972 // As a descendant of the root layer, m_paintLayer's painting is not |
976 // controlled by the ScrollRecorders created by BlockPainter of the | 973 // controlled by the ScrollRecorders created by BlockPainter of the |
977 // ancestor layers up to the root layer, so we need to issue | 974 // ancestor layers up to the root layer, so we need to issue |
978 // ScrollRecorder for this layer seperately, with the scroll offset | 975 // ScrollRecorder for this layer seperately, with the scroll offset |
979 // accumulated from the root layer to the parent of this layer, to get the | 976 // accumulated from the root layer to the parent of this layer, to get the |
980 // same result as ScrollRecorder in BlockPainter. | 977 // same result as ScrollRecorder in BlockPainter. |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1181 context, *layoutBox, PaintPhaseClippingMask)) | 1178 context, *layoutBox, PaintPhaseClippingMask)) |
1182 return; | 1179 return; |
1183 | 1180 |
1184 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect()); | 1181 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect()); |
1185 LayoutObjectDrawingRecorder drawingRecorder( | 1182 LayoutObjectDrawingRecorder drawingRecorder( |
1186 context, *layoutBox, PaintPhaseClippingMask, snappedClipRect); | 1183 context, *layoutBox, PaintPhaseClippingMask, snappedClipRect); |
1187 context.fillRect(snappedClipRect, Color::black); | 1184 context.fillRect(snappedClipRect, Color::black); |
1188 } | 1185 } |
1189 | 1186 |
1190 } // namespace blink | 1187 } // namespace blink |
OLD | NEW |