| 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 | 259 |
| 260 PaintResult PaintLayerPainter::paintLayerContents( | 260 PaintResult PaintLayerPainter::paintLayerContents( |
| 261 GraphicsContext& context, | 261 GraphicsContext& context, |
| 262 const PaintLayerPaintingInfo& paintingInfoArg, | 262 const PaintLayerPaintingInfo& paintingInfoArg, |
| 263 PaintLayerFlags paintFlags, | 263 PaintLayerFlags paintFlags, |
| 264 FragmentPolicy fragmentPolicy) { | 264 FragmentPolicy fragmentPolicy) { |
| 265 Optional<ScopedPaintChunkProperties> scopedPaintChunkProperties; | 265 Optional<ScopedPaintChunkProperties> scopedPaintChunkProperties; |
| 266 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && | 266 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && |
| 267 RuntimeEnabledFeatures::rootLayerScrollingEnabled() && | 267 RuntimeEnabledFeatures::rootLayerScrollingEnabled() && |
| 268 m_paintLayer.layoutObject().isLayoutView()) { | 268 m_paintLayer.layoutObject().isLayoutView()) { |
| 269 const auto* objectPaintProperties = | 269 const auto* localBorderBoxProperties = |
| 270 m_paintLayer.layoutObject().paintProperties(); | 270 m_paintLayer.layoutObject().localBorderBoxProperties(); |
| 271 DCHECK(objectPaintProperties && | 271 DCHECK(localBorderBoxProperties); |
| 272 objectPaintProperties->localBorderBoxProperties()); | |
| 273 PaintChunkProperties properties( | 272 PaintChunkProperties properties( |
| 274 context.getPaintController().currentPaintChunkProperties()); | 273 context.getPaintController().currentPaintChunkProperties()); |
| 275 properties.propertyTreeState = | 274 properties.propertyTreeState = *localBorderBoxProperties; |
| 276 *objectPaintProperties->localBorderBoxProperties(); | |
| 277 properties.backfaceHidden = m_paintLayer.layoutObject().hasHiddenBackface(); | 275 properties.backfaceHidden = m_paintLayer.layoutObject().hasHiddenBackface(); |
| 278 scopedPaintChunkProperties.emplace(context.getPaintController(), | 276 scopedPaintChunkProperties.emplace(context.getPaintController(), |
| 279 m_paintLayer, properties); | 277 m_paintLayer, properties); |
| 280 } | 278 } |
| 281 | 279 |
| 282 DCHECK(m_paintLayer.isSelfPaintingLayer() || | 280 DCHECK(m_paintLayer.isSelfPaintingLayer() || |
| 283 m_paintLayer.hasSelfPaintingLayerDescendant()); | 281 m_paintLayer.hasSelfPaintingLayerDescendant()); |
| 284 DCHECK(!(paintFlags & PaintLayerAppliedTransform)); | 282 DCHECK(!(paintFlags & PaintLayerAppliedTransform)); |
| 285 | 283 |
| 286 bool isSelfPaintingLayer = m_paintLayer.isSelfPaintingLayer(); | 284 bool isSelfPaintingLayer = m_paintLayer.isSelfPaintingLayer(); |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 } | 486 } |
| 489 | 487 |
| 490 Optional<ScopedPaintChunkProperties> contentScopedPaintChunkProperties; | 488 Optional<ScopedPaintChunkProperties> contentScopedPaintChunkProperties; |
| 491 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && | 489 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && |
| 492 !scopedPaintChunkProperties.has_value()) { | 490 !scopedPaintChunkProperties.has_value()) { |
| 493 // If layoutObject() is a LayoutView and root layer scrolling is enabled, | 491 // If layoutObject() is a LayoutView and root layer scrolling is enabled, |
| 494 // the LayoutView's paint properties will already have been applied at | 492 // the LayoutView's paint properties will already have been applied at |
| 495 // the top of this method, in scopedPaintChunkProperties. | 493 // the top of this method, in scopedPaintChunkProperties. |
| 496 DCHECK(!(RuntimeEnabledFeatures::rootLayerScrollingEnabled() && | 494 DCHECK(!(RuntimeEnabledFeatures::rootLayerScrollingEnabled() && |
| 497 m_paintLayer.layoutObject().isLayoutView())); | 495 m_paintLayer.layoutObject().isLayoutView())); |
| 498 const auto* objectPaintProperties = | 496 const auto* localBorderBoxProperties = |
| 499 m_paintLayer.layoutObject().paintProperties(); | 497 m_paintLayer.layoutObject().localBorderBoxProperties(); |
| 500 DCHECK(objectPaintProperties && | 498 DCHECK(localBorderBoxProperties); |
| 501 objectPaintProperties->localBorderBoxProperties()); | |
| 502 PaintChunkProperties properties( | 499 PaintChunkProperties properties( |
| 503 context.getPaintController().currentPaintChunkProperties()); | 500 context.getPaintController().currentPaintChunkProperties()); |
| 504 properties.propertyTreeState = | 501 properties.propertyTreeState = *localBorderBoxProperties; |
| 505 *objectPaintProperties->localBorderBoxProperties(); | |
| 506 properties.backfaceHidden = m_paintLayer.layoutObject().hasHiddenBackface(); | 502 properties.backfaceHidden = m_paintLayer.layoutObject().hasHiddenBackface(); |
| 507 contentScopedPaintChunkProperties.emplace(context.getPaintController(), | 503 contentScopedPaintChunkProperties.emplace(context.getPaintController(), |
| 508 m_paintLayer, properties); | 504 m_paintLayer, properties); |
| 509 } | 505 } |
| 510 | 506 |
| 511 bool selectionOnly = | 507 bool selectionOnly = |
| 512 localPaintingInfo.getGlobalPaintFlags() & GlobalPaintSelectionOnly; | 508 localPaintingInfo.getGlobalPaintFlags() & GlobalPaintSelectionOnly; |
| 513 { // Begin block for the lifetime of any filter. | 509 { // Begin block for the lifetime of any filter. |
| 514 FilterPainter filterPainter(m_paintLayer, context, offsetFromRoot, | 510 FilterPainter filterPainter(m_paintLayer, context, offsetFromRoot, |
| 515 layerFragments.isEmpty() | 511 layerFragments.isEmpty() |
| (...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1201 context, layoutObject, PaintPhaseClippingMask)) | 1197 context, layoutObject, PaintPhaseClippingMask)) |
| 1202 return; | 1198 return; |
| 1203 | 1199 |
| 1204 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect()); | 1200 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect()); |
| 1205 LayoutObjectDrawingRecorder drawingRecorder( | 1201 LayoutObjectDrawingRecorder drawingRecorder( |
| 1206 context, layoutObject, PaintPhaseClippingMask, snappedClipRect); | 1202 context, layoutObject, PaintPhaseClippingMask, snappedClipRect); |
| 1207 context.fillRect(snappedClipRect, Color::black); | 1203 context.fillRect(snappedClipRect, Color::black); |
| 1208 } | 1204 } |
| 1209 | 1205 |
| 1210 } // namespace blink | 1206 } // namespace blink |
| OLD | NEW |