| 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_OPERATIONS_H_ | 5 #ifndef CC_OUTPUT_FILTER_OPERATIONS_H_ |
| 6 #define CC_OUTPUT_FILTER_OPERATIONS_H_ | 6 #define CC_OUTPUT_FILTER_OPERATIONS_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "cc/output/filter_operation.h" | 14 #include "cc/output/filter_operation.h" |
| 15 | 15 |
| 16 namespace base { | 16 namespace base { |
| 17 namespace trace_event { | 17 namespace trace_event { |
| 18 class TracedValue; | 18 class TracedValue; |
| 19 } | 19 } |
| 20 class Value; | 20 class Value; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace gfx { |
| 24 class Rect; |
| 25 } |
| 26 |
| 23 namespace cc { | 27 namespace cc { |
| 24 | 28 |
| 25 // An ordered list of filter operations. | 29 // An ordered list of filter operations. |
| 26 class CC_EXPORT FilterOperations { | 30 class CC_EXPORT FilterOperations { |
| 27 public: | 31 public: |
| 28 FilterOperations(); | 32 FilterOperations(); |
| 29 | 33 |
| 30 FilterOperations(const FilterOperations& other); | 34 FilterOperations(const FilterOperations& other); |
| 31 | 35 |
| 32 ~FilterOperations(); | 36 ~FilterOperations(); |
| 33 | 37 |
| 34 FilterOperations& operator=(const FilterOperations& other); | 38 FilterOperations& operator=(const FilterOperations& other); |
| 35 | 39 |
| 36 bool operator==(const FilterOperations& other) const; | 40 bool operator==(const FilterOperations& other) const; |
| 37 | 41 |
| 38 bool operator!=(const FilterOperations& other) const { | 42 bool operator!=(const FilterOperations& other) const { |
| 39 return !(*this == other); | 43 return !(*this == other); |
| 40 } | 44 } |
| 41 | 45 |
| 42 void Append(const FilterOperation& filter); | 46 void Append(const FilterOperation& filter); |
| 43 | 47 |
| 44 // Removes all filter operations. | 48 // Removes all filter operations. |
| 45 void Clear(); | 49 void Clear(); |
| 46 | 50 |
| 47 bool IsEmpty() const; | 51 bool IsEmpty() const; |
| 48 | 52 |
| 53 // Maps "forward" to determine which pixels in a destination rect are affected |
| 54 // by pixels in the source rect. |
| 55 gfx::Rect MapRect(const gfx::Rect& rect) const; |
| 56 |
| 49 void GetOutsets(int* top, int* right, int* bottom, int* left) const; | 57 void GetOutsets(int* top, int* right, int* bottom, int* left) const; |
| 50 bool HasFilterThatMovesPixels() const; | 58 bool HasFilterThatMovesPixels() const; |
| 51 bool HasFilterThatAffectsOpacity() const; | 59 bool HasFilterThatAffectsOpacity() const; |
| 52 bool HasReferenceFilter() const; | 60 bool HasReferenceFilter() const; |
| 53 | 61 |
| 54 size_t size() const { | 62 size_t size() const { |
| 55 return operations_.size(); | 63 return operations_.size(); |
| 56 } | 64 } |
| 57 | 65 |
| 58 const FilterOperation& at(size_t index) const { | 66 const FilterOperation& at(size_t index) const { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 74 | 82 |
| 75 void AsValueInto(base::trace_event::TracedValue* value) const; | 83 void AsValueInto(base::trace_event::TracedValue* value) const; |
| 76 | 84 |
| 77 private: | 85 private: |
| 78 std::vector<FilterOperation> operations_; | 86 std::vector<FilterOperation> operations_; |
| 79 }; | 87 }; |
| 80 | 88 |
| 81 } // namespace cc | 89 } // namespace cc |
| 82 | 90 |
| 83 #endif // CC_OUTPUT_FILTER_OPERATIONS_H_ | 91 #endif // CC_OUTPUT_FILTER_OPERATIONS_H_ |
| OLD | NEW |