| 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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 void Layer::SetMaskLayer(Layer* mask_layer) { | 409 void Layer::SetMaskLayer(Layer* mask_layer) { |
| 410 DCHECK(IsPropertyChangeAllowed()); | 410 DCHECK(IsPropertyChangeAllowed()); |
| 411 if (mask_layer_.get() == mask_layer) | 411 if (mask_layer_.get() == mask_layer) |
| 412 return; | 412 return; |
| 413 if (mask_layer_.get()) { | 413 if (mask_layer_.get()) { |
| 414 DCHECK_EQ(this, mask_layer_->parent()); | 414 DCHECK_EQ(this, mask_layer_->parent()); |
| 415 mask_layer_->RemoveFromParent(); | 415 mask_layer_->RemoveFromParent(); |
| 416 } | 416 } |
| 417 mask_layer_ = mask_layer; | 417 mask_layer_ = mask_layer; |
| 418 if (mask_layer_.get()) { | 418 if (mask_layer_.get()) { |
| 419 mask_layer_->RemoveFromParent(); |
| 419 DCHECK(!mask_layer_->parent()); | 420 DCHECK(!mask_layer_->parent()); |
| 420 mask_layer_->RemoveFromParent(); | |
| 421 mask_layer_->SetParent(this); | 421 mask_layer_->SetParent(this); |
| 422 mask_layer_->SetIsMask(true); | 422 mask_layer_->SetIsMask(true); |
| 423 } | 423 } |
| 424 SetSubtreePropertyChanged(); | 424 SetSubtreePropertyChanged(); |
| 425 SetNeedsFullTreeSync(); | 425 SetNeedsFullTreeSync(); |
| 426 } | 426 } |
| 427 | 427 |
| 428 void Layer::SetReplicaLayer(Layer* layer) { | 428 void Layer::SetReplicaLayer(Layer* layer) { |
| 429 DCHECK(IsPropertyChangeAllowed()); | 429 DCHECK(IsPropertyChangeAllowed()); |
| 430 if (replica_layer_.get() == layer) | 430 if (replica_layer_.get() == layer) |
| (...skipping 1414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1845 this, layer_tree_host_->property_trees()->transform_tree); | 1845 this, layer_tree_host_->property_trees()->transform_tree); |
| 1846 } | 1846 } |
| 1847 | 1847 |
| 1848 gfx::Transform Layer::screen_space_transform() const { | 1848 gfx::Transform Layer::screen_space_transform() const { |
| 1849 DCHECK_NE(transform_tree_index_, -1); | 1849 DCHECK_NE(transform_tree_index_, -1); |
| 1850 return draw_property_utils::ScreenSpaceTransform( | 1850 return draw_property_utils::ScreenSpaceTransform( |
| 1851 this, layer_tree_host_->property_trees()->transform_tree); | 1851 this, layer_tree_host_->property_trees()->transform_tree); |
| 1852 } | 1852 } |
| 1853 | 1853 |
| 1854 } // namespace cc | 1854 } // namespace cc |
| OLD | NEW |