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

Side by Side Diff: cc/trees/layer_tree_host_impl.h

Issue 2388563002: Clean up viewport scrolling methods in CC (Closed)
Patch Set: Fix tests Created 4 years, 2 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/layers/viewport.cc ('k') | cc/trees/layer_tree_host_impl.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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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_TREES_LAYER_TREE_HOST_IMPL_H_ 5 #ifndef CC_TREES_LAYER_TREE_HOST_IMPL_H_
6 #define CC_TREES_LAYER_TREE_HOST_IMPL_H_ 6 #define CC_TREES_LAYER_TREE_HOST_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <bitset> 10 #include <bitset>
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 183
184 void PinchGestureBegin() override; 184 void PinchGestureBegin() override;
185 void PinchGestureUpdate(float magnify_delta, 185 void PinchGestureUpdate(float magnify_delta,
186 const gfx::Point& anchor) override; 186 const gfx::Point& anchor) override;
187 void PinchGestureEnd() override; 187 void PinchGestureEnd() override;
188 void StartPageScaleAnimation(const gfx::Vector2d& target_offset, 188 void StartPageScaleAnimation(const gfx::Vector2d& target_offset,
189 bool anchor_point, 189 bool anchor_point,
190 float page_scale, 190 float page_scale,
191 base::TimeDelta duration); 191 base::TimeDelta duration);
192 void SetNeedsAnimateInput() override; 192 void SetNeedsAnimateInput() override;
193 bool IsCurrentlyScrollingInnerViewport() const override; 193 bool IsCurrentlyScrollingViewport() const override;
194 bool IsCurrentlyScrollingLayerAt( 194 bool IsCurrentlyScrollingLayerAt(
195 const gfx::Point& viewport_point, 195 const gfx::Point& viewport_point,
196 InputHandler::ScrollInputType type) const override; 196 InputHandler::ScrollInputType type) const override;
197 EventListenerProperties GetEventListenerProperties( 197 EventListenerProperties GetEventListenerProperties(
198 EventListenerClass event_class) const override; 198 EventListenerClass event_class) const override;
199 bool DoTouchEventsBlockScrollAt(const gfx::Point& viewport_port) override; 199 bool DoTouchEventsBlockScrollAt(const gfx::Point& viewport_port) override;
200 std::unique_ptr<SwapPromiseMonitor> CreateLatencyInfoSwapPromiseMonitor( 200 std::unique_ptr<SwapPromiseMonitor> CreateLatencyInfoSwapPromiseMonitor(
201 ui::LatencyInfo* latency) override; 201 ui::LatencyInfo* latency) override;
202 ScrollElasticityHelper* CreateScrollElasticityHelper() override; 202 ScrollElasticityHelper* CreateScrollElasticityHelper() override;
203 bool GetScrollOffsetForLayer(int layer_id, 203 bool GetScrollOffsetForLayer(int layer_id,
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 void CreateTileManagerResources(); 643 void CreateTileManagerResources();
644 void ReleaseTreeResources(); 644 void ReleaseTreeResources();
645 void RecreateTreeResources(); 645 void RecreateTreeResources();
646 646
647 void AnimateInternal(bool active_tree); 647 void AnimateInternal(bool active_tree);
648 648
649 // Returns true if status changed. 649 // Returns true if status changed.
650 bool UpdateGpuRasterizationStatus(); 650 bool UpdateGpuRasterizationStatus();
651 void UpdateTreeResourcesForGpuRasterizationIfNeeded(); 651 void UpdateTreeResourcesForGpuRasterizationIfNeeded();
652 652
653 Viewport* viewport() { return viewport_.get(); } 653 Viewport* viewport() const { return viewport_.get(); }
654
655 // Scroll by preferring to move the outer viewport first, only moving the
656 // inner if the outer is at its scroll extents.
657 void ScrollViewportBy(gfx::Vector2dF scroll_delta);
658 // Scroll by preferring to move the inner viewport first, only moving the
659 // outer if the inner is at its scroll extents.
660 void ScrollViewportInnerFirst(gfx::Vector2dF scroll_delta);
661 654
662 InputHandler::ScrollStatus ScrollBeginImpl( 655 InputHandler::ScrollStatus ScrollBeginImpl(
663 ScrollState* scroll_state, 656 ScrollState* scroll_state,
664 LayerImpl* scrolling_layer_impl, 657 LayerImpl* scrolling_layer_impl,
665 InputHandler::ScrollInputType type); 658 InputHandler::ScrollInputType type);
666 void DistributeScrollDelta(ScrollState* scroll_state); 659 void DistributeScrollDelta(ScrollState* scroll_state);
667 660
668 bool AnimatePageScale(base::TimeTicks monotonic_time); 661 bool AnimatePageScale(base::TimeTicks monotonic_time);
669 bool AnimateScrollbars(base::TimeTicks monotonic_time); 662 bool AnimateScrollbars(base::TimeTicks monotonic_time);
670 bool AnimateTopControls(base::TimeTicks monotonic_time); 663 bool AnimateTopControls(base::TimeTicks monotonic_time);
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 844
852 std::unique_ptr<PendingTreeDurationHistogramTimer> 845 std::unique_ptr<PendingTreeDurationHistogramTimer>
853 pending_tree_duration_timer_; 846 pending_tree_duration_timer_;
854 847
855 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); 848 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl);
856 }; 849 };
857 850
858 } // namespace cc 851 } // namespace cc
859 852
860 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ 853 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_
OLDNEW
« no previous file with comments | « cc/layers/viewport.cc ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698