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

Side by Side Diff: cc/input/scroll_state.cc

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/cc_tests.gyp ('k') | cc/layers/layer.cc » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "cc/input/scroll_state.h" 5 #include "cc/input/scroll_state.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "cc/trees/layer_tree_impl.h" 9 #include "cc/trees/layer_tree_impl.h"
10 10
11 namespace cc { 11 namespace cc {
12 12
13 ScrollState::ScrollState(ScrollStateData data) : data_(data) {} 13 ScrollState::ScrollState(ScrollStateData data)
14 : data_(data), layer_tree_impl_(nullptr) {}
14 15
15 ScrollState::ScrollState(const ScrollState& other) = default; 16 ScrollState::ScrollState(const ScrollState& other) = default;
16 17
17 ScrollState::~ScrollState() {} 18 ScrollState::~ScrollState() {}
18 19
19 void ScrollState::ConsumeDelta(double x, double y) { 20 void ScrollState::ConsumeDelta(double x, double y) {
20 data_.delta_x -= x; 21 data_.delta_x -= x;
21 data_.delta_y -= y; 22 data_.delta_y -= y;
22 23
23 if (x || y) 24 if (x || y)
24 data_.delta_consumed_for_scroll_sequence = true; 25 data_.delta_consumed_for_scroll_sequence = true;
25 } 26 }
26 27
27 void ScrollState::DistributeToScrollChainDescendant() { 28 void ScrollState::DistributeToScrollChainDescendant() {
28 if (!scroll_chain_.empty()) { 29 if (!scroll_chain_.empty()) {
29 const ScrollNode* next = scroll_chain_.front(); 30 const ScrollNode* next = scroll_chain_.front();
30 scroll_chain_.pop_front(); 31 scroll_chain_.pop_front();
31 layer_tree_impl_->LayerById(next->owner_id)->DistributeScroll(this); 32 layer_tree_impl_->LayerById(next->owner_id)->DistributeScroll(this);
32 } 33 }
33 } 34 }
34 35
35 } // namespace cc 36 } // namespace cc
OLDNEW
« no previous file with comments | « cc/cc_tests.gyp ('k') | cc/layers/layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698