| OLD | NEW |
| 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_H_ | 5 #ifndef CC_TREES_LAYER_TREE_HOST_H_ |
| 6 #define CC_TREES_LAYER_TREE_HOST_H_ | 6 #define CC_TREES_LAYER_TREE_HOST_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 size_t NumLayers() const; | 348 size_t NumLayers() const; |
| 349 | 349 |
| 350 bool in_update_property_trees() const { return in_update_property_trees_; } | 350 bool in_update_property_trees() const { return in_update_property_trees_; } |
| 351 bool PaintContent(const LayerList& update_layer_list, | 351 bool PaintContent(const LayerList& update_layer_list, |
| 352 bool* content_is_suitable_for_gpu); | 352 bool* content_is_suitable_for_gpu); |
| 353 bool in_paint_layer_contents() const { return in_paint_layer_contents_; } | 353 bool in_paint_layer_contents() const { return in_paint_layer_contents_; } |
| 354 | 354 |
| 355 void SetHasCopyRequest(bool has_copy_request); | 355 void SetHasCopyRequest(bool has_copy_request); |
| 356 bool has_copy_request() const { return has_copy_request_; } | 356 bool has_copy_request() const { return has_copy_request_; } |
| 357 | 357 |
| 358 void AddSurfaceLayerId(const SurfaceId& surface_id); |
| 359 void RemoveSurfaceLayerId(const SurfaceId& surface_id); |
| 360 const std::vector<SurfaceId>& SurfaceLayerIds() const; |
| 361 |
| 358 void AddLayerShouldPushProperties(Layer* layer); | 362 void AddLayerShouldPushProperties(Layer* layer); |
| 359 void RemoveLayerShouldPushProperties(Layer* layer); | 363 void RemoveLayerShouldPushProperties(Layer* layer); |
| 360 std::unordered_set<Layer*>& LayersThatShouldPushProperties(); | 364 std::unordered_set<Layer*>& LayersThatShouldPushProperties(); |
| 361 bool LayerNeedsPushPropertiesForTesting(Layer* layer) const; | 365 bool LayerNeedsPushPropertiesForTesting(Layer* layer) const; |
| 362 | 366 |
| 363 void SetPageScaleFromImplSide(float page_scale); | 367 void SetPageScaleFromImplSide(float page_scale); |
| 364 void SetElasticOverscrollFromImplSide(gfx::Vector2dF elastic_overscroll); | 368 void SetElasticOverscrollFromImplSide(gfx::Vector2dF elastic_overscroll); |
| 365 gfx::Vector2dF elastic_overscroll() const { return elastic_overscroll_; } | 369 gfx::Vector2dF elastic_overscroll() const { return elastic_overscroll_; } |
| 366 | 370 |
| 367 void UpdateHudLayer(bool show_hud_info); | 371 void UpdateHudLayer(bool show_hud_info); |
| 368 HeadsUpDisplayLayer* hud_layer() const { return hud_layer_.get(); } | 372 HeadsUpDisplayLayer* hud_layer() const { return hud_layer_.get(); } |
| 369 | 373 |
| 370 virtual void SetNeedsFullTreeSync(); | 374 virtual void SetNeedsFullTreeSync(); |
| 371 bool needs_full_tree_sync() const { return needs_full_tree_sync_; } | 375 bool needs_full_tree_sync() const { return needs_full_tree_sync_; } |
| 372 | 376 |
| 377 bool needs_surface_ids_sync() const { return needs_surface_ids_sync_; } |
| 378 void set_needs_surface_ids_sync(bool needs_surface_ids_sync) { |
| 379 needs_surface_ids_sync_ = needs_surface_ids_sync; |
| 380 } |
| 381 |
| 373 void SetPropertyTreesNeedRebuild(); | 382 void SetPropertyTreesNeedRebuild(); |
| 374 | 383 |
| 375 void PushPropertyTreesTo(LayerTreeImpl* tree_impl); | 384 void PushPropertyTreesTo(LayerTreeImpl* tree_impl); |
| 376 void PushLayerTreePropertiesTo(LayerTreeImpl* tree_impl); | 385 void PushLayerTreePropertiesTo(LayerTreeImpl* tree_impl); |
| 377 void PushLayerTreeHostPropertiesTo(LayerTreeHostImpl* host_impl); | 386 void PushLayerTreeHostPropertiesTo(LayerTreeHostImpl* host_impl); |
| 378 | 387 |
| 379 MutatorHost* mutator_host() const { return mutator_host_; } | 388 MutatorHost* mutator_host() const { return mutator_host_; } |
| 380 | 389 |
| 381 Layer* LayerByElementId(ElementId element_id) const; | 390 Layer* LayerByElementId(ElementId element_id) const; |
| 382 void RegisterElement(ElementId element_id, | 391 void RegisterElement(ElementId element_id, |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 bool have_scroll_event_handlers_ = false; | 612 bool have_scroll_event_handlers_ = false; |
| 604 EventListenerProperties event_listener_properties_[static_cast<size_t>( | 613 EventListenerProperties event_listener_properties_[static_cast<size_t>( |
| 605 EventListenerClass::kNumClasses)]; | 614 EventListenerClass::kNumClasses)]; |
| 606 | 615 |
| 607 std::unique_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; | 616 std::unique_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; |
| 608 | 617 |
| 609 PropertyTrees property_trees_; | 618 PropertyTrees property_trees_; |
| 610 | 619 |
| 611 bool needs_full_tree_sync_ = true; | 620 bool needs_full_tree_sync_ = true; |
| 612 | 621 |
| 622 bool needs_surface_ids_sync_ = false; |
| 623 |
| 613 gfx::Vector2dF elastic_overscroll_; | 624 gfx::Vector2dF elastic_overscroll_; |
| 614 | 625 |
| 615 scoped_refptr<HeadsUpDisplayLayer> hud_layer_; | 626 scoped_refptr<HeadsUpDisplayLayer> hud_layer_; |
| 616 | 627 |
| 628 std::vector<SurfaceId> surface_layer_ids_; |
| 629 |
| 617 // Set of layers that need to push properties. | 630 // Set of layers that need to push properties. |
| 618 std::unordered_set<Layer*> layers_that_should_push_properties_; | 631 std::unordered_set<Layer*> layers_that_should_push_properties_; |
| 619 | 632 |
| 620 // Layer id to Layer map. | 633 // Layer id to Layer map. |
| 621 std::unordered_map<int, Layer*> layer_id_map_; | 634 std::unordered_map<int, Layer*> layer_id_map_; |
| 622 | 635 |
| 623 std::unordered_map<ElementId, Layer*, ElementIdHash> element_layers_map_; | 636 std::unordered_map<ElementId, Layer*, ElementIdHash> element_layers_map_; |
| 624 | 637 |
| 625 bool in_paint_layer_contents_ = false; | 638 bool in_paint_layer_contents_ = false; |
| 626 bool in_update_property_trees_ = false; | 639 bool in_update_property_trees_ = false; |
| 627 | 640 |
| 628 // This is true if atleast one layer in the layer tree has a copy request. We | 641 // This is true if atleast one layer in the layer tree has a copy request. We |
| 629 // use this bool to decide whether we need to compute subtree has copy request | 642 // use this bool to decide whether we need to compute subtree has copy request |
| 630 // for every layer during property tree building. | 643 // for every layer during property tree building. |
| 631 bool has_copy_request_ = false; | 644 bool has_copy_request_ = false; |
| 632 | 645 |
| 633 MutatorHost* mutator_host_; | 646 MutatorHost* mutator_host_; |
| 634 | 647 |
| 635 std::vector<std::pair<sk_sp<const SkImage>, base::Callback<void(bool)>>> | 648 std::vector<std::pair<sk_sp<const SkImage>, base::Callback<void(bool)>>> |
| 636 queued_image_decodes_; | 649 queued_image_decodes_; |
| 637 | 650 |
| 638 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 651 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
| 639 }; | 652 }; |
| 640 | 653 |
| 641 } // namespace cc | 654 } // namespace cc |
| 642 | 655 |
| 643 #endif // CC_TREES_LAYER_TREE_HOST_H_ | 656 #endif // CC_TREES_LAYER_TREE_HOST_H_ |
| OLD | NEW |