OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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_IMPL_H_ | 5 #ifndef CC_LAYERS_LAYER_IMPL_H_ |
6 #define CC_LAYERS_LAYER_IMPL_H_ | 6 #define CC_LAYERS_LAYER_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | |
10 | 9 |
11 #include "base/logging.h" | 10 #include "base/logging.h" |
12 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
13 #include "base/values.h" | 12 #include "base/values.h" |
14 #include "cc/animation/layer_animation_controller.h" | 13 #include "cc/animation/layer_animation_controller.h" |
15 #include "cc/animation/layer_animation_value_observer.h" | 14 #include "cc/animation/layer_animation_value_observer.h" |
16 #include "cc/base/cc_export.h" | 15 #include "cc/base/cc_export.h" |
17 #include "cc/base/region.h" | 16 #include "cc/base/region.h" |
18 #include "cc/base/scoped_ptr_vector.h" | 17 #include "cc/base/scoped_ptr_vector.h" |
19 #include "cc/input/input_handler.h" | 18 #include "cc/input/input_handler.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 const LayerImpl* parent() const { return parent_; } | 68 const LayerImpl* parent() const { return parent_; } |
70 const OwnedLayerImplList& children() const { return children_; } | 69 const OwnedLayerImplList& children() const { return children_; } |
71 OwnedLayerImplList& children() { return children_; } | 70 OwnedLayerImplList& children() { return children_; } |
72 LayerImpl* child_at(size_t index) const { return children_[index]; } | 71 LayerImpl* child_at(size_t index) const { return children_[index]; } |
73 void AddChild(scoped_ptr<LayerImpl> child); | 72 void AddChild(scoped_ptr<LayerImpl> child); |
74 scoped_ptr<LayerImpl> RemoveChild(LayerImpl* child); | 73 scoped_ptr<LayerImpl> RemoveChild(LayerImpl* child); |
75 void set_parent(LayerImpl* parent) { parent_ = parent; } | 74 void set_parent(LayerImpl* parent) { parent_ = parent; } |
76 // Warning: This does not preserve tree structure invariants. | 75 // Warning: This does not preserve tree structure invariants. |
77 void ClearChildList(); | 76 void ClearChildList(); |
78 | 77 |
79 void PassRequestCopyCallbacks( | 78 void PassCopyRequests(ScopedPtrVector<CopyOutputRequest>* requests); |
80 std::vector<RenderPass::RequestCopyAsBitmapCallback>* callbacks); | 79 void TakeCopyRequests(ScopedPtrVector<CopyOutputRequest>* request); |
81 void TakeRequestCopyCallbacks( | 80 bool HasCopyRequest() const { return !copy_requests_.empty(); } |
82 std::vector<RenderPass::RequestCopyAsBitmapCallback>* callbacks); | |
83 bool HasRequestCopyCallback() const { | |
84 return !request_copy_callbacks_.empty(); | |
85 } | |
86 | 81 |
87 void SetMaskLayer(scoped_ptr<LayerImpl> mask_layer); | 82 void SetMaskLayer(scoped_ptr<LayerImpl> mask_layer); |
88 LayerImpl* mask_layer() { return mask_layer_.get(); } | 83 LayerImpl* mask_layer() { return mask_layer_.get(); } |
89 const LayerImpl* mask_layer() const { return mask_layer_.get(); } | 84 const LayerImpl* mask_layer() const { return mask_layer_.get(); } |
90 scoped_ptr<LayerImpl> TakeMaskLayer(); | 85 scoped_ptr<LayerImpl> TakeMaskLayer(); |
91 | 86 |
92 void SetReplicaLayer(scoped_ptr<LayerImpl> replica_layer); | 87 void SetReplicaLayer(scoped_ptr<LayerImpl> replica_layer); |
93 LayerImpl* replica_layer() { return replica_layer_.get(); } | 88 LayerImpl* replica_layer() { return replica_layer_.get(); } |
94 const LayerImpl* replica_layer() const { return replica_layer_.get(); } | 89 const LayerImpl* replica_layer() const { return replica_layer_.get(); } |
95 scoped_ptr<LayerImpl> TakeReplicaLayer(); | 90 scoped_ptr<LayerImpl> TakeReplicaLayer(); |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 scoped_refptr<LayerAnimationController> layer_animation_controller_; | 533 scoped_refptr<LayerAnimationController> layer_animation_controller_; |
539 | 534 |
540 // Manages scrollbars for this layer | 535 // Manages scrollbars for this layer |
541 scoped_ptr<ScrollbarAnimationController> scrollbar_animation_controller_; | 536 scoped_ptr<ScrollbarAnimationController> scrollbar_animation_controller_; |
542 | 537 |
543 // Weak pointers to this layer's scrollbars, if it has them. Updated during | 538 // Weak pointers to this layer's scrollbars, if it has them. Updated during |
544 // tree synchronization. | 539 // tree synchronization. |
545 ScrollbarLayerImpl* horizontal_scrollbar_layer_; | 540 ScrollbarLayerImpl* horizontal_scrollbar_layer_; |
546 ScrollbarLayerImpl* vertical_scrollbar_layer_; | 541 ScrollbarLayerImpl* vertical_scrollbar_layer_; |
547 | 542 |
548 std::vector<RenderPass::RequestCopyAsBitmapCallback> request_copy_callbacks_; | 543 ScopedPtrVector<CopyOutputRequest> copy_requests_; |
549 | 544 |
550 // Group of properties that need to be computed based on the layer tree | 545 // Group of properties that need to be computed based on the layer tree |
551 // hierarchy before layers can be drawn. | 546 // hierarchy before layers can be drawn. |
552 DrawProperties<LayerImpl, RenderSurfaceImpl> draw_properties_; | 547 DrawProperties<LayerImpl, RenderSurfaceImpl> draw_properties_; |
553 | 548 |
554 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 549 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
555 }; | 550 }; |
556 | 551 |
557 } // namespace cc | 552 } // namespace cc |
558 | 553 |
559 #endif // CC_LAYERS_LAYER_IMPL_H_ | 554 #endif // CC_LAYERS_LAYER_IMPL_H_ |
OLD | NEW |