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

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

Issue 2035863003: cc: Add mask and replica layer ids to the effect tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments 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 | « cc/debug/debug_rect_history.cc ('k') | 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 bool is_clipped() const { return draw_properties_.is_clipped; } 143 bool is_clipped() const { return draw_properties_.is_clipped; }
144 144
145 void UpdatePropertyTreeTransform(); 145 void UpdatePropertyTreeTransform();
146 void UpdatePropertyTreeTransformIsAnimated(bool is_animated); 146 void UpdatePropertyTreeTransformIsAnimated(bool is_animated);
147 void UpdatePropertyTreeOpacity(float opacity); 147 void UpdatePropertyTreeOpacity(float opacity);
148 void UpdatePropertyTreeScrollOffset(); 148 void UpdatePropertyTreeScrollOffset();
149 149
150 // For compatibility with Layer. 150 // For compatibility with Layer.
151 bool has_render_surface() const { return !!render_surface(); } 151 bool has_render_surface() const { return !!render_surface(); }
152 152
153 void SetMaskLayer(std::unique_ptr<LayerImpl> mask_layer);
154 LayerImpl* mask_layer() { return mask_layer_; }
155 const LayerImpl* mask_layer() const { return mask_layer_; }
156 std::unique_ptr<LayerImpl> TakeMaskLayer();
157
158 void SetReplicaLayer(std::unique_ptr<LayerImpl> replica_layer);
159 LayerImpl* replica_layer() { return replica_layer_; }
160 const LayerImpl* replica_layer() const { return replica_layer_; }
161 std::unique_ptr<LayerImpl> TakeReplicaLayerForTesting();
162
163 bool has_mask() const { return !!mask_layer_; }
164 bool has_replica() const { return !!replica_layer_; }
165 bool replica_has_mask() const {
166 return replica_layer_ && (mask_layer_ || replica_layer_->mask_layer_);
167 }
168
169 LayerTreeImpl* layer_tree_impl() const { return layer_tree_impl_; } 153 LayerTreeImpl* layer_tree_impl() const { return layer_tree_impl_; }
170 154
171 void PopulateSharedQuadState(SharedQuadState* state) const; 155 void PopulateSharedQuadState(SharedQuadState* state) const;
172 void PopulateScaledSharedQuadState(SharedQuadState* state, float scale) const; 156 void PopulateScaledSharedQuadState(SharedQuadState* state, float scale) const;
173 // WillDraw must be called before AppendQuads. If WillDraw returns false, 157 // WillDraw must be called before AppendQuads. If WillDraw returns false,
174 // AppendQuads and DidDraw will not be called. If WillDraw returns true, 158 // AppendQuads and DidDraw will not be called. If WillDraw returns true,
175 // DidDraw is guaranteed to be called before another WillDraw or before 159 // DidDraw is guaranteed to be called before another WillDraw or before
176 // the layer is destroyed. To enforce this, any class that overrides 160 // the layer is destroyed. To enforce this, any class that overrides
177 // WillDraw/DidDraw must call the base class version only if WillDraw 161 // WillDraw/DidDraw must call the base class version only if WillDraw
178 // returns true. 162 // returns true.
(...skipping 16 matching lines...) Expand all
195 virtual void NotifyTileStateChanged(const Tile* tile) {} 179 virtual void NotifyTileStateChanged(const Tile* tile) {}
196 180
197 virtual ScrollbarLayerImplBase* ToScrollbarLayer(); 181 virtual ScrollbarLayerImplBase* ToScrollbarLayer();
198 182
199 // Returns true if this layer has content to draw. 183 // Returns true if this layer has content to draw.
200 void SetDrawsContent(bool draws_content); 184 void SetDrawsContent(bool draws_content);
201 bool DrawsContent() const { return draws_content_; } 185 bool DrawsContent() const { return draws_content_; }
202 186
203 LayerImplTestProperties* test_properties() { 187 LayerImplTestProperties* test_properties() {
204 if (!test_properties_) 188 if (!test_properties_)
205 test_properties_.reset(new LayerImplTestProperties()); 189 test_properties_.reset(new LayerImplTestProperties(this));
206 return test_properties_.get(); 190 return test_properties_.get();
207 } 191 }
208 192
209 void SetBackgroundColor(SkColor background_color); 193 void SetBackgroundColor(SkColor background_color);
210 SkColor background_color() const { return background_color_; } 194 SkColor background_color() const { return background_color_; }
211 void SetSafeOpaqueBackgroundColor(SkColor background_color); 195 void SetSafeOpaqueBackgroundColor(SkColor background_color);
212 // If contents_opaque(), return an opaque color else return a 196 // If contents_opaque(), return an opaque color else return a
213 // non-opaque color. Tries to return background_color(), if possible. 197 // non-opaque color. Tries to return background_color(), if possible.
214 SkColor SafeOpaqueBackgroundColor() const; 198 SkColor SafeOpaqueBackgroundColor() const;
215 199
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 bool was_ever_ready_since_last_transform_animation() const { 477 bool was_ever_ready_since_last_transform_animation() const {
494 return was_ever_ready_since_last_transform_animation_; 478 return was_ever_ready_since_last_transform_animation_;
495 } 479 }
496 480
497 void set_was_ever_ready_since_last_transform_animation(bool was_ready) { 481 void set_was_ever_ready_since_last_transform_animation(bool was_ready) {
498 was_ever_ready_since_last_transform_animation_ = was_ready; 482 was_ever_ready_since_last_transform_animation_ = was_ready;
499 } 483 }
500 484
501 void NoteLayerPropertyChanged(); 485 void NoteLayerPropertyChanged();
502 486
503 void ClearLinksToOtherLayers();
504
505 void SetHasWillChangeTransformHint(bool has_will_change); 487 void SetHasWillChangeTransformHint(bool has_will_change);
506 bool has_will_change_transform_hint() const { 488 bool has_will_change_transform_hint() const {
507 return has_will_change_transform_hint_; 489 return has_will_change_transform_hint_;
508 } 490 }
509 491
510 protected: 492 protected:
511 LayerImpl(LayerTreeImpl* layer_impl, 493 LayerImpl(LayerTreeImpl* layer_impl,
512 int id, 494 int id,
513 scoped_refptr<SyncedScrollOffset> scroll_offset); 495 scoped_refptr<SyncedScrollOffset> scroll_offset);
514 LayerImpl(LayerTreeImpl* layer_impl, int id); 496 LayerImpl(LayerTreeImpl* layer_impl, int id);
(...skipping 15 matching lines...) Expand all
530 gfx::Rect GetScaledEnclosingRectInTargetSpace(float scale) const; 512 gfx::Rect GetScaledEnclosingRectInTargetSpace(float scale) const;
531 513
532 private: 514 private:
533 void ValidateQuadResourcesInternal(DrawQuad* quad) const; 515 void ValidateQuadResourcesInternal(DrawQuad* quad) const;
534 516
535 virtual const char* LayerTypeAsString() const; 517 virtual const char* LayerTypeAsString() const;
536 518
537 // Properties internal to LayerImpl 519 // Properties internal to LayerImpl
538 LayerImpl* parent_; 520 LayerImpl* parent_;
539 521
540 // mask_layer_ can be temporarily stolen during tree sync, we need this ID to
541 // confirm newly assigned layer is still the previous one
542 int mask_layer_id_;
543 LayerImpl* mask_layer_;
544 int replica_layer_id_; // ditto
545 LayerImpl* replica_layer_;
546 int layer_id_; 522 int layer_id_;
547 LayerTreeImpl* layer_tree_impl_; 523 LayerTreeImpl* layer_tree_impl_;
548 524
549 std::unique_ptr<LayerImplTestProperties> test_properties_; 525 std::unique_ptr<LayerImplTestProperties> test_properties_;
550 526
551 gfx::Vector2dF bounds_delta_; 527 gfx::Vector2dF bounds_delta_;
552 528
553 // Properties synchronized from the associated Layer. 529 // Properties synchronized from the associated Layer.
554 gfx::Size bounds_; 530 gfx::Size bounds_;
555 int scroll_clip_layer_id_; 531 int scroll_clip_layer_id_;
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 609
634 bool scrolls_drawn_descendant_; 610 bool scrolls_drawn_descendant_;
635 bool has_will_change_transform_hint_; 611 bool has_will_change_transform_hint_;
636 612
637 DISALLOW_COPY_AND_ASSIGN(LayerImpl); 613 DISALLOW_COPY_AND_ASSIGN(LayerImpl);
638 }; 614 };
639 615
640 } // namespace cc 616 } // namespace cc
641 617
642 #endif // CC_LAYERS_LAYER_IMPL_H_ 618 #endif // CC_LAYERS_LAYER_IMPL_H_
OLDNEW
« no previous file with comments | « cc/debug/debug_rect_history.cc ('k') | cc/layers/layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698