Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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_LAYERS_LAYER_H_ | 5 #ifndef CC_LAYERS_LAYER_H_ |
| 6 #define CC_LAYERS_LAYER_H_ | 6 #define CC_LAYERS_LAYER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 340 // Constructs a LayerImpl of the correct runtime type for this Layer type. | 340 // Constructs a LayerImpl of the correct runtime type for this Layer type. |
| 341 virtual std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl); | 341 virtual std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl); |
| 342 | 342 |
| 343 bool NeedsDisplayForTesting() const { return !inputs_.update_rect.IsEmpty(); } | 343 bool NeedsDisplayForTesting() const { return !inputs_.update_rect.IsEmpty(); } |
| 344 void ResetNeedsDisplayForTesting() { inputs_.update_rect = gfx::Rect(); } | 344 void ResetNeedsDisplayForTesting() { inputs_.update_rect = gfx::Rect(); } |
| 345 | 345 |
| 346 const PaintProperties& paint_properties() const { | 346 const PaintProperties& paint_properties() const { |
| 347 return paint_properties_; | 347 return paint_properties_; |
| 348 } | 348 } |
| 349 | 349 |
| 350 // Mark current layers as need to push properties that are changed to impl | |
|
danakj
2017/02/24 00:52:38
"Mark the layer as needing to push its properties
| |
| 351 // thread during commit. | |
| 350 void SetNeedsPushProperties(); | 352 void SetNeedsPushProperties(); |
| 351 void ResetNeedsPushPropertiesForTesting(); | 353 void ResetNeedsPushPropertiesForTesting(); |
| 352 | 354 |
| 353 virtual void RunMicroBenchmark(MicroBenchmark* benchmark); | 355 virtual void RunMicroBenchmark(MicroBenchmark* benchmark); |
| 354 | 356 |
| 355 void Set3dSortingContextId(int id); | 357 void Set3dSortingContextId(int id); |
| 356 int sorting_context_id() const { return inputs_.sorting_context_id; } | 358 int sorting_context_id() const { return inputs_.sorting_context_id; } |
| 357 | 359 |
| 358 void set_property_tree_sequence_number(int sequence_number) { | 360 void set_property_tree_sequence_number(int sequence_number) { |
| 359 property_tree_sequence_number_ = sequence_number; | 361 property_tree_sequence_number_ = sequence_number; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 400 } | 402 } |
| 401 void set_visible_layer_rect(const gfx::Rect& rect) { | 403 void set_visible_layer_rect(const gfx::Rect& rect) { |
| 402 visible_layer_rect_ = rect; | 404 visible_layer_rect_ = rect; |
| 403 } | 405 } |
| 404 | 406 |
| 405 void SetSubtreePropertyChanged(); | 407 void SetSubtreePropertyChanged(); |
| 406 bool subtree_property_changed() const { return subtree_property_changed_; } | 408 bool subtree_property_changed() const { return subtree_property_changed_; } |
| 407 | 409 |
| 408 void SetMayContainVideo(bool yes); | 410 void SetMayContainVideo(bool yes); |
| 409 | 411 |
| 410 void DidBeginTracing(); | |
| 411 | |
| 412 int num_copy_requests_in_target_subtree(); | 412 int num_copy_requests_in_target_subtree(); |
| 413 | 413 |
| 414 void SetElementId(ElementId id); | 414 void SetElementId(ElementId id); |
| 415 ElementId element_id() const { return inputs_.element_id; } | 415 ElementId element_id() const { return inputs_.element_id; } |
| 416 | 416 |
| 417 void SetMutableProperties(uint32_t properties); | 417 void SetMutableProperties(uint32_t properties); |
| 418 uint32_t mutable_properties() const { return inputs_.mutable_properties; } | 418 uint32_t mutable_properties() const { return inputs_.mutable_properties; } |
| 419 | 419 |
| 420 bool HasTickingAnimationForTesting() const; | 420 bool HasTickingAnimationForTesting() const; |
| 421 | 421 |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 449 LayerTreeHost* layer_tree_host() const { return layer_tree_host_; } | 449 LayerTreeHost* layer_tree_host() const { return layer_tree_host_; } |
| 450 | 450 |
| 451 protected: | 451 protected: |
| 452 friend class LayerImpl; | 452 friend class LayerImpl; |
| 453 friend class TreeSynchronizer; | 453 friend class TreeSynchronizer; |
| 454 virtual ~Layer(); | 454 virtual ~Layer(); |
| 455 Layer(); | 455 Layer(); |
| 456 | 456 |
| 457 // These SetNeeds functions are in order of severity of update: | 457 // These SetNeeds functions are in order of severity of update: |
| 458 // | 458 // |
| 459 // Called when this layer has been modified in some way, but isn't sure | 459 // Called when a property has been modified in a way that the layer knows |
| 460 // that it needs a commit yet. It needs CalcDrawProperties and UpdateLayers | 460 // immediately that a commit is required. This implies SetNeedsPushProperties |
| 461 // before it knows whether or not a commit is required. | 461 // to push that property. |
| 462 void SetNeedsUpdate(); | |
| 463 // Called when a property has been modified in a way that the layer | |
| 464 // knows immediately that a commit is required. This implies SetNeedsUpdate | |
| 465 // as well as SetNeedsPushProperties to push that property. | |
| 466 void SetNeedsCommit(); | 462 void SetNeedsCommit(); |
| 467 // This is identical to SetNeedsCommit, but the former requests a rebuild of | 463 // This is identical to SetNeedsCommit, but the former requests a rebuild of |
| 468 // the property trees. | 464 // the property trees. |
| 469 void SetNeedsCommitNoRebuild(); | 465 void SetNeedsCommitNoRebuild(); |
| 470 // Called when there's been a change in layer structure. Implies both | 466 // Called when there's been a change in layer structure. Implies |
| 471 // SetNeedsUpdate and SetNeedsCommit, but not SetNeedsPushProperties. | 467 // SetNeedsCommit and property tree rebuld, but not SetNeedsPushProperties |
| 468 // (the full tree is synced over). | |
| 472 void SetNeedsFullTreeSync(); | 469 void SetNeedsFullTreeSync(); |
| 473 | 470 |
| 474 // Called when the next commit should wait until the pending tree is activated | 471 // Called when the next commit should wait until the pending tree is activated |
| 475 // before finishing the commit and unblocking the main thread. Used to ensure | 472 // before finishing the commit and unblocking the main thread. Used to ensure |
| 476 // unused resources on the impl thread are returned before commit completes. | 473 // unused resources on the impl thread are returned before commit completes. |
| 477 void SetNextCommitWaitsForActivation(); | 474 void SetNextCommitWaitsForActivation(); |
| 478 | 475 |
| 479 // Will recalculate whether the layer draws content and set draws_content_ | 476 // Will recalculate whether the layer draws content and set draws_content_ |
| 480 // appropriately. | 477 // appropriately. |
| 481 void UpdateDrawsContent(bool has_drawable_content); | 478 void UpdateDrawsContent(bool has_drawable_content); |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 663 // These all act like draw properties, so don't need push properties. | 660 // These all act like draw properties, so don't need push properties. |
| 664 gfx::Rect visible_layer_rect_; | 661 gfx::Rect visible_layer_rect_; |
| 665 size_t num_unclipped_descendants_; | 662 size_t num_unclipped_descendants_; |
| 666 | 663 |
| 667 DISALLOW_COPY_AND_ASSIGN(Layer); | 664 DISALLOW_COPY_AND_ASSIGN(Layer); |
| 668 }; | 665 }; |
| 669 | 666 |
| 670 } // namespace cc | 667 } // namespace cc |
| 671 | 668 |
| 672 #endif // CC_LAYERS_LAYER_H_ | 669 #endif // CC_LAYERS_LAYER_H_ |
| OLD | NEW |