| 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 } |
| 19 class Value; | 22 class Value; |
| 20 } | 23 } |
| 21 | 24 |
| 22 namespace cc { | 25 namespace cc { |
| 23 | 26 |
| 24 class CC_EXPORT FilterOperation { | 27 class CC_EXPORT FilterOperation { |
| 25 public: | 28 public: |
| 26 enum FilterType { | 29 enum FilterType { |
| 27 GRAYSCALE, | 30 GRAYSCALE, |
| 28 SEPIA, | 31 SEPIA, |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 // Given two filters of the same type, returns a filter operation created by | 216 // Given two filters of the same type, returns a filter operation created by |
| 214 // linearly interpolating a |progress| fraction from |from| to |to|. If either | 217 // linearly interpolating a |progress| fraction from |from| to |to|. If either |
| 215 // |from| or |to| (but not both) is null, it is treated as a no-op filter of | 218 // |from| or |to| (but not both) is null, it is treated as a no-op filter of |
| 216 // the same type as the other given filter. If both |from| and |to| are null, | 219 // the same type as the other given filter. If both |from| and |to| are null, |
| 217 // or if |from| and |to| are non-null but of different types, returns a | 220 // or if |from| and |to| are non-null but of different types, returns a |
| 218 // no-op filter. | 221 // no-op filter. |
| 219 static FilterOperation Blend(const FilterOperation* from, | 222 static FilterOperation Blend(const FilterOperation* from, |
| 220 const FilterOperation* to, | 223 const FilterOperation* to, |
| 221 double progress); | 224 double progress); |
| 222 | 225 |
| 223 scoped_ptr<base::Value> AsValue() const; | 226 void AsValueInto(base::debug::TracedValue* value) const; |
| 224 | 227 |
| 225 private: | 228 private: |
| 226 FilterOperation(FilterType type, float amount); | 229 FilterOperation(FilterType type, float amount); |
| 227 | 230 |
| 228 FilterOperation(FilterType type, | 231 FilterOperation(FilterType type, |
| 229 const gfx::Point& offset, | 232 const gfx::Point& offset, |
| 230 float stdDeviation, | 233 float stdDeviation, |
| 231 SkColor color); | 234 SkColor color); |
| 232 | 235 |
| 233 FilterOperation(FilterType, SkScalar matrix[20]); | 236 FilterOperation(FilterType, SkScalar matrix[20]); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 249 SkColor drop_shadow_color_; | 252 SkColor drop_shadow_color_; |
| 250 skia::RefPtr<SkImageFilter> image_filter_; | 253 skia::RefPtr<SkImageFilter> image_filter_; |
| 251 SkScalar matrix_[20]; | 254 SkScalar matrix_[20]; |
| 252 int zoom_inset_; | 255 int zoom_inset_; |
| 253 SkRegion region_; | 256 SkRegion region_; |
| 254 }; | 257 }; |
| 255 | 258 |
| 256 } // namespace cc | 259 } // namespace cc |
| 257 | 260 |
| 258 #endif // CC_OUTPUT_FILTER_OPERATION_H_ | 261 #endif // CC_OUTPUT_FILTER_OPERATION_H_ |
| OLD | NEW |