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

Side by Side Diff: Source/platform/graphics/filters/FilterOperation.h

Issue 1326183002: Merge ReferenceFilter into Filter (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Touchups; Rebase. Created 5 years, 3 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) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 12 matching lines...) Expand all
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #ifndef FilterOperation_h 26 #ifndef FilterOperation_h
27 #define FilterOperation_h 27 #define FilterOperation_h
28 28
29 #include "platform/Length.h" 29 #include "platform/Length.h"
30 #include "platform/PlatformExport.h" 30 #include "platform/PlatformExport.h"
31 #include "platform/graphics/Color.h" 31 #include "platform/graphics/Color.h"
32 #include "platform/graphics/filters/Filter.h" 32 #include "platform/graphics/filters/Filter.h"
33 #include "platform/graphics/filters/ReferenceFilter.h"
34 #include "platform/heap/Handle.h" 33 #include "platform/heap/Handle.h"
35 #include "wtf/OwnPtr.h" 34 #include "wtf/OwnPtr.h"
36 #include "wtf/PassOwnPtr.h" 35 #include "wtf/PassOwnPtr.h"
37 #include "wtf/RefCounted.h" 36 #include "wtf/RefCounted.h"
38 #include "wtf/text/WTFString.h" 37 #include "wtf/text/WTFString.h"
39 38
40 namespace blink { 39 namespace blink {
41 40
42 // CSS Filters 41 // CSS Filters
43 42
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 { 116 {
118 return adoptRefWillBeNoop(new ReferenceFilterOperation(url, fragment)); 117 return adoptRefWillBeNoop(new ReferenceFilterOperation(url, fragment));
119 } 118 }
120 119
121 bool affectsOpacity() const override { return true; } 120 bool affectsOpacity() const override { return true; }
122 bool movesPixels() const override { return true; } 121 bool movesPixels() const override { return true; }
123 122
124 const String& url() const { return m_url; } 123 const String& url() const { return m_url; }
125 const AtomicString& fragment() const { return m_fragment; } 124 const AtomicString& fragment() const { return m_fragment; }
126 125
127 ReferenceFilter* filter() const { return m_filter.get(); } 126 Filter* filter() const { return m_filter.get(); }
128 void setFilter(PassRefPtrWillBeRawPtr<ReferenceFilter> filter) { m_filter = filter; } 127 void setFilter(PassRefPtrWillBeRawPtr<Filter> filter) { m_filter = filter; }
129 128
130 DECLARE_VIRTUAL_TRACE(); 129 DECLARE_VIRTUAL_TRACE();
131 130
132 private: 131 private:
133 PassRefPtrWillBeRawPtr<FilterOperation> blend(const FilterOperation* from, d ouble progress) const override 132 PassRefPtrWillBeRawPtr<FilterOperation> blend(const FilterOperation* from, d ouble progress) const override
134 { 133 {
135 ASSERT_NOT_REACHED(); 134 ASSERT_NOT_REACHED();
136 return nullptr; 135 return nullptr;
137 } 136 }
138 137
139 bool operator==(const FilterOperation& o) const override 138 bool operator==(const FilterOperation& o) const override
140 { 139 {
141 if (!isSameType(o)) 140 if (!isSameType(o))
142 return false; 141 return false;
143 const ReferenceFilterOperation* other = static_cast<const ReferenceFilte rOperation*>(&o); 142 const ReferenceFilterOperation* other = static_cast<const ReferenceFilte rOperation*>(&o);
144 return m_url == other->m_url; 143 return m_url == other->m_url;
145 } 144 }
146 145
147 ReferenceFilterOperation(const String& url, const AtomicString& fragment) 146 ReferenceFilterOperation(const String& url, const AtomicString& fragment)
148 : FilterOperation(REFERENCE) 147 : FilterOperation(REFERENCE)
149 , m_url(url) 148 , m_url(url)
150 , m_fragment(fragment) 149 , m_fragment(fragment)
151 { 150 {
152 } 151 }
153 152
154 String m_url; 153 String m_url;
155 AtomicString m_fragment; 154 AtomicString m_fragment;
156 RefPtrWillBeMember<ReferenceFilter> m_filter; 155 RefPtrWillBeMember<Filter> m_filter;
157 }; 156 };
158 157
159 DEFINE_FILTER_OPERATION_TYPE_CASTS(ReferenceFilterOperation, REFERENCE); 158 DEFINE_FILTER_OPERATION_TYPE_CASTS(ReferenceFilterOperation, REFERENCE);
160 159
161 // GRAYSCALE, SEPIA, SATURATE and HUE_ROTATE are variations on a basic color mat rix effect. 160 // GRAYSCALE, SEPIA, SATURATE and HUE_ROTATE are variations on a basic color mat rix effect.
162 // For HUE_ROTATE, the angle of rotation is stored in m_amount. 161 // For HUE_ROTATE, the angle of rotation is stored in m_amount.
163 class PLATFORM_EXPORT BasicColorMatrixFilterOperation : public FilterOperation { 162 class PLATFORM_EXPORT BasicColorMatrixFilterOperation : public FilterOperation {
164 public: 163 public:
165 static PassRefPtrWillBeRawPtr<BasicColorMatrixFilterOperation> create(double amount, OperationType type) 164 static PassRefPtrWillBeRawPtr<BasicColorMatrixFilterOperation> create(double amount, OperationType type)
166 { 165 {
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 int m_stdDeviation; 309 int m_stdDeviation;
311 Color m_color; 310 Color m_color;
312 }; 311 };
313 312
314 DEFINE_FILTER_OPERATION_TYPE_CASTS(DropShadowFilterOperation, DROP_SHADOW); 313 DEFINE_FILTER_OPERATION_TYPE_CASTS(DropShadowFilterOperation, DROP_SHADOW);
315 314
316 } // namespace blink 315 } // namespace blink
317 316
318 317
319 #endif // FilterOperation_h 318 #endif // FilterOperation_h
OLDNEW
« no previous file with comments | « Source/platform/graphics/filters/Filter.cpp ('k') | Source/platform/graphics/filters/ImageFilterBuilderTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698