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 |
400 virtual skia::RefPtr<SkPicture> GetPicture() const; | 407 virtual skia::RefPtr<SkPicture> GetPicture() const; |
401 | 408 |
402 virtual bool CanClipSelf() const; | 409 virtual bool CanClipSelf() const; |
403 | 410 |
404 // Constructs a LayerImpl of the correct runtime type for this Layer type. | 411 // Constructs a LayerImpl of the correct runtime type for this Layer type. |
405 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl); | 412 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl); |
406 | 413 |
407 bool NeedsDisplayForTesting() const { return !update_rect_.IsEmpty(); } | 414 bool NeedsDisplayForTesting() const { return !update_rect_.IsEmpty(); } |
408 void ResetNeedsDisplayForTesting() { update_rect_ = gfx::RectF(); } | 415 void ResetNeedsDisplayForTesting() { update_rect_ = gfx::RectF(); } |
409 | 416 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 // that it needs a commit yet. It needs CalcDrawProperties and UpdateLayers | 448 // that it needs a commit yet. It needs CalcDrawProperties and UpdateLayers |
442 // before it knows whether or not a commit is required. | 449 // before it knows whether or not a commit is required. |
443 void SetNeedsUpdate(); | 450 void SetNeedsUpdate(); |
444 // Called when a property has been modified in a way that the layer | 451 // Called when a property has been modified in a way that the layer |
445 // knows immediately that a commit is required. This implies SetNeedsUpdate | 452 // knows immediately that a commit is required. This implies SetNeedsUpdate |
446 // as well as SetNeedsPushProperties to push that property. | 453 // as well as SetNeedsPushProperties to push that property. |
447 void SetNeedsCommit(); | 454 void SetNeedsCommit(); |
448 // Called when there's been a change in layer structure. Implies both | 455 // Called when there's been a change in layer structure. Implies both |
449 // SetNeedsUpdate and SetNeedsCommit, but not SetNeedsPushProperties. | 456 // SetNeedsUpdate and SetNeedsCommit, but not SetNeedsPushProperties. |
450 void SetNeedsFullTreeSync(); | 457 void SetNeedsFullTreeSync(); |
451 | 458 bool IsPropertyChangeAllowed() const; |
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(); | |
456 | 459 |
457 void SetNeedsPushProperties(); | 460 void SetNeedsPushProperties(); |
458 void AddDependentNeedsPushProperties(); | 461 void AddDependentNeedsPushProperties(); |
459 void RemoveDependentNeedsPushProperties(); | 462 void RemoveDependentNeedsPushProperties(); |
460 bool parent_should_know_need_push_properties() const { | 463 bool parent_should_know_need_push_properties() const { |
461 return needs_push_properties() || descendant_needs_push_properties(); | 464 return needs_push_properties() || descendant_needs_push_properties(); |
462 } | 465 } |
463 | 466 |
464 bool IsPropertyChangeAllowed() const; | |
465 | |
466 // If this layer has a scroll parent, it removes |this| from its list of | 467 // If this layer has a scroll parent, it removes |this| from its list of |
467 // scroll children. | 468 // scroll children. |
468 void RemoveFromScrollTree(); | 469 void RemoveFromScrollTree(); |
469 | 470 |
470 // If this layer has a clip parent, it removes |this| from its list of clip | 471 // If this layer has a clip parent, it removes |this| from its list of clip |
471 // children. | 472 // children. |
472 void RemoveFromClipTree(); | 473 void RemoveFromClipTree(); |
473 | 474 |
474 void reset_raster_scale_to_unknown() { raster_scale_ = 0.f; } | 475 void reset_raster_scale_to_unknown() { raster_scale_ = 0.f; } |
475 | 476 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 DrawProperties<Layer, RenderSurface> draw_properties_; | 584 DrawProperties<Layer, RenderSurface> draw_properties_; |
584 | 585 |
585 PaintProperties paint_properties_; | 586 PaintProperties paint_properties_; |
586 | 587 |
587 DISALLOW_COPY_AND_ASSIGN(Layer); | 588 DISALLOW_COPY_AND_ASSIGN(Layer); |
588 }; | 589 }; |
589 | 590 |
590 } // namespace cc | 591 } // namespace cc |
591 | 592 |
592 #endif // CC_LAYERS_LAYER_H_ | 593 #endif // CC_LAYERS_LAYER_H_ |
OLD | NEW |