OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Rob Buis <buis@kde.org> | 2 * Copyright (C) 2007, 2008 Rob Buis <buis@kde.org> |
3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
5 * Copyright (C) 2009 Google, Inc. All rights reserved. | 5 * Copyright (C) 2009 Google, Inc. All rights reserved. |
6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 SVGMaskPainter(*m_masker).finishEffect(m_object, paintInfo().context); | 55 SVGMaskPainter(*m_masker).finishEffect(m_object, paintInfo().context); |
56 } | 56 } |
57 } | 57 } |
58 | 58 |
59 bool SVGPaintContext::applyClipMaskAndFilterIfNecessary() { | 59 bool SVGPaintContext::applyClipMaskAndFilterIfNecessary() { |
60 #if ENABLE(ASSERT) | 60 #if ENABLE(ASSERT) |
61 DCHECK(!m_applyClipMaskAndFilterIfNecessaryCalled); | 61 DCHECK(!m_applyClipMaskAndFilterIfNecessaryCalled); |
62 m_applyClipMaskAndFilterIfNecessaryCalled = true; | 62 m_applyClipMaskAndFilterIfNecessaryCalled = true; |
63 #endif | 63 #endif |
64 | 64 |
| 65 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| 66 // SVGRoot works like normal CSS replaced element and its effects are |
| 67 // applied as stacking context effect by PaintLayerPainter. |
| 68 if (m_object.isSVGRoot()) |
| 69 return true; |
| 70 |
| 71 const auto* paintProperties = m_object.paintProperties(); |
| 72 const EffectPaintPropertyNode* effect = |
| 73 paintProperties ? paintProperties->effect() : nullptr; |
| 74 if (!effect) |
| 75 return true; |
| 76 |
| 77 auto& paintController = paintInfo().context.getPaintController(); |
| 78 PaintChunkProperties properties( |
| 79 paintController.currentPaintChunkProperties()); |
| 80 properties.propertyTreeState.setEffect(effect); |
| 81 m_scopedPaintChunkProperties.emplace(paintController, m_object, properties); |
| 82 return true; |
| 83 } |
| 84 |
65 // When rendering clip paths as masks, only geometric operations should be | 85 // When rendering clip paths as masks, only geometric operations should be |
66 // included so skip non-geometric operations such as compositing, masking, and | 86 // included so skip non-geometric operations such as compositing, masking, and |
67 // filtering. | 87 // filtering. |
68 if (paintInfo().isRenderingClipPathAsMaskImage()) { | 88 if (paintInfo().isRenderingClipPathAsMaskImage()) { |
69 DCHECK(!m_object.isSVGRoot()); | 89 DCHECK(!m_object.isSVGRoot()); |
70 applyClipIfNecessary(); | 90 applyClipIfNecessary(); |
71 return true; | 91 return true; |
72 } | 92 } |
73 | 93 |
74 bool isSVGRoot = m_object.isSVGRoot(); | 94 bool isSVGRoot = m_object.isSVGRoot(); |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 // though. | 261 // though. |
242 // Additionally, it's not really safe/guaranteed to be correct, as | 262 // Additionally, it's not really safe/guaranteed to be correct, as |
243 // something down the paint pipe may want to farther tweak the color | 263 // something down the paint pipe may want to farther tweak the color |
244 // filter, which could yield incorrect results. (Consider just using | 264 // filter, which could yield incorrect results. (Consider just using |
245 // saveLayer() w/ this color filter explicitly instead.) | 265 // saveLayer() w/ this color filter explicitly instead.) |
246 paint.setColorFilter(sk_ref_sp(paintInfo.context.getColorFilter())); | 266 paint.setColorFilter(sk_ref_sp(paintInfo.context.getColorFilter())); |
247 return true; | 267 return true; |
248 } | 268 } |
249 | 269 |
250 } // namespace blink | 270 } // namespace blink |
OLD | NEW |