OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple Inc. All rights reserved. |
3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 12 matching lines...) Expand all Loading... |
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
25 */ | 25 */ |
26 | 26 |
27 #include "config.h" | 27 #include "config.h" |
28 | 28 |
29 #include "core/rendering/FilterEffectRenderer.h" | 29 #include "core/rendering/FilterEffectRenderer.h" |
30 | 30 |
31 #include "SVGNames.h" | 31 #include "SVGNames.h" |
32 #include "core/dom/Document.h" | 32 #include "core/dom/Document.h" |
33 #include "core/loader/cache/CachedSVGDocument.h" | 33 #include "core/loader/cache/CachedDocument.h" |
34 #include "core/loader/cache/CachedSVGDocumentReference.h" | 34 #include "core/loader/cache/CachedSVGDocumentReference.h" |
35 #include "core/platform/FloatConversion.h" | 35 #include "core/platform/FloatConversion.h" |
36 #include "core/platform/graphics/ColorSpace.h" | 36 #include "core/platform/graphics/ColorSpace.h" |
37 #include "core/platform/graphics/filters/FEColorMatrix.h" | 37 #include "core/platform/graphics/filters/FEColorMatrix.h" |
38 #include "core/platform/graphics/filters/FEComponentTransfer.h" | 38 #include "core/platform/graphics/filters/FEComponentTransfer.h" |
39 #include "core/platform/graphics/filters/FEDropShadow.h" | 39 #include "core/platform/graphics/filters/FEDropShadow.h" |
40 #include "core/platform/graphics/filters/FEGaussianBlur.h" | 40 #include "core/platform/graphics/filters/FEGaussianBlur.h" |
41 #include "core/platform/graphics/filters/FEMerge.h" | 41 #include "core/platform/graphics/filters/FEMerge.h" |
42 #include "core/platform/graphics/filters/SourceAlpha.h" | 42 #include "core/platform/graphics/filters/SourceAlpha.h" |
43 #include "core/platform/graphics/filters/custom/CustomFilterGlobalContext.h" | 43 #include "core/platform/graphics/filters/custom/CustomFilterGlobalContext.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 PassRefPtr<FilterEffect> FilterEffectRenderer::buildReferenceFilter(RenderObject
* renderer, PassRefPtr<FilterEffect> previousEffect, ReferenceFilterOperation* f
ilterOperation) | 114 PassRefPtr<FilterEffect> FilterEffectRenderer::buildReferenceFilter(RenderObject
* renderer, PassRefPtr<FilterEffect> previousEffect, ReferenceFilterOperation* f
ilterOperation) |
115 { | 115 { |
116 if (!renderer) | 116 if (!renderer) |
117 return 0; | 117 return 0; |
118 | 118 |
119 Document* document = renderer->document(); | 119 Document* document = renderer->document(); |
120 ASSERT(document); | 120 ASSERT(document); |
121 | 121 |
122 CachedSVGDocumentReference* cachedSVGDocumentReference = filterOperation->ca
chedSVGDocumentReference(); | 122 CachedSVGDocumentReference* cachedSVGDocumentReference = filterOperation->ca
chedSVGDocumentReference(); |
123 CachedSVGDocument* cachedSVGDocument = cachedSVGDocumentReference ? cachedSV
GDocumentReference->document() : 0; | 123 CachedDocument* cachedSVGDocument = cachedSVGDocumentReference ? cachedSVGDo
cumentReference->document() : 0; |
124 | 124 |
125 // If we have an SVG document, this is an external reference. Otherwise | 125 // If we have an SVG document, this is an external reference. Otherwise |
126 // we look up the referenced node in the current document. | 126 // we look up the referenced node in the current document. |
127 if (cachedSVGDocument) | 127 if (cachedSVGDocument) |
128 document = cachedSVGDocument->document(); | 128 document = cachedSVGDocument->document(); |
129 | 129 |
130 if (!document) | 130 if (!document) |
131 return 0; | 131 return 0; |
132 | 132 |
133 Element* filter = document->getElementById(filterOperation->fragment()); | 133 Element* filter = document->getElementById(filterOperation->fragment()); |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 // Get the filtered output and draw it in place. | 493 // Get the filtered output and draw it in place. |
494 m_savedGraphicsContext->drawImageBuffer(filter->output(), m_renderLayer->ren
derer()->style()->colorSpace(), filter->outputRect(), CompositeSourceOver); | 494 m_savedGraphicsContext->drawImageBuffer(filter->output(), m_renderLayer->ren
derer()->style()->colorSpace(), filter->outputRect(), CompositeSourceOver); |
495 | 495 |
496 filter->clearIntermediateResults(); | 496 filter->clearIntermediateResults(); |
497 | 497 |
498 return m_savedGraphicsContext; | 498 return m_savedGraphicsContext; |
499 } | 499 } |
500 | 500 |
501 } // namespace WebCore | 501 } // namespace WebCore |
502 | 502 |
OLD | NEW |