OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2005 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2005 Eric Seidel <eric@webkit.org> |
5 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 5 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 } | 78 } |
79 | 79 |
80 PassRefPtrWillBeRawPtr<SVGFilterBuilder> LayoutSVGResourceFilter::buildPrimitive
s(SVGFilter* filter) | 80 PassRefPtrWillBeRawPtr<SVGFilterBuilder> LayoutSVGResourceFilter::buildPrimitive
s(SVGFilter* filter) |
81 { | 81 { |
82 SVGFilterElement* filterElement = toSVGFilterElement(element()); | 82 SVGFilterElement* filterElement = toSVGFilterElement(element()); |
83 FloatRect targetBoundingBox = filter->targetBoundingBox(); | 83 FloatRect targetBoundingBox = filter->targetBoundingBox(); |
84 | 84 |
85 // Add effects to the builder | 85 // Add effects to the builder |
86 RefPtrWillBeRawPtr<SVGFilterBuilder> builder = SVGFilterBuilder::create(Sour
ceGraphic::create(filter), SourceAlpha::create(filter)); | 86 RefPtrWillBeRawPtr<SVGFilterBuilder> builder = SVGFilterBuilder::create(Sour
ceGraphic::create(filter), SourceAlpha::create(filter)); |
87 for (SVGElement* element = Traversal<SVGElement>::firstChild(*filterElement)
; element; element = Traversal<SVGElement>::nextSibling(*element)) { | 87 for (SVGElement* element = Traversal<SVGElement>::firstChild(*filterElement)
; element; element = Traversal<SVGElement>::nextSibling(*element)) { |
88 if (!element->isFilterEffect() || !element->renderer()) | 88 if (!element->isFilterEffect() || !element->layoutObject()) |
89 continue; | 89 continue; |
90 | 90 |
91 SVGFilterPrimitiveStandardAttributes* effectElement = static_cast<SVGFil
terPrimitiveStandardAttributes*>(element); | 91 SVGFilterPrimitiveStandardAttributes* effectElement = static_cast<SVGFil
terPrimitiveStandardAttributes*>(element); |
92 RefPtrWillBeRawPtr<FilterEffect> effect = effectElement->build(builder.g
et(), filter); | 92 RefPtrWillBeRawPtr<FilterEffect> effect = effectElement->build(builder.g
et(), filter); |
93 if (!effect) { | 93 if (!effect) { |
94 builder->clearEffects(); | 94 builder->clearEffects(); |
95 return nullptr; | 95 return nullptr; |
96 } | 96 } |
97 builder->appendEffectToEffectReferences(effect, effectElement->renderer(
)); | 97 builder->appendEffectToEffectReferences(effect, effectElement->layoutObj
ect()); |
98 effectElement->setStandardAttributes(effect.get()); | 98 effectElement->setStandardAttributes(effect.get()); |
99 effect->setEffectBoundaries(SVGLengthContext::resolveRectangle<SVGFilter
PrimitiveStandardAttributes>(effectElement, filterElement->primitiveUnits()->cur
rentValue()->enumValue(), targetBoundingBox)); | 99 effect->setEffectBoundaries(SVGLengthContext::resolveRectangle<SVGFilter
PrimitiveStandardAttributes>(effectElement, filterElement->primitiveUnits()->cur
rentValue()->enumValue(), targetBoundingBox)); |
100 effect->setOperatingColorSpace( | 100 effect->setOperatingColorSpace( |
101 effectElement->renderer()->style()->svgStyle().colorInterpolationFil
ters() == CI_LINEARRGB ? ColorSpaceLinearRGB : ColorSpaceDeviceRGB); | 101 effectElement->layoutObject()->style()->svgStyle().colorInterpolatio
nFilters() == CI_LINEARRGB ? ColorSpaceLinearRGB : ColorSpaceDeviceRGB); |
102 builder->add(AtomicString(effectElement->result()->currentValue()->value
()), effect); | 102 builder->add(AtomicString(effectElement->result()->currentValue()->value
()), effect); |
103 } | 103 } |
104 return builder.release(); | 104 return builder.release(); |
105 } | 105 } |
106 | 106 |
107 static GraphicsContext* beginRecordingContent(GraphicsContext* context, FilterDa
ta* filterData) | 107 static GraphicsContext* beginRecordingContent(GraphicsContext* context, FilterDa
ta* filterData) |
108 { | 108 { |
109 ASSERT(filterData->m_state == FilterData::Initial); | 109 ASSERT(filterData->m_state == FilterData::Initial); |
110 | 110 |
111 // For slimming paint we need to create a new context so the contents of the | 111 // For slimming paint we need to create a new context so the contents of the |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 return; | 306 return; |
307 builder->clearResultsRecursive(effect); | 307 builder->clearResultsRecursive(effect); |
308 | 308 |
309 // Issue paint invalidations for the image on the screen. | 309 // Issue paint invalidations for the image on the screen. |
310 markClientForInvalidation(it->key, PaintInvalidation); | 310 markClientForInvalidation(it->key, PaintInvalidation); |
311 } | 311 } |
312 markAllClientLayersForInvalidation(); | 312 markAllClientLayersForInvalidation(); |
313 } | 313 } |
314 | 314 |
315 } | 315 } |
OLD | NEW |