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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 static PassOwnPtrWillBeRawPtr<FilterData> create() | 53 static PassOwnPtrWillBeRawPtr<FilterData> create() |
54 { | 54 { |
55 return adoptPtrWillBeNoop(new FilterData()); | 55 return adoptPtrWillBeNoop(new FilterData()); |
56 } | 56 } |
57 | 57 |
58 void dispose(); | 58 void dispose(); |
59 | 59 |
60 DECLARE_TRACE(); | 60 DECLARE_TRACE(); |
61 | 61 |
62 RefPtrWillBeMember<Filter> filter; | 62 RefPtrWillBeMember<Filter> filter; |
63 RefPtrWillBeMember<SVGFilterBuilder> builder; | 63 RefPtrWillBeMember<SVGFilterGraphNodeMap> nodeMap; |
64 FilterDataState m_state; | 64 FilterDataState m_state; |
65 | 65 |
66 private: | 66 private: |
67 FilterData() : m_state(Initial) { } | 67 FilterData() : m_state(Initial) { } |
68 }; | 68 }; |
69 | 69 |
70 class LayoutSVGResourceFilter final : public LayoutSVGResourceContainer { | 70 class LayoutSVGResourceFilter final : public LayoutSVGResourceContainer { |
71 public: | 71 public: |
72 explicit LayoutSVGResourceFilter(SVGFilterElement*); | 72 explicit LayoutSVGResourceFilter(SVGFilterElement*); |
73 ~LayoutSVGResourceFilter() override; | 73 ~LayoutSVGResourceFilter() override; |
74 | 74 |
75 bool isChildAllowed(LayoutObject*, const ComputedStyle&) const override; | 75 bool isChildAllowed(LayoutObject*, const ComputedStyle&) const override; |
76 | 76 |
77 const char* name() const override { return "LayoutSVGResourceFilter"; } | 77 const char* name() const override { return "LayoutSVGResourceFilter"; } |
78 bool isOfType(LayoutObjectType type) const override { return type == LayoutO
bjectSVGResourceFilter || LayoutSVGResourceContainer::isOfType(type); } | 78 bool isOfType(LayoutObjectType type) const override { return type == LayoutO
bjectSVGResourceFilter || LayoutSVGResourceContainer::isOfType(type); } |
79 | 79 |
80 void removeAllClientsFromCache(bool markForInvalidation = true) override; | 80 void removeAllClientsFromCache(bool markForInvalidation = true) override; |
81 void removeClientFromCache(LayoutObject*, bool markForInvalidation = true) o
verride; | 81 void removeClientFromCache(LayoutObject*, bool markForInvalidation = true) o
verride; |
82 | 82 |
83 FloatRect resourceBoundingBox(const LayoutObject*); | 83 FloatRect resourceBoundingBox(const LayoutObject*); |
84 | 84 |
85 PassRefPtrWillBeRawPtr<SVGFilterBuilder> buildPrimitives(Filter*); | |
86 | |
87 SVGUnitTypes::SVGUnitType filterUnits() const { return toSVGFilterElement(el
ement())->filterUnits()->currentValue()->enumValue(); } | 85 SVGUnitTypes::SVGUnitType filterUnits() const { return toSVGFilterElement(el
ement())->filterUnits()->currentValue()->enumValue(); } |
88 SVGUnitTypes::SVGUnitType primitiveUnits() const { return toSVGFilterElement
(element())->primitiveUnits()->currentValue()->enumValue(); } | 86 SVGUnitTypes::SVGUnitType primitiveUnits() const { return toSVGFilterElement
(element())->primitiveUnits()->currentValue()->enumValue(); } |
89 | 87 |
90 void primitiveAttributeChanged(LayoutObject*, const QualifiedName&); | 88 void primitiveAttributeChanged(LayoutObject*, const QualifiedName&); |
91 | 89 |
92 static const LayoutSVGResourceType s_resourceType = FilterResourceType; | 90 static const LayoutSVGResourceType s_resourceType = FilterResourceType; |
93 LayoutSVGResourceType resourceType() const override { return s_resourceType;
} | 91 LayoutSVGResourceType resourceType() const override { return s_resourceType;
} |
94 | 92 |
95 FilterData* getFilterDataForLayoutObject(const LayoutObject* object) { retur
n m_filter.get(const_cast<LayoutObject*>(object)); } | 93 FilterData* getFilterDataForLayoutObject(const LayoutObject* object) { retur
n m_filter.get(const_cast<LayoutObject*>(object)); } |
96 void setFilterDataForLayoutObject(LayoutObject* object, PassOwnPtrWillBeRawP
tr<FilterData> filterData) { m_filter.set(object, filterData); } | 94 void setFilterDataForLayoutObject(LayoutObject* object, PassOwnPtrWillBeRawP
tr<FilterData> filterData) { m_filter.set(object, filterData); } |
97 | 95 |
98 protected: | 96 protected: |
99 void willBeDestroyed() override; | 97 void willBeDestroyed() override; |
100 | 98 |
101 private: | 99 private: |
102 void disposeFilterMap(); | 100 void disposeFilterMap(); |
103 | 101 |
104 using FilterMap = WillBePersistentHeapHashMap<LayoutObject*, OwnPtrWillBeMem
ber<FilterData>>; | 102 using FilterMap = WillBePersistentHeapHashMap<LayoutObject*, OwnPtrWillBeMem
ber<FilterData>>; |
105 FilterMap m_filter; | 103 FilterMap m_filter; |
106 }; | 104 }; |
107 | 105 |
108 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutSVGResourceFilter, isSVGResourceFilter()); | 106 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutSVGResourceFilter, isSVGResourceFilter()); |
109 | 107 |
110 } | 108 } |
111 | 109 |
112 #endif | 110 #endif |
OLD | NEW |