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

Side by Side Diff: cc/layers/layer.h

Issue 2716583004: cc: Remove SetNeedsUpdate function from cc::Layer (Closed)
Patch Set: add/edit/transport comments Created 3 years, 10 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/BUILD.gn ('k') | cc/layers/layer.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 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
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 the layer as needing to push its properties to the LayerImpl during
351 // 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
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
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
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_
OLDNEW
« no previous file with comments | « cc/BUILD.gn ('k') | cc/layers/layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698