| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_BASE_SYNCED_PROPERTY_H_ | 5 #ifndef CC_BASE_SYNCED_PROPERTY_H_ |
| 6 #define CC_BASE_SYNCED_PROPERTY_H_ | 6 #define CC_BASE_SYNCED_PROPERTY_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 | 9 |
| 10 namespace cc { | 10 namespace cc { |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 // The new delta we would use if we decide to activate now. This delta | 106 // The new delta we would use if we decide to activate now. This delta |
| 107 // excludes the amount that we expect the main thread to reflect back at the | 107 // excludes the amount that we expect the main thread to reflect back at the |
| 108 // impl thread during the commit. | 108 // impl thread during the commit. |
| 109 T PendingDelta() const { | 109 T PendingDelta() const { |
| 110 if (clobber_active_value_) | 110 if (clobber_active_value_) |
| 111 return T::Identity(); | 111 return T::Identity(); |
| 112 return active_delta_.InverseCombine(sent_delta_); | 112 return active_delta_.InverseCombine(sent_delta_); |
| 113 } | 113 } |
| 114 | 114 |
| 115 void set_clobber_active_value() { clobber_active_value_ = true; } | 115 void set_clobber_active_value() { clobber_active_value_ = true; } |
| 116 bool clobber_active_value() const { return clobber_active_value_; } |
| 116 | 117 |
| 117 private: | 118 private: |
| 118 // Value last committed to the pending tree. | 119 // Value last committed to the pending tree. |
| 119 T pending_base_; | 120 T pending_base_; |
| 120 // Value last committed to the active tree (on the last activation). | 121 // Value last committed to the active tree (on the last activation). |
| 121 T active_base_; | 122 T active_base_; |
| 122 // The difference between the active_base_ and the user-perceived value. | 123 // The difference between the active_base_ and the user-perceived value. |
| 123 T active_delta_; | 124 T active_delta_; |
| 124 // The value sent to the main thread (on the last BeginFrame); this is always | 125 // The value sent to the main thread (on the last BeginFrame); this is always |
| 125 // identity outside of the BeginFrame-to-activation interval. | 126 // identity outside of the BeginFrame-to-activation interval. |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 return ScaleGroup(value_ / p.value_); | 179 return ScaleGroup(value_ / p.value_); |
| 179 } | 180 } |
| 180 | 181 |
| 181 private: | 182 private: |
| 182 float value_; | 183 float value_; |
| 183 }; | 184 }; |
| 184 | 185 |
| 185 } // namespace cc | 186 } // namespace cc |
| 186 | 187 |
| 187 #endif // CC_BASE_SYNCED_PROPERTY_H_ | 188 #endif // CC_BASE_SYNCED_PROPERTY_H_ |
| OLD | NEW |