| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 bool has_render_surface() const { return !!render_surface(); } | 153 bool has_render_surface() const { return !!render_surface(); } |
| 154 | 154 |
| 155 void SetMaskLayer(std::unique_ptr<LayerImpl> mask_layer); | 155 void SetMaskLayer(std::unique_ptr<LayerImpl> mask_layer); |
| 156 LayerImpl* mask_layer() { return mask_layer_; } | 156 LayerImpl* mask_layer() { return mask_layer_; } |
| 157 const LayerImpl* mask_layer() const { return mask_layer_; } | 157 const LayerImpl* mask_layer() const { return mask_layer_; } |
| 158 std::unique_ptr<LayerImpl> TakeMaskLayer(); | 158 std::unique_ptr<LayerImpl> TakeMaskLayer(); |
| 159 | 159 |
| 160 void SetReplicaLayer(std::unique_ptr<LayerImpl> replica_layer); | 160 void SetReplicaLayer(std::unique_ptr<LayerImpl> replica_layer); |
| 161 LayerImpl* replica_layer() { return replica_layer_; } | 161 LayerImpl* replica_layer() { return replica_layer_; } |
| 162 const LayerImpl* replica_layer() const { return replica_layer_; } | 162 const LayerImpl* replica_layer() const { return replica_layer_; } |
| 163 std::unique_ptr<LayerImpl> TakeReplicaLayer(); | 163 std::unique_ptr<LayerImpl> TakeReplicaLayerForTesting(); |
| 164 | 164 |
| 165 bool has_mask() const { return !!mask_layer_; } | 165 bool has_mask() const { return !!mask_layer_; } |
| 166 bool has_replica() const { return !!replica_layer_; } | 166 bool has_replica() const { return !!replica_layer_; } |
| 167 bool replica_has_mask() const { | 167 bool replica_has_mask() const { |
| 168 return replica_layer_ && (mask_layer_ || replica_layer_->mask_layer_); | 168 return replica_layer_ && (mask_layer_ || replica_layer_->mask_layer_); |
| 169 } | 169 } |
| 170 | 170 |
| 171 LayerTreeImpl* layer_tree_impl() const { return layer_tree_impl_; } | 171 LayerTreeImpl* layer_tree_impl() const { return layer_tree_impl_; } |
| 172 | 172 |
| 173 void PopulateSharedQuadState(SharedQuadState* state) const; | 173 void PopulateSharedQuadState(SharedQuadState* state) const; |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 void AppendDebugBorderQuad(RenderPass* render_pass, | 528 void AppendDebugBorderQuad(RenderPass* render_pass, |
| 529 const gfx::Size& bounds, | 529 const gfx::Size& bounds, |
| 530 const SharedQuadState* shared_quad_state, | 530 const SharedQuadState* shared_quad_state, |
| 531 AppendQuadsData* append_quads_data, | 531 AppendQuadsData* append_quads_data, |
| 532 SkColor color, | 532 SkColor color, |
| 533 float width) const; | 533 float width) const; |
| 534 | 534 |
| 535 gfx::Rect GetScaledEnclosingRectInTargetSpace(float scale) const; | 535 gfx::Rect GetScaledEnclosingRectInTargetSpace(float scale) const; |
| 536 | 536 |
| 537 private: | 537 private: |
| 538 // Warning: This does not preserve tree structure invariants. | |
| 539 void ClearChildList(); | |
| 540 | |
| 541 void ValidateQuadResourcesInternal(DrawQuad* quad) const; | 538 void ValidateQuadResourcesInternal(DrawQuad* quad) const; |
| 542 | 539 |
| 543 virtual const char* LayerTypeAsString() const; | 540 virtual const char* LayerTypeAsString() const; |
| 544 | 541 |
| 545 // Properties internal to LayerImpl | 542 // Properties internal to LayerImpl |
| 546 LayerImpl* parent_; | 543 LayerImpl* parent_; |
| 547 LayerImplList children_; | 544 LayerImplList children_; |
| 548 | 545 |
| 549 // mask_layer_ can be temporarily stolen during tree sync, we need this ID to | 546 // mask_layer_ can be temporarily stolen during tree sync, we need this ID to |
| 550 // confirm newly assigned layer is still the previous one | 547 // confirm newly assigned layer is still the previous one |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 | 639 |
| 643 bool scrolls_drawn_descendant_; | 640 bool scrolls_drawn_descendant_; |
| 644 bool has_will_change_transform_hint_; | 641 bool has_will_change_transform_hint_; |
| 645 | 642 |
| 646 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 643 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
| 647 }; | 644 }; |
| 648 | 645 |
| 649 } // namespace cc | 646 } // namespace cc |
| 650 | 647 |
| 651 #endif // CC_LAYERS_LAYER_IMPL_H_ | 648 #endif // CC_LAYERS_LAYER_IMPL_H_ |
| OLD | NEW |