OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CC_OUTPUT_FILTER_OPERATION_H_ | 5 #ifndef CC_OUTPUT_FILTER_OPERATION_H_ |
6 #define CC_OUTPUT_FILTER_OPERATION_H_ | 6 #define CC_OUTPUT_FILTER_OPERATION_H_ |
7 | 7 |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "cc/base/cc_export.h" | 10 #include "cc/base/cc_export.h" |
11 #include "skia/ext/refptr.h" | 11 #include "skia/ext/refptr.h" |
12 #include "third_party/skia/include/core/SkColor.h" | 12 #include "third_party/skia/include/core/SkColor.h" |
13 #include "third_party/skia/include/core/SkImageFilter.h" | 13 #include "third_party/skia/include/core/SkImageFilter.h" |
14 #include "third_party/skia/include/core/SkRegion.h" | 14 #include "third_party/skia/include/core/SkRegion.h" |
15 #include "third_party/skia/include/core/SkScalar.h" | 15 #include "third_party/skia/include/core/SkScalar.h" |
16 #include "ui/gfx/geometry/point.h" | 16 #include "ui/gfx/geometry/point.h" |
17 | 17 |
18 namespace base { | 18 namespace base { |
19 namespace debug { | |
20 class TracedValue; | |
21 } | |
22 class Value; | 19 class Value; |
23 } | 20 } |
24 | 21 |
25 namespace cc { | 22 namespace cc { |
26 | 23 |
27 class CC_EXPORT FilterOperation { | 24 class CC_EXPORT FilterOperation { |
28 public: | 25 public: |
29 enum FilterType { | 26 enum FilterType { |
30 GRAYSCALE, | 27 GRAYSCALE, |
31 SEPIA, | 28 SEPIA, |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 // Given two filters of the same type, returns a filter operation created by | 213 // Given two filters of the same type, returns a filter operation created by |
217 // linearly interpolating a |progress| fraction from |from| to |to|. If either | 214 // linearly interpolating a |progress| fraction from |from| to |to|. If either |
218 // |from| or |to| (but not both) is null, it is treated as a no-op filter of | 215 // |from| or |to| (but not both) is null, it is treated as a no-op filter of |
219 // the same type as the other given filter. If both |from| and |to| are null, | 216 // the same type as the other given filter. If both |from| and |to| are null, |
220 // or if |from| and |to| are non-null but of different types, returns a | 217 // or if |from| and |to| are non-null but of different types, returns a |
221 // no-op filter. | 218 // no-op filter. |
222 static FilterOperation Blend(const FilterOperation* from, | 219 static FilterOperation Blend(const FilterOperation* from, |
223 const FilterOperation* to, | 220 const FilterOperation* to, |
224 double progress); | 221 double progress); |
225 | 222 |
226 void AsValueInto(base::debug::TracedValue* value) const; | 223 scoped_ptr<base::Value> AsValue() const; |
227 | 224 |
228 private: | 225 private: |
229 FilterOperation(FilterType type, float amount); | 226 FilterOperation(FilterType type, float amount); |
230 | 227 |
231 FilterOperation(FilterType type, | 228 FilterOperation(FilterType type, |
232 const gfx::Point& offset, | 229 const gfx::Point& offset, |
233 float stdDeviation, | 230 float stdDeviation, |
234 SkColor color); | 231 SkColor color); |
235 | 232 |
236 FilterOperation(FilterType, SkScalar matrix[20]); | 233 FilterOperation(FilterType, SkScalar matrix[20]); |
(...skipping 15 matching lines...) Expand all Loading... |
252 SkColor drop_shadow_color_; | 249 SkColor drop_shadow_color_; |
253 skia::RefPtr<SkImageFilter> image_filter_; | 250 skia::RefPtr<SkImageFilter> image_filter_; |
254 SkScalar matrix_[20]; | 251 SkScalar matrix_[20]; |
255 int zoom_inset_; | 252 int zoom_inset_; |
256 SkRegion region_; | 253 SkRegion region_; |
257 }; | 254 }; |
258 | 255 |
259 } // namespace cc | 256 } // namespace cc |
260 | 257 |
261 #endif // CC_OUTPUT_FILTER_OPERATION_H_ | 258 #endif // CC_OUTPUT_FILTER_OPERATION_H_ |
OLD | NEW |