| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 void SetBounds(const gfx::Size& bounds); | 117 void SetBounds(const gfx::Size& bounds); |
| 118 gfx::Size bounds() const { return bounds_; } | 118 gfx::Size bounds() const { return bounds_; } |
| 119 | 119 |
| 120 void SetMasksToBounds(bool masks_to_bounds); | 120 void SetMasksToBounds(bool masks_to_bounds); |
| 121 bool masks_to_bounds() const { return masks_to_bounds_; } | 121 bool masks_to_bounds() const { return masks_to_bounds_; } |
| 122 | 122 |
| 123 void SetMaskLayer(Layer* mask_layer); | 123 void SetMaskLayer(Layer* mask_layer); |
| 124 Layer* mask_layer() { return mask_layer_.get(); } | 124 Layer* mask_layer() { return mask_layer_.get(); } |
| 125 const Layer* mask_layer() const { return mask_layer_.get(); } | 125 const Layer* mask_layer() const { return mask_layer_.get(); } |
| 126 | 126 |
| 127 virtual void SetNeedsDisplayRect(const gfx::RectF& dirty_rect); | 127 virtual void SetNeedsDisplayRect(const gfx::Rect& dirty_rect); |
| 128 void SetNeedsDisplay() { SetNeedsDisplayRect(gfx::RectF(bounds())); } | 128 void SetNeedsDisplay() { SetNeedsDisplayRect(gfx::Rect(bounds())); } |
| 129 | 129 |
| 130 void SetOpacity(float opacity); | 130 void SetOpacity(float opacity); |
| 131 float opacity() const { return opacity_; } | 131 float opacity() const { return opacity_; } |
| 132 bool OpacityIsAnimating() const; | 132 bool OpacityIsAnimating() const; |
| 133 virtual bool OpacityCanAnimateOnImplThread() const; | 133 virtual bool OpacityCanAnimateOnImplThread() const; |
| 134 | 134 |
| 135 void SetBlendMode(SkXfermode::Mode blend_mode); | 135 void SetBlendMode(SkXfermode::Mode blend_mode); |
| 136 SkXfermode::Mode blend_mode() const { return blend_mode_; } | 136 SkXfermode::Mode blend_mode() const { return blend_mode_; } |
| 137 | 137 |
| 138 bool uses_default_blend_mode() const { | 138 bool uses_default_blend_mode() const { |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 | 415 |
| 416 void AddLayerAnimationEventObserver( | 416 void AddLayerAnimationEventObserver( |
| 417 LayerAnimationEventObserver* animation_observer); | 417 LayerAnimationEventObserver* animation_observer); |
| 418 void RemoveLayerAnimationEventObserver( | 418 void RemoveLayerAnimationEventObserver( |
| 419 LayerAnimationEventObserver* animation_observer); | 419 LayerAnimationEventObserver* animation_observer); |
| 420 | 420 |
| 421 virtual SimpleEnclosedRegion VisibleContentOpaqueRegion() const; | 421 virtual SimpleEnclosedRegion VisibleContentOpaqueRegion() const; |
| 422 | 422 |
| 423 virtual ScrollbarLayerInterface* ToScrollbarLayer(); | 423 virtual ScrollbarLayerInterface* ToScrollbarLayer(); |
| 424 | 424 |
| 425 gfx::Rect LayerRectToContentRect(const gfx::RectF& layer_rect) const; | 425 gfx::Rect LayerRectToContentRect(const gfx::Rect& layer_rect) const; |
| 426 | 426 |
| 427 virtual skia::RefPtr<SkPicture> GetPicture() const; | 427 virtual skia::RefPtr<SkPicture> GetPicture() const; |
| 428 | 428 |
| 429 // Constructs a LayerImpl of the correct runtime type for this Layer type. | 429 // Constructs a LayerImpl of the correct runtime type for this Layer type. |
| 430 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl); | 430 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl); |
| 431 | 431 |
| 432 bool NeedsDisplayForTesting() const { return !update_rect_.IsEmpty(); } | 432 bool NeedsDisplayForTesting() const { return !update_rect_.IsEmpty(); } |
| 433 void ResetNeedsDisplayForTesting() { update_rect_ = gfx::RectF(); } | 433 void ResetNeedsDisplayForTesting() { update_rect_ = gfx::Rect(); } |
| 434 | 434 |
| 435 RenderingStatsInstrumentation* rendering_stats_instrumentation() const; | 435 RenderingStatsInstrumentation* rendering_stats_instrumentation() const; |
| 436 | 436 |
| 437 const PaintProperties& paint_properties() const { | 437 const PaintProperties& paint_properties() const { |
| 438 return paint_properties_; | 438 return paint_properties_; |
| 439 } | 439 } |
| 440 | 440 |
| 441 // The scale at which contents should be rastered, to match the scale at | 441 // The scale at which contents should be rastered, to match the scale at |
| 442 // which they will drawn to the screen. This scale is a component of the | 442 // which they will drawn to the screen. This scale is a component of the |
| 443 // contents scale but does not include page/device scale factors. | 443 // contents scale but does not include page/device scale factors. |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 | 517 |
| 518 // Tracks whether this layer may have changed stacking order with its | 518 // Tracks whether this layer may have changed stacking order with its |
| 519 // siblings. | 519 // siblings. |
| 520 bool stacking_order_changed_; | 520 bool stacking_order_changed_; |
| 521 | 521 |
| 522 // The update rect is the region of the compositor resource that was | 522 // The update rect is the region of the compositor resource that was |
| 523 // actually updated by the compositor. For layers that may do updating | 523 // actually updated by the compositor. For layers that may do updating |
| 524 // outside the compositor's control (i.e. plugin layers), this information | 524 // outside the compositor's control (i.e. plugin layers), this information |
| 525 // is not available and the update rect will remain empty. | 525 // is not available and the update rect will remain empty. |
| 526 // Note this rect is in layer space (not content space). | 526 // Note this rect is in layer space (not content space). |
| 527 gfx::RectF update_rect_; | 527 gfx::Rect update_rect_; |
| 528 | 528 |
| 529 scoped_refptr<Layer> mask_layer_; | 529 scoped_refptr<Layer> mask_layer_; |
| 530 | 530 |
| 531 int layer_id_; | 531 int layer_id_; |
| 532 | 532 |
| 533 // When true, the layer is about to perform an update. Any commit requests | 533 // When true, the layer is about to perform an update. Any commit requests |
| 534 // will be handled implicitly after the update completes. | 534 // will be handled implicitly after the update completes. |
| 535 bool ignore_set_needs_commit_; | 535 bool ignore_set_needs_commit_; |
| 536 | 536 |
| 537 // Layers that share a sorting context id will be sorted together in 3d | 537 // Layers that share a sorting context id will be sorted together in 3d |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 641 DrawProperties<Layer> draw_properties_; | 641 DrawProperties<Layer> draw_properties_; |
| 642 | 642 |
| 643 PaintProperties paint_properties_; | 643 PaintProperties paint_properties_; |
| 644 | 644 |
| 645 DISALLOW_COPY_AND_ASSIGN(Layer); | 645 DISALLOW_COPY_AND_ASSIGN(Layer); |
| 646 }; | 646 }; |
| 647 | 647 |
| 648 } // namespace cc | 648 } // namespace cc |
| 649 | 649 |
| 650 #endif // CC_LAYERS_LAYER_H_ | 650 #endif // CC_LAYERS_LAYER_H_ |
| OLD | NEW |