| 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 = paintProperties ? paintProperties->e
ffect() : nullptr; |
| 73 if (!effect) |
| 74 return true; |
| 75 |
| 76 auto& paintController = paintInfo().context.getPaintController(); |
| 77 PaintChunkProperties properties(paintController.currentPaintChunkProperties(
)); |
| 78 properties.effect = effect; |
| 79 m_scopedPaintChunkProperties.emplace(paintController, m_object, properties); |
| 80 return true; |
| 81 } |
| 82 |
| 65 // When rendering clip paths as masks, only geometric operations should be | 83 // When rendering clip paths as masks, only geometric operations should be |
| 66 // included so skip non-geometric operations such as compositing, masking, and | 84 // included so skip non-geometric operations such as compositing, masking, and |
| 67 // filtering. | 85 // filtering. |
| 68 if (paintInfo().isRenderingClipPathAsMaskImage()) { | 86 if (paintInfo().isRenderingClipPathAsMaskImage()) { |
| 69 DCHECK(!m_object.isSVGRoot()); | 87 DCHECK(!m_object.isSVGRoot()); |
| 70 applyClipIfNecessary(); | 88 applyClipIfNecessary(); |
| 71 return true; | 89 return true; |
| 72 } | 90 } |
| 73 | 91 |
| 74 bool isSVGRoot = m_object.isSVGRoot(); | 92 bool isSVGRoot = m_object.isSVGRoot(); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 // though. | 259 // though. |
| 242 // Additionally, it's not really safe/guaranteed to be correct, as | 260 // Additionally, it's not really safe/guaranteed to be correct, as |
| 243 // something down the paint pipe may want to farther tweak the color | 261 // something down the paint pipe may want to farther tweak the color |
| 244 // filter, which could yield incorrect results. (Consider just using | 262 // filter, which could yield incorrect results. (Consider just using |
| 245 // saveLayer() w/ this color filter explicitly instead.) | 263 // saveLayer() w/ this color filter explicitly instead.) |
| 246 paint.setColorFilter(sk_ref_sp(paintInfo.context.getColorFilter())); | 264 paint.setColorFilter(sk_ref_sp(paintInfo.context.getColorFilter())); |
| 247 return true; | 265 return true; |
| 248 } | 266 } |
| 249 | 267 |
| 250 } // namespace blink | 268 } // namespace blink |
| OLD | NEW |