Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(689)

Side by Side Diff: cc/base/synced_property.h

Issue 1736073002: cc: Move SyncedScrollOffset to scroll tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and add comment Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/BUILD.gn ('k') | cc/cc.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « cc/BUILD.gn ('k') | cc/cc.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698