Chromium Code Reviews| Index: cc/layers/picture_layer_impl.cc |
| diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc |
| index f385bddd8003344734c5ee27c144d901da007d3e..b9bc09304aac231d8b3e137f86117039f16c8269 100644 |
| --- a/cc/layers/picture_layer_impl.cc |
| +++ b/cc/layers/picture_layer_impl.cc |
| @@ -120,6 +120,14 @@ PictureLayerImpl::~PictureLayerImpl() { |
| layer_tree_impl()->UnregisterPictureLayerImpl(this); |
| } |
| +void PictureLayerImpl::SetLayerMaskType(Layer::LayerMaskType mask_type) { |
| + if (mask_type_ == mask_type) |
| + return; |
| + DCHECK(mask_type_ != Layer::LayerMaskType::NOT_MASK && |
|
enne (OOO)
2017/04/28 17:08:30
Maybe leave a comment here saying that it's expect
sunxd
2017/04/28 17:53:20
Done.
|
| + mask_type != Layer::LayerMaskType::NOT_MASK); |
| + mask_type_ = mask_type; |
| +} |
| + |
| const char* PictureLayerImpl::LayerTypeAsString() const { |
| return "cc::PictureLayerImpl"; |
| } |
| @@ -131,10 +139,10 @@ std::unique_ptr<LayerImpl> PictureLayerImpl::CreateLayerImpl( |
| void PictureLayerImpl::PushPropertiesTo(LayerImpl* base_layer) { |
| PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer); |
| - DCHECK_EQ(layer_impl->mask_type_, mask_type_); |
| LayerImpl::PushPropertiesTo(base_layer); |
| + layer_impl->SetLayerMaskType(mask_type()); |
| // Twin relationships should never change once established. |
| DCHECK(!twin_layer_ || twin_layer_ == layer_impl); |
| DCHECK(!twin_layer_ || layer_impl->twin_layer_ == this); |