| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |