| 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 #include "cc/layers/layer.h" | 5 #include "cc/layers/layer.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 void Layer::SetMaskLayer(Layer* mask_layer) { | 406 void Layer::SetMaskLayer(Layer* mask_layer) { |
| 407 DCHECK(IsPropertyChangeAllowed()); | 407 DCHECK(IsPropertyChangeAllowed()); |
| 408 if (mask_layer_.get() == mask_layer) | 408 if (mask_layer_.get() == mask_layer) |
| 409 return; | 409 return; |
| 410 if (mask_layer_.get()) { | 410 if (mask_layer_.get()) { |
| 411 DCHECK_EQ(this, mask_layer_->parent()); | 411 DCHECK_EQ(this, mask_layer_->parent()); |
| 412 mask_layer_->RemoveFromParent(); | 412 mask_layer_->RemoveFromParent(); |
| 413 } | 413 } |
| 414 mask_layer_ = mask_layer; | 414 mask_layer_ = mask_layer; |
| 415 if (mask_layer_.get()) { | 415 if (mask_layer_.get()) { |
| 416 mask_layer_->RemoveFromParent(); |
| 416 DCHECK(!mask_layer_->parent()); | 417 DCHECK(!mask_layer_->parent()); |
| 417 mask_layer_->RemoveFromParent(); | |
| 418 mask_layer_->SetParent(this); | 418 mask_layer_->SetParent(this); |
| 419 mask_layer_->SetIsMask(true); | 419 mask_layer_->SetIsMask(true); |
| 420 } | 420 } |
| 421 SetSubtreePropertyChanged(); | 421 SetSubtreePropertyChanged(); |
| 422 SetNeedsFullTreeSync(); | 422 SetNeedsFullTreeSync(); |
| 423 } | 423 } |
| 424 | 424 |
| 425 void Layer::SetReplicaLayer(Layer* layer) { | 425 void Layer::SetReplicaLayer(Layer* layer) { |
| 426 DCHECK(IsPropertyChangeAllowed()); | 426 DCHECK(IsPropertyChangeAllowed()); |
| 427 if (replica_layer_.get() == layer) | 427 if (replica_layer_.get() == layer) |
| (...skipping 1414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1842 this, layer_tree_host_->property_trees()->transform_tree); | 1842 this, layer_tree_host_->property_trees()->transform_tree); |
| 1843 } | 1843 } |
| 1844 | 1844 |
| 1845 gfx::Transform Layer::screen_space_transform() const { | 1845 gfx::Transform Layer::screen_space_transform() const { |
| 1846 DCHECK_NE(transform_tree_index_, -1); | 1846 DCHECK_NE(transform_tree_index_, -1); |
| 1847 return draw_property_utils::ScreenSpaceTransform( | 1847 return draw_property_utils::ScreenSpaceTransform( |
| 1848 this, layer_tree_host_->property_trees()->transform_tree); | 1848 this, layer_tree_host_->property_trees()->transform_tree); |
| 1849 } | 1849 } |
| 1850 | 1850 |
| 1851 } // namespace cc | 1851 } // namespace cc |
| OLD | NEW |