Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: Source/core/svg/graphics/filters/SVGFilterBuilder.h

Issue 1056353003: Derive the SourceAlpha filter input from SourceGraphic (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix variable name. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Alex Mathews <possessedpenguinbob@gmail.com> 2 * Copyright (C) 2008 Alex Mathews <possessedpenguinbob@gmail.com>
3 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 3 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 19 matching lines...) Expand all
30 #include "wtf/text/WTFString.h" 30 #include "wtf/text/WTFString.h"
31 31
32 namespace blink { 32 namespace blink {
33 33
34 class LayoutObject; 34 class LayoutObject;
35 35
36 class SVGFilterBuilder final : public RefCountedWillBeGarbageCollectedFinalized< SVGFilterBuilder> { 36 class SVGFilterBuilder final : public RefCountedWillBeGarbageCollectedFinalized< SVGFilterBuilder> {
37 public: 37 public:
38 typedef WillBeHeapHashSet<RawPtrWillBeMember<FilterEffect>> FilterEffectSet; 38 typedef WillBeHeapHashSet<RawPtrWillBeMember<FilterEffect>> FilterEffectSet;
39 39
40 static PassRefPtrWillBeRawPtr<SVGFilterBuilder> create(PassRefPtrWillBeRawPt r<FilterEffect> sourceGraphic, PassRefPtrWillBeRawPtr<FilterEffect> sourceAlpha) 40 static PassRefPtrWillBeRawPtr<SVGFilterBuilder> create(PassRefPtrWillBeRawPt r<FilterEffect> sourceGraphic)
41 { 41 {
42 return adoptRefWillBeNoop(new SVGFilterBuilder(sourceGraphic, sourceAlph a)); 42 return adoptRefWillBeNoop(new SVGFilterBuilder(sourceGraphic));
43 } 43 }
44 44
45 void add(const AtomicString& id, PassRefPtrWillBeRawPtr<FilterEffect>); 45 void add(const AtomicString& id, PassRefPtrWillBeRawPtr<FilterEffect>);
46 46
47 FilterEffect* getEffectById(const AtomicString& id) const; 47 FilterEffect* getEffectById(const AtomicString& id) const;
48 FilterEffect* lastEffect() const { return m_lastEffect.get(); } 48 FilterEffect* lastEffect() const { return m_lastEffect.get(); }
49 49
50 void appendEffectToEffectReferences(PassRefPtrWillBeRawPtr<FilterEffect>, La youtObject*); 50 void appendEffectToEffectReferences(PassRefPtrWillBeRawPtr<FilterEffect>, La youtObject*);
51 51
52 inline FilterEffectSet& effectReferences(FilterEffect* effect) 52 inline FilterEffectSet& effectReferences(FilterEffect* effect)
53 { 53 {
54 // Only allowed for effects belongs to this builder. 54 // Only allowed for effects belongs to this builder.
55 ASSERT(m_effectReferences.contains(effect)); 55 ASSERT(m_effectReferences.contains(effect));
56 return m_effectReferences.find(effect)->value; 56 return m_effectReferences.find(effect)->value;
57 } 57 }
58 58
59 // Required to change the attributes of a filter during an svgAttributeChang ed. 59 // Required to change the attributes of a filter during an svgAttributeChang ed.
60 inline FilterEffect* effectByRenderer(LayoutObject* object) { return m_effec tRenderer.get(object); } 60 inline FilterEffect* effectByRenderer(LayoutObject* object) { return m_effec tRenderer.get(object); }
61 61
62 void clearEffects(); 62 void clearEffects();
63 void clearResultsRecursive(FilterEffect*); 63 void clearResultsRecursive(FilterEffect*);
64 64
65 DECLARE_TRACE(); 65 DECLARE_TRACE();
66 66
67 private: 67 private:
68 SVGFilterBuilder(PassRefPtrWillBeRawPtr<FilterEffect> sourceGraphic, PassRef PtrWillBeRawPtr<FilterEffect> sourceAlpha); 68 SVGFilterBuilder(PassRefPtrWillBeRawPtr<FilterEffect> sourceGraphic);
69 69
70 inline void addBuiltinEffects() 70 inline void addBuiltinEffects()
71 { 71 {
72 for (const auto& entry : m_builtinEffects) 72 for (const auto& entry : m_builtinEffects)
73 m_effectReferences.add(entry.value, FilterEffectSet()); 73 m_effectReferences.add(entry.value, FilterEffectSet());
74 } 74 }
75 75
76 typedef WillBeHeapHashMap<AtomicString, RefPtrWillBeMember<FilterEffect>> Na medFilterEffectMap; 76 typedef WillBeHeapHashMap<AtomicString, RefPtrWillBeMember<FilterEffect>> Na medFilterEffectMap;
77 77
78 NamedFilterEffectMap m_builtinEffects; 78 NamedFilterEffectMap m_builtinEffects;
79 NamedFilterEffectMap m_namedEffects; 79 NamedFilterEffectMap m_namedEffects;
80 // The value is a list, which contains those filter effects, 80 // The value is a list, which contains those filter effects,
81 // which depends on the key filter effect. 81 // which depends on the key filter effect.
82 WillBeHeapHashMap<RefPtrWillBeMember<FilterEffect>, FilterEffectSet> m_effec tReferences; 82 WillBeHeapHashMap<RefPtrWillBeMember<FilterEffect>, FilterEffectSet> m_effec tReferences;
83 WillBeHeapHashMap<LayoutObject*, RawPtrWillBeMember<FilterEffect>> m_effectR enderer; 83 WillBeHeapHashMap<LayoutObject*, RawPtrWillBeMember<FilterEffect>> m_effectR enderer;
84 84
85 RefPtrWillBeMember<FilterEffect> m_lastEffect; 85 RefPtrWillBeMember<FilterEffect> m_lastEffect;
86 }; 86 };
87 87
88 } // namespace blink 88 } // namespace blink
89 89
90 #endif // SVGFilterBuilder_h 90 #endif // SVGFilterBuilder_h
OLDNEW
« no previous file with comments | « Source/core/paint/SVGFilterPainter.cpp ('k') | Source/core/svg/graphics/filters/SVGFilterBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698