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

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

Issue 1215183004: Arrange compositor scrolling into scroll customization format (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix windows compile. Created 5 years, 5 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "cc/input/scroll_state.h"
6
7 #include "cc/layers/layer_impl.h"
8
9 namespace cc {
10
11 ScrollState::ScrollState(double delta_x,
12 double delta_y,
13 int start_position_x,
14 int start_position_y,
15 bool in_inertial_phase,
16 bool should_propagate,
17 bool delta_consumed_for_scroll_sequence,
18 bool is_direct_manipulation)
19 : delta_x_(delta_x),
20 delta_y_(delta_y),
21 start_position_x_(start_position_x),
22 start_position_y_(start_position_y),
23 in_inertial_phase_(in_inertial_phase),
24 should_propagate_(should_propagate),
25 delta_consumed_for_scroll_sequence_(delta_consumed_for_scroll_sequence),
26 is_direct_manipulation_(is_direct_manipulation) {
27 }
28
29 ScrollState::~ScrollState() {
30 }
31
32 void ScrollState::ConsumeDelta(double x, double y) {
33 delta_x_ -= x;
34 delta_y_ -= y;
35
36 if (x || y)
37 delta_consumed_for_scroll_sequence_ = true;
38 }
39
40 void ScrollState::DistributeToScrollChainDescendant() {
41 if (!scroll_chain_.empty()) {
42 LayerImpl* next = scroll_chain_.front();
43 scroll_chain_.pop_front();
44 next->DistributeScroll(this);
45 }
46 }
47
48 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698