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

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

Issue 2905533002: cc : Store surface layer ids on LayerTreeHost and push them at commit (Closed)
Patch Set: initialize Created 3 years, 6 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/surface_layer_unittest.cc ('k') | cc/trees/layer_tree_host.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_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
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 base::flat_set<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);
386 void PushSurfaceIdsTo(LayerTreeImpl* tree_impl);
377 void PushLayerTreeHostPropertiesTo(LayerTreeHostImpl* host_impl); 387 void PushLayerTreeHostPropertiesTo(LayerTreeHostImpl* host_impl);
378 388
379 MutatorHost* mutator_host() const { return mutator_host_; } 389 MutatorHost* mutator_host() const { return mutator_host_; }
380 390
381 Layer* LayerByElementId(ElementId element_id) const; 391 Layer* LayerByElementId(ElementId element_id) const;
382 void RegisterElement(ElementId element_id, 392 void RegisterElement(ElementId element_id,
383 ElementListType list_type, 393 ElementListType list_type,
384 Layer* layer); 394 Layer* layer);
385 void UnregisterElement(ElementId element_id, 395 void UnregisterElement(ElementId element_id,
386 ElementListType list_type, 396 ElementListType list_type,
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 bool have_scroll_event_handlers_ = false; 613 bool have_scroll_event_handlers_ = false;
604 EventListenerProperties event_listener_properties_[static_cast<size_t>( 614 EventListenerProperties event_listener_properties_[static_cast<size_t>(
605 EventListenerClass::kNumClasses)]; 615 EventListenerClass::kNumClasses)];
606 616
607 std::unique_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; 617 std::unique_ptr<PendingPageScaleAnimation> pending_page_scale_animation_;
608 618
609 PropertyTrees property_trees_; 619 PropertyTrees property_trees_;
610 620
611 bool needs_full_tree_sync_ = true; 621 bool needs_full_tree_sync_ = true;
612 622
623 bool needs_surface_ids_sync_ = false;
624
613 gfx::Vector2dF elastic_overscroll_; 625 gfx::Vector2dF elastic_overscroll_;
614 626
615 scoped_refptr<HeadsUpDisplayLayer> hud_layer_; 627 scoped_refptr<HeadsUpDisplayLayer> hud_layer_;
616 628
629 base::flat_set<SurfaceId> surface_layer_ids_;
630
617 // Set of layers that need to push properties. 631 // Set of layers that need to push properties.
618 std::unordered_set<Layer*> layers_that_should_push_properties_; 632 std::unordered_set<Layer*> layers_that_should_push_properties_;
619 633
620 // Layer id to Layer map. 634 // Layer id to Layer map.
621 std::unordered_map<int, Layer*> layer_id_map_; 635 std::unordered_map<int, Layer*> layer_id_map_;
622 636
623 std::unordered_map<ElementId, Layer*, ElementIdHash> element_layers_map_; 637 std::unordered_map<ElementId, Layer*, ElementIdHash> element_layers_map_;
624 638
625 bool in_paint_layer_contents_ = false; 639 bool in_paint_layer_contents_ = false;
626 bool in_update_property_trees_ = false; 640 bool in_update_property_trees_ = false;
627 641
628 // This is true if atleast one layer in the layer tree has a copy request. We 642 // 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 643 // use this bool to decide whether we need to compute subtree has copy request
630 // for every layer during property tree building. 644 // for every layer during property tree building.
631 bool has_copy_request_ = false; 645 bool has_copy_request_ = false;
632 646
633 MutatorHost* mutator_host_; 647 MutatorHost* mutator_host_;
634 648
635 std::vector<std::pair<sk_sp<const SkImage>, base::Callback<void(bool)>>> 649 std::vector<std::pair<sk_sp<const SkImage>, base::Callback<void(bool)>>>
636 queued_image_decodes_; 650 queued_image_decodes_;
637 651
638 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); 652 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost);
639 }; 653 };
640 654
641 } // namespace cc 655 } // namespace cc
642 656
643 #endif // CC_TREES_LAYER_TREE_HOST_H_ 657 #endif // CC_TREES_LAYER_TREE_HOST_H_
OLDNEW
« no previous file with comments | « cc/layers/surface_layer_unittest.cc ('k') | cc/trees/layer_tree_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698