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

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

Powered by Google App Engine
This is Rietveld 408576698