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

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

Issue 2816063003: Replace layer id with Element id for tracking scrollbar animation controllers (Closed)
Patch Set: Address reviewer comments, pull element_id.h change to another patch Created 3 years, 8 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
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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 314
315 // Prevents notifying the |client_| when an impl side invalidation request is 315 // Prevents notifying the |client_| when an impl side invalidation request is
316 // made. When unblocked, the disabled request will immediately be called. 316 // made. When unblocked, the disabled request will immediately be called.
317 virtual void BlockImplSideInvalidationRequestsForTesting(bool block); 317 virtual void BlockImplSideInvalidationRequestsForTesting(bool block);
318 318
319 // Resets all of the trees to an empty state. 319 // Resets all of the trees to an empty state.
320 void ResetTreesForTesting(); 320 void ResetTreesForTesting();
321 321
322 size_t SourceAnimationFrameNumberForTesting() const; 322 size_t SourceAnimationFrameNumberForTesting() const;
323 323
324 void RegisterScrollbarAnimationController(int scroll_layer_id); 324 void RegisterScrollbarAnimationController(int scroll_layer_id,
325 void UnregisterScrollbarAnimationController(int scroll_layer_id); 325 ElementId scroll_element_id);
326 ScrollbarAnimationController* ScrollbarAnimationControllerForId( 326 void UnregisterScrollbarAnimationController(ElementId scroll_element_id);
327 int scroll_layer_id) const; 327 ScrollbarAnimationController* ScrollbarAnimationControllerForElementId(
328 ElementId scroll_element_id) const;
328 329
329 DrawMode GetDrawMode() const; 330 DrawMode GetDrawMode() const;
330 331
331 // Viewport size in draw space: this size is in physical pixels and is used 332 // Viewport size in draw space: this size is in physical pixels and is used
332 // for draw properties, tilings, quads and render passes. 333 // for draw properties, tilings, quads and render passes.
333 gfx::Size DrawViewportSize() const; 334 gfx::Size DrawViewportSize() const;
334 335
335 // Viewport rect in view space used for tiling prioritization. 336 // Viewport rect in view space used for tiling prioritization.
336 const gfx::Rect ViewportRectForTilePriority() const; 337 const gfx::Rect ViewportRectForTilePriority() const;
337 338
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 std::unique_ptr<LayerTreeImpl> pending_tree_; 753 std::unique_ptr<LayerTreeImpl> pending_tree_;
753 754
754 // In impl-side painting mode, inert tree with layers that can be recycled 755 // In impl-side painting mode, inert tree with layers that can be recycled
755 // by the next sync from the main thread. 756 // by the next sync from the main thread.
756 std::unique_ptr<LayerTreeImpl> recycle_tree_; 757 std::unique_ptr<LayerTreeImpl> recycle_tree_;
757 758
758 InputHandlerClient* input_handler_client_; 759 InputHandlerClient* input_handler_client_;
759 bool did_lock_scrolling_layer_; 760 bool did_lock_scrolling_layer_;
760 bool wheel_scrolling_; 761 bool wheel_scrolling_;
761 bool scroll_affects_scroll_handler_; 762 bool scroll_affects_scroll_handler_;
762 int scroll_layer_id_mouse_currently_over_; 763 ElementId scroll_element_id_mouse_currently_over_;
763 int scroll_layer_id_mouse_currently_captured_; 764 ElementId scroll_element_id_mouse_currently_captured_;
764 765
765 std::vector<std::unique_ptr<SwapPromise>> 766 std::vector<std::unique_ptr<SwapPromise>>
766 swap_promises_for_main_thread_scroll_update_; 767 swap_promises_for_main_thread_scroll_update_;
767 768
768 // An object to implement the ScrollElasticityHelper interface and 769 // An object to implement the ScrollElasticityHelper interface and
769 // hold all state related to elasticity. May be NULL if never requested. 770 // hold all state related to elasticity. May be NULL if never requested.
770 std::unique_ptr<ScrollElasticityHelper> scroll_elasticity_helper_; 771 std::unique_ptr<ScrollElasticityHelper> scroll_elasticity_helper_;
771 772
772 bool tile_priorities_dirty_; 773 bool tile_priorities_dirty_;
773 774
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 gfx::Transform external_transform_; 814 gfx::Transform external_transform_;
814 gfx::Rect external_viewport_; 815 gfx::Rect external_viewport_;
815 gfx::Rect viewport_rect_for_tile_priority_; 816 gfx::Rect viewport_rect_for_tile_priority_;
816 bool resourceless_software_draw_; 817 bool resourceless_software_draw_;
817 818
818 gfx::Rect viewport_damage_rect_; 819 gfx::Rect viewport_damage_rect_;
819 820
820 std::unique_ptr<MutatorHost> mutator_host_; 821 std::unique_ptr<MutatorHost> mutator_host_;
821 std::set<VideoFrameController*> video_frame_controllers_; 822 std::set<VideoFrameController*> video_frame_controllers_;
822 823
823 // Map from scroll layer ID to scrollbar animation controller. 824 // Map from scroll element ID to scrollbar animation controller.
824 // There is one animation controller per pair of overlay scrollbars. 825 // There is one animation controller per pair of overlay scrollbars.
825 std::unordered_map<int, std::unique_ptr<ScrollbarAnimationController>> 826 std::unordered_map<ElementId,
827 std::unique_ptr<ScrollbarAnimationController>,
828 ElementIdHash>
826 scrollbar_animation_controllers_; 829 scrollbar_animation_controllers_;
827 830
828 RenderingStatsInstrumentation* rendering_stats_instrumentation_; 831 RenderingStatsInstrumentation* rendering_stats_instrumentation_;
829 MicroBenchmarkControllerImpl micro_benchmark_controller_; 832 MicroBenchmarkControllerImpl micro_benchmark_controller_;
830 std::unique_ptr<SynchronousTaskGraphRunner> 833 std::unique_ptr<SynchronousTaskGraphRunner>
831 single_thread_synchronous_task_graph_runner_; 834 single_thread_synchronous_task_graph_runner_;
832 835
833 // Optional callback to notify of new tree activations. 836 // Optional callback to notify of new tree activations.
834 base::Closure tree_activation_callback_; 837 base::Closure tree_activation_callback_;
835 838
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 bool has_scrolled_by_touch_; 870 bool has_scrolled_by_touch_;
868 871
869 bool touchpad_and_wheel_scroll_latching_enabled_; 872 bool touchpad_and_wheel_scroll_latching_enabled_;
870 873
871 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); 874 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl);
872 }; 875 };
873 876
874 } // namespace cc 877 } // namespace cc
875 878
876 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ 879 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698