Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(504)

Side by Side Diff: cc/layers/layer_impl.h

Issue 2054483002: Revert of cc : Make LayerImpl destruction independent of tree hierarchy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | cc/layers/layer_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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> TakeReplicaLayerForTesting(); 163 std::unique_ptr<LayerImpl> TakeReplicaLayer();
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
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
538 void ValidateQuadResourcesInternal(DrawQuad* quad) const; 541 void ValidateQuadResourcesInternal(DrawQuad* quad) const;
539 542
540 virtual const char* LayerTypeAsString() const; 543 virtual const char* LayerTypeAsString() const;
541 544
542 // Properties internal to LayerImpl 545 // Properties internal to LayerImpl
543 LayerImpl* parent_; 546 LayerImpl* parent_;
544 LayerImplList children_; 547 LayerImplList children_;
545 548
546 // mask_layer_ can be temporarily stolen during tree sync, we need this ID to 549 // mask_layer_ can be temporarily stolen during tree sync, we need this ID to
547 // confirm newly assigned layer is still the previous one 550 // confirm newly assigned layer is still the previous one
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 642
640 bool scrolls_drawn_descendant_; 643 bool scrolls_drawn_descendant_;
641 bool has_will_change_transform_hint_; 644 bool has_will_change_transform_hint_;
642 645
643 DISALLOW_COPY_AND_ASSIGN(LayerImpl); 646 DISALLOW_COPY_AND_ASSIGN(LayerImpl);
644 }; 647 };
645 648
646 } // namespace cc 649 } // namespace cc
647 650
648 #endif // CC_LAYERS_LAYER_IMPL_H_ 651 #endif // CC_LAYERS_LAYER_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | cc/layers/layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698