OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 2 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 30 matching lines...) Expand all Loading... |
41 | 41 |
42 if (m_builtinEffects.contains(id)) | 42 if (m_builtinEffects.contains(id)) |
43 return; | 43 return; |
44 | 44 |
45 m_lastEffect = effect; | 45 m_lastEffect = effect; |
46 m_namedEffects.set(id, m_lastEffect); | 46 m_namedEffects.set(id, m_lastEffect); |
47 } | 47 } |
48 | 48 |
49 FilterEffect* SVGFilterBuilder::getEffectById(const AtomicString& id) const | 49 FilterEffect* SVGFilterBuilder::getEffectById(const AtomicString& id) const |
50 { | 50 { |
51 if (id.isEmpty()) { | 51 if (!id.isEmpty()) { |
52 if (m_lastEffect) | 52 if (FilterEffect* builtinEffect = m_builtinEffects.get(id)) |
53 return m_lastEffect.get(); | 53 return builtinEffect; |
54 | 54 |
55 return m_builtinEffects.get(SourceGraphic::effectName()); | 55 if (FilterEffect* namedEffect = m_namedEffects.get(id)) |
| 56 return namedEffect; |
56 } | 57 } |
57 | 58 |
58 if (m_builtinEffects.contains(id)) | 59 if (m_lastEffect) |
59 return m_builtinEffects.get(id); | 60 return m_lastEffect.get(); |
60 | 61 |
61 return m_namedEffects.get(id); | 62 return m_builtinEffects.get(SourceGraphic::effectName()); |
62 } | 63 } |
63 | 64 |
64 void SVGFilterBuilder::appendEffectToEffectReferences(PassRefPtr<FilterEffect> p
rpEffect, RenderObject* object) | 65 void SVGFilterBuilder::appendEffectToEffectReferences(PassRefPtr<FilterEffect> p
rpEffect, RenderObject* object) |
65 { | 66 { |
66 RefPtr<FilterEffect> effect = prpEffect; | 67 RefPtr<FilterEffect> effect = prpEffect; |
67 | 68 |
68 // The effect must be a newly created filter effect. | 69 // The effect must be a newly created filter effect. |
69 ASSERT(!m_effectReferences.contains(effect)); | 70 ASSERT(!m_effectReferences.contains(effect)); |
70 ASSERT(object && !m_effectRenderer.contains(object)); | 71 ASSERT(object && !m_effectRenderer.contains(object)); |
71 m_effectReferences.add(effect, FilterEffectSet()); | 72 m_effectReferences.add(effect, FilterEffectSet()); |
(...skipping 22 matching lines...) Expand all Loading... |
94 | 95 |
95 effect->clearResult(); | 96 effect->clearResult(); |
96 | 97 |
97 HashSet<FilterEffect*>& effectReferences = this->effectReferences(effect); | 98 HashSet<FilterEffect*>& effectReferences = this->effectReferences(effect); |
98 HashSet<FilterEffect*>::iterator end = effectReferences.end(); | 99 HashSet<FilterEffect*>::iterator end = effectReferences.end(); |
99 for (HashSet<FilterEffect*>::iterator it = effectReferences.begin(); it != e
nd; ++it) | 100 for (HashSet<FilterEffect*>::iterator it = effectReferences.begin(); it != e
nd; ++it) |
100 clearResultsRecursive(*it); | 101 clearResultsRecursive(*it); |
101 } | 102 } |
102 | 103 |
103 } // namespace blink | 104 } // namespace blink |
OLD | NEW |