Chromium Code Reviews| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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, returns a |
| 60 // FilterOperations formed by linearly interpolating at each position a | 60 // FilterOperations formed by linearly interpolating at each position a |
| 61 // |progress| fraction of the way from the filter in |from| | 61 // |progress| fraction of the way from the filter in |from| |
| 62 // to the filter in this. If either |from| or this is an empty sequence, | 62 // to the filter in this. If either |from| or this is an empty sequence, |
| 63 // it is treated as a sequence of the same length as the other sequence, | 63 // it is treated as a sequence of the same length as the other sequence, |
| 64 // where the filter at each position is a no-op filter of the same type | 64 // where the filter at each position is a no-op filter of the same type |
| 65 // as the filter in that position in the other sequence. Otherwise, if | 65 // as the filter in that position in the other sequence. Otherwise, if |
| 66 // both |from| and this are non-empty sequences but are either of different | 66 // both |from| and this are non-empty sequences but either contains a |
| 67 // lengths or if there is a type mismatch at some position, returns a copy | 67 // reference filter, are either of different lengths without a common prefix |
|
ajuma
2013/11/11 18:39:41
The condition is stronger than "common prefix" (si
avallee
2013/11/12 20:18:09
SGTM
| |
| 68 // of this. | 68 // or if there is a type mismatch at some position, returns a copy of this. |
| 69 FilterOperations Blend(const FilterOperations& from, double progress) const; | 69 FilterOperations Blend(const FilterOperations& from, double progress) const; |
| 70 | 70 |
| 71 | |
|
danakj
2013/11/11 17:59:57
remove extra whitespace
avallee
2013/11/12 20:18:09
Done.
| |
| 71 scoped_ptr<base::Value> AsValue() const; | 72 scoped_ptr<base::Value> AsValue() const; |
| 72 | 73 |
| 73 private: | 74 private: |
| 75 // Blend helper which blends operations of different sizes. If the shortest | |
| 76 // of |from| and this doesn't match the order and type of operations, returns | |
| 77 // this. Otherwise, blends the matching operations from the shorter list and | |
| 78 // blends the remaining filters from the longer list with their no-op | |
| 79 // equivalents. | |
| 80 FilterOperations BlendRaggedOperations(const FilterOperations& from, | |
| 81 double progress) const; | |
| 82 | |
| 74 std::vector<FilterOperation> operations_; | 83 std::vector<FilterOperation> operations_; |
| 75 }; | 84 }; |
| 76 | 85 |
| 77 } // namespace cc | 86 } // namespace cc |
| 78 | 87 |
| 79 #endif // CC_OUTPUT_FILTER_OPERATIONS_H_ | 88 #endif // CC_OUTPUT_FILTER_OPERATIONS_H_ |
| OLD | NEW |