| 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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 void Layer::SetMaskLayer(Layer* mask_layer) { | 413 void Layer::SetMaskLayer(Layer* mask_layer) { |
| 414 DCHECK(IsPropertyChangeAllowed()); | 414 DCHECK(IsPropertyChangeAllowed()); |
| 415 if (inputs_.mask_layer.get() == mask_layer) | 415 if (inputs_.mask_layer.get() == mask_layer) |
| 416 return; | 416 return; |
| 417 if (inputs_.mask_layer.get()) { | 417 if (inputs_.mask_layer.get()) { |
| 418 DCHECK_EQ(this, inputs_.mask_layer->parent()); | 418 DCHECK_EQ(this, inputs_.mask_layer->parent()); |
| 419 inputs_.mask_layer->RemoveFromParent(); | 419 inputs_.mask_layer->RemoveFromParent(); |
| 420 } | 420 } |
| 421 inputs_.mask_layer = mask_layer; | 421 inputs_.mask_layer = mask_layer; |
| 422 if (inputs_.mask_layer.get()) { | 422 if (inputs_.mask_layer.get()) { |
| 423 // The mask layer should not have any children. |
| 424 DCHECK(inputs_.mask_layer->children().empty()); |
| 425 |
| 423 inputs_.mask_layer->RemoveFromParent(); | 426 inputs_.mask_layer->RemoveFromParent(); |
| 424 DCHECK(!inputs_.mask_layer->parent()); | 427 DCHECK(!inputs_.mask_layer->parent()); |
| 425 inputs_.mask_layer->SetParent(this); | 428 inputs_.mask_layer->SetParent(this); |
| 426 inputs_.mask_layer->SetIsMask(true); | 429 inputs_.mask_layer->SetIsMask(true); |
| 427 } | 430 } |
| 428 SetSubtreePropertyChanged(); | 431 SetSubtreePropertyChanged(); |
| 429 SetNeedsFullTreeSync(); | 432 SetNeedsFullTreeSync(); |
| 430 } | 433 } |
| 431 | 434 |
| 432 void Layer::SetFilters(const FilterOperations& filters) { | 435 void Layer::SetFilters(const FilterOperations& filters) { |
| (...skipping 1456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1889 | 1892 |
| 1890 LayerTree* Layer::GetLayerTree() const { | 1893 LayerTree* Layer::GetLayerTree() const { |
| 1891 return layer_tree_; | 1894 return layer_tree_; |
| 1892 } | 1895 } |
| 1893 | 1896 |
| 1894 void Layer::SetLayerIdForTesting(int id) { | 1897 void Layer::SetLayerIdForTesting(int id) { |
| 1895 inputs_.layer_id = id; | 1898 inputs_.layer_id = id; |
| 1896 } | 1899 } |
| 1897 | 1900 |
| 1898 } // namespace cc | 1901 } // namespace cc |
| OLD | NEW |