| 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 size_t size() const { | 49 size_t size() const { |
| 50 return operations_.size(); | 50 return operations_.size(); |
| 51 } | 51 } |
| 52 | 52 |
| 53 const FilterOperation& at(size_t index) const { | 53 const FilterOperation& at(size_t index) const { |
| 54 DCHECK_LT(index, size()); | 54 DCHECK_LT(index, size()); |
| 55 return operations_[index]; | 55 return operations_[index]; |
| 56 } | 56 } |
| 57 | 57 |
| 58 // If |from| is of the same size as this, where in each position, the filter | 58 // If |from| is of the same size as this, where in each position, the filter |
| 59 // in |from| is of the same type as the filter in this, returns a | 59 // in |from| is of the same type as the filter in this, and if this doesn't |
| 60 // FilterOperations formed by linearly interpolating at each position a | 60 // contain any reference filters, returns a FilterOperations formed by |
| 61 // |progress| fraction of the way from the filter in |from| | 61 // linearly interpolating at each position a |progress| fraction of the way |
| 62 // to the filter in this. If either |from| or this is an empty sequence, | 62 // from the filter in |from| to the filter in this. If |from| and this are of |
| 63 // it is treated as a sequence of the same length as the other sequence, | 63 // different lengths, they are treated as having the same length by padding |
| 64 // where the filter at each position is a no-op filter of the same type | 64 // the shorter sequence with no-op filters of the same type as the filters in |
| 65 // as the filter in that position in the other sequence. Otherwise, if | 65 // the corresponding positions in the longer sequence. If either sequence has |
| 66 // both |from| and this are non-empty sequences but are either of different | 66 // a reference filter or if there is a type mismatch at some position, returns |
| 67 // lengths or if there is a type mismatch at some position, returns a copy | 67 // a copy of this. |
| 68 // of this. | |
| 69 FilterOperations Blend(const FilterOperations& from, double progress) const; | 68 FilterOperations Blend(const FilterOperations& from, double progress) const; |
| 70 | 69 |
| 70 |
| 71 scoped_ptr<base::Value> AsValue() const; | 71 scoped_ptr<base::Value> AsValue() const; |
| 72 | 72 |
| 73 private: | 73 private: |
| 74 std::vector<FilterOperation> operations_; | 74 std::vector<FilterOperation> operations_; |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 } // namespace cc | 77 } // namespace cc |
| 78 | 78 |
| 79 #endif // CC_OUTPUT_FILTER_OPERATIONS_H_ | 79 #endif // CC_OUTPUT_FILTER_OPERATIONS_H_ |
| OLD | NEW |