OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/blink/web_layer_impl.h" | 5 #include "cc/blink/web_layer_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 layer_->SetLayerClient(this); | 58 layer_->SetLayerClient(this); |
59 } | 59 } |
60 | 60 |
61 WebLayerImpl::WebLayerImpl(scoped_refptr<Layer> layer) : layer_(layer) { | 61 WebLayerImpl::WebLayerImpl(scoped_refptr<Layer> layer) : layer_(layer) { |
62 web_layer_client_ = nullptr; | 62 web_layer_client_ = nullptr; |
63 layer_->SetLayerClient(this); | 63 layer_->SetLayerClient(this); |
64 } | 64 } |
65 | 65 |
66 WebLayerImpl::~WebLayerImpl() { | 66 WebLayerImpl::~WebLayerImpl() { |
67 layer_->ClearRenderSurface(); | 67 layer_->ClearRenderSurface(); |
68 layer_->set_layer_animation_delegate(nullptr); | 68 if (animation_delegate_adapter_.get()) |
| 69 layer_->set_layer_animation_delegate(nullptr); |
69 web_layer_client_ = nullptr; | 70 web_layer_client_ = nullptr; |
70 } | 71 } |
71 | 72 |
72 // static | 73 // static |
73 bool WebLayerImpl::UsingPictureLayer() { | 74 bool WebLayerImpl::UsingPictureLayer() { |
74 return g_impl_side_painting_enabled; | 75 return g_impl_side_painting_enabled; |
75 } | 76 } |
76 | 77 |
77 // static | 78 // static |
78 void WebLayerImpl::SetImplSidePaintingEnabled(bool enabled) { | 79 void WebLayerImpl::SetImplSidePaintingEnabled(bool enabled) { |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 if (parent) | 543 if (parent) |
543 clip_parent = static_cast<WebLayerImpl*>(parent)->layer(); | 544 clip_parent = static_cast<WebLayerImpl*>(parent)->layer(); |
544 layer_->SetClipParent(clip_parent); | 545 layer_->SetClipParent(clip_parent); |
545 } | 546 } |
546 | 547 |
547 Layer* WebLayerImpl::layer() const { | 548 Layer* WebLayerImpl::layer() const { |
548 return layer_.get(); | 549 return layer_.get(); |
549 } | 550 } |
550 | 551 |
551 } // namespace cc_blink | 552 } // namespace cc_blink |
OLD | NEW |