OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Adobe Systems Inc. All rights reserved. | 2 * Copyright (C) 2013 Adobe Systems Inc. All rights reserved. |
3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
4 * Copyright (C) 2011 Apple Inc. All rights reserved. | 4 * Copyright (C) 2011 Apple Inc. All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 documentResourceReferences->remove(filterOperation); | 68 documentResourceReferences->remove(filterOperation); |
69 } | 69 } |
70 | 70 |
71 // Returns whether or not the SVGElement object contains a valid color-interpola
tion-filters attribute | 71 // Returns whether or not the SVGElement object contains a valid color-interpola
tion-filters attribute |
72 static bool getSVGElementColorSpace(SVGElement* svgElement, ColorSpace& cs) | 72 static bool getSVGElementColorSpace(SVGElement* svgElement, ColorSpace& cs) |
73 { | 73 { |
74 if (!svgElement) | 74 if (!svgElement) |
75 return false; | 75 return false; |
76 | 76 |
77 const LayoutObject* renderer = svgElement->renderer(); | 77 const LayoutObject* renderer = svgElement->layoutObject(); |
78 const LayoutStyle* style = renderer ? renderer->style() : 0; | 78 const LayoutStyle* style = renderer ? renderer->style() : 0; |
79 const SVGLayoutStyle* svgStyle = style ? &style->svgStyle() : 0; | 79 const SVGLayoutStyle* svgStyle = style ? &style->svgStyle() : 0; |
80 EColorInterpolation eColorInterpolation = CI_AUTO; | 80 EColorInterpolation eColorInterpolation = CI_AUTO; |
81 if (svgStyle) { | 81 if (svgStyle) { |
82 // If a layout has been performed, then we can use the fast path to get
this attribute | 82 // If a layout has been performed, then we can use the fast path to get
this attribute |
83 eColorInterpolation = svgStyle->colorInterpolationFilters(); | 83 eColorInterpolation = svgStyle->colorInterpolationFilters(); |
84 } else if (!svgElement->presentationAttributeStyle()) { | 84 } else if (!svgElement->presentationAttributeStyle()) { |
85 return false; | 85 return false; |
86 } else { | 86 } else { |
87 // Otherwise, use the slow path by using string comparison (used by exte
rnal svg files) | 87 // Otherwise, use the slow path by using string comparison (used by exte
rnal svg files) |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 effect->setEffectBoundaries(SVGLengthContext::resolveRectangle<SVGFilter
PrimitiveStandardAttributes>(effectElement, filterElement.primitiveUnits()->curr
entValue()->enumValue(), parentFilter->sourceImageRect())); | 166 effect->setEffectBoundaries(SVGLengthContext::resolveRectangle<SVGFilter
PrimitiveStandardAttributes>(effectElement, filterElement.primitiveUnits()->curr
entValue()->enumValue(), parentFilter->sourceImageRect())); |
167 ColorSpace colorSpace = filterColorSpace; | 167 ColorSpace colorSpace = filterColorSpace; |
168 if (useFilterColorSpace || getSVGElementColorSpace(effectElement, colorS
pace)) | 168 if (useFilterColorSpace || getSVGElementColorSpace(effectElement, colorS
pace)) |
169 effect->setOperatingColorSpace(colorSpace); | 169 effect->setOperatingColorSpace(colorSpace); |
170 builder->add(AtomicString(effectElement->result()->currentValue()->value
()), effect); | 170 builder->add(AtomicString(effectElement->result()->currentValue()->value
()), effect); |
171 } | 171 } |
172 return builder->lastEffect(); | 172 return builder->lastEffect(); |
173 } | 173 } |
174 | 174 |
175 } // namespace blink | 175 } // namespace blink |
OLD | NEW |