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

Side by Side Diff: cc/layers/viewport.h

Issue 2040543002: Take MT jank into account when animating the scroll offset on CC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add test + apply suggested improvement Created 4 years, 3 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/input/input_handler.h ('k') | cc/layers/viewport.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 #ifndef CC_LAYERS_VIEWPORT_H_ 5 #ifndef CC_LAYERS_VIEWPORT_H_
6 #define CC_LAYERS_VIEWPORT_H_ 6 #define CC_LAYERS_VIEWPORT_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/gtest_prod_util.h" 10 #include "base/gtest_prod_util.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 // Scrolls the viewport, applying the unique bubbling between the inner and 44 // Scrolls the viewport, applying the unique bubbling between the inner and
45 // outer viewport. Scrolls can be consumed by top controls. 45 // outer viewport. Scrolls can be consumed by top controls.
46 ScrollResult ScrollBy(const gfx::Vector2dF& delta, 46 ScrollResult ScrollBy(const gfx::Vector2dF& delta,
47 const gfx::Point& viewport_point, 47 const gfx::Point& viewport_point,
48 bool is_wheel_scroll, 48 bool is_wheel_scroll,
49 bool affect_top_controls); 49 bool affect_top_controls);
50 50
51 // Scrolls the viewport, bubbling the delta between the inner and outer 51 // Scrolls the viewport, bubbling the delta between the inner and outer
52 // viewport. Only animates either of the two viewports. 52 // viewport. Only animates either of the two viewports.
53 gfx::Vector2dF ScrollAnimated(const gfx::Vector2dF& delta); 53 gfx::Vector2dF ScrollAnimated(const gfx::Vector2dF& delta,
54 base::TimeDelta delayed_by);
54 55
55 void PinchUpdate(float magnify_delta, const gfx::Point& anchor); 56 void PinchUpdate(float magnify_delta, const gfx::Point& anchor);
56 void PinchEnd(); 57 void PinchEnd();
57 58
58 private: 59 private:
59 explicit Viewport(LayerTreeHostImpl* host_impl); 60 explicit Viewport(LayerTreeHostImpl* host_impl);
60 61
61 // Returns true if viewport_delta is stricly less than pending_delta. 62 // Returns true if viewport_delta is stricly less than pending_delta.
62 static bool ShouldAnimateViewport(const gfx::Vector2dF& viewport_delta, 63 static bool ShouldAnimateViewport(const gfx::Vector2dF& viewport_delta,
63 const gfx::Vector2dF& pending_delta); 64 const gfx::Vector2dF& pending_delta);
(...skipping 20 matching lines...) Expand all
84 gfx::Vector2d pinch_anchor_adjustment_; 85 gfx::Vector2d pinch_anchor_adjustment_;
85 86
86 FRIEND_TEST_ALL_PREFIXES(ViewportTest, ShouldAnimateViewport); 87 FRIEND_TEST_ALL_PREFIXES(ViewportTest, ShouldAnimateViewport);
87 88
88 DISALLOW_COPY_AND_ASSIGN(Viewport); 89 DISALLOW_COPY_AND_ASSIGN(Viewport);
89 }; 90 };
90 91
91 } // namespace cc 92 } // namespace cc
92 93
93 #endif // CC_LAYERS_VIEWPORT_H_ 94 #endif // CC_LAYERS_VIEWPORT_H_
OLDNEW
« no previous file with comments | « cc/input/input_handler.h ('k') | cc/layers/viewport.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698