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 <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 LayerAnimationEventObserver* animation_observer); | 390 LayerAnimationEventObserver* animation_observer); |
391 void RemoveLayerAnimationEventObserver( | 391 void RemoveLayerAnimationEventObserver( |
392 LayerAnimationEventObserver* animation_observer); | 392 LayerAnimationEventObserver* animation_observer); |
393 | 393 |
394 virtual Region VisibleContentOpaqueRegion() const; | 394 virtual Region VisibleContentOpaqueRegion() const; |
395 | 395 |
396 virtual PaintedScrollbarLayer* ToScrollbarLayer(); | 396 virtual PaintedScrollbarLayer* ToScrollbarLayer(); |
397 | 397 |
398 gfx::Rect LayerRectToContentRect(const gfx::RectF& layer_rect) const; | 398 gfx::Rect LayerRectToContentRect(const gfx::RectF& layer_rect) const; |
399 | 399 |
400 // In impl-side painting, this returns true if this layer type is not | |
401 // compatible with the main thread running freely, such as a double-buffered | |
402 // canvas that doesn't want to be triple-buffered across all three trees. | |
403 virtual bool BlocksPendingCommit() const; | |
404 // Returns true if anything in this tree blocksPendingCommit. | |
405 bool BlocksPendingCommitRecursive() const; | |
406 | |
407 virtual skia::RefPtr<SkPicture> GetPicture() const; | 400 virtual skia::RefPtr<SkPicture> GetPicture() const; |
408 | 401 |
409 virtual bool CanClipSelf() const; | 402 virtual bool CanClipSelf() const; |
410 | 403 |
411 // Constructs a LayerImpl of the correct runtime type for this Layer type. | 404 // Constructs a LayerImpl of the correct runtime type for this Layer type. |
412 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl); | 405 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl); |
413 | 406 |
414 bool NeedsDisplayForTesting() const { return !update_rect_.IsEmpty(); } | 407 bool NeedsDisplayForTesting() const { return !update_rect_.IsEmpty(); } |
415 void ResetNeedsDisplayForTesting() { update_rect_ = gfx::RectF(); } | 408 void ResetNeedsDisplayForTesting() { update_rect_ = gfx::RectF(); } |
416 | 409 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 // that it needs a commit yet. It needs CalcDrawProperties and UpdateLayers | 441 // that it needs a commit yet. It needs CalcDrawProperties and UpdateLayers |
449 // before it knows whether or not a commit is required. | 442 // before it knows whether or not a commit is required. |
450 void SetNeedsUpdate(); | 443 void SetNeedsUpdate(); |
451 // Called when a property has been modified in a way that the layer | 444 // Called when a property has been modified in a way that the layer |
452 // knows immediately that a commit is required. This implies SetNeedsUpdate | 445 // knows immediately that a commit is required. This implies SetNeedsUpdate |
453 // as well as SetNeedsPushProperties to push that property. | 446 // as well as SetNeedsPushProperties to push that property. |
454 void SetNeedsCommit(); | 447 void SetNeedsCommit(); |
455 // Called when there's been a change in layer structure. Implies both | 448 // Called when there's been a change in layer structure. Implies both |
456 // SetNeedsUpdate and SetNeedsCommit, but not SetNeedsPushProperties. | 449 // SetNeedsUpdate and SetNeedsCommit, but not SetNeedsPushProperties. |
457 void SetNeedsFullTreeSync(); | 450 void SetNeedsFullTreeSync(); |
458 bool IsPropertyChangeAllowed() const; | 451 |
| 452 // Called when the next commit should wait until the pending tree is activated |
| 453 // before finishing the commit and unblocking the main thread. Used to ensure |
| 454 // unused resources on the impl thread are returned before commit completes. |
| 455 void SetNextCommitWaitsForActivation(); |
459 | 456 |
460 void SetNeedsPushProperties(); | 457 void SetNeedsPushProperties(); |
461 void AddDependentNeedsPushProperties(); | 458 void AddDependentNeedsPushProperties(); |
462 void RemoveDependentNeedsPushProperties(); | 459 void RemoveDependentNeedsPushProperties(); |
463 bool parent_should_know_need_push_properties() const { | 460 bool parent_should_know_need_push_properties() const { |
464 return needs_push_properties() || descendant_needs_push_properties(); | 461 return needs_push_properties() || descendant_needs_push_properties(); |
465 } | 462 } |
466 | 463 |
| 464 bool IsPropertyChangeAllowed() const; |
| 465 |
467 // If this layer has a scroll parent, it removes |this| from its list of | 466 // If this layer has a scroll parent, it removes |this| from its list of |
468 // scroll children. | 467 // scroll children. |
469 void RemoveFromScrollTree(); | 468 void RemoveFromScrollTree(); |
470 | 469 |
471 // If this layer has a clip parent, it removes |this| from its list of clip | 470 // If this layer has a clip parent, it removes |this| from its list of clip |
472 // children. | 471 // children. |
473 void RemoveFromClipTree(); | 472 void RemoveFromClipTree(); |
474 | 473 |
475 void reset_raster_scale_to_unknown() { raster_scale_ = 0.f; } | 474 void reset_raster_scale_to_unknown() { raster_scale_ = 0.f; } |
476 | 475 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 DrawProperties<Layer, RenderSurface> draw_properties_; | 583 DrawProperties<Layer, RenderSurface> draw_properties_; |
585 | 584 |
586 PaintProperties paint_properties_; | 585 PaintProperties paint_properties_; |
587 | 586 |
588 DISALLOW_COPY_AND_ASSIGN(Layer); | 587 DISALLOW_COPY_AND_ASSIGN(Layer); |
589 }; | 588 }; |
590 | 589 |
591 } // namespace cc | 590 } // namespace cc |
592 | 591 |
593 #endif // CC_LAYERS_LAYER_H_ | 592 #endif // CC_LAYERS_LAYER_H_ |
OLD | NEW |