OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "webkit/renderer/compositor_bindings/web_layer_impl.h" | 5 #include "webkit/renderer/compositor_bindings/web_layer_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "cc/animation/animation.h" | 9 #include "cc/animation/animation.h" |
10 #include "cc/base/region.h" | 10 #include "cc/base/region.h" |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 } | 184 } |
185 | 185 |
186 void WebLayerImpl::setAnimationDelegate( | 186 void WebLayerImpl::setAnimationDelegate( |
187 WebKit::WebAnimationDelegate* delegate) { | 187 WebKit::WebAnimationDelegate* delegate) { |
188 animation_delegate_adapter_.reset( | 188 animation_delegate_adapter_.reset( |
189 new WebToCCAnimationDelegateAdapter(delegate)); | 189 new WebToCCAnimationDelegateAdapter(delegate)); |
190 layer_->set_layer_animation_delegate(animation_delegate_adapter_.get()); | 190 layer_->set_layer_animation_delegate(animation_delegate_adapter_.get()); |
191 } | 191 } |
192 | 192 |
193 bool WebLayerImpl::addAnimation(WebKit::WebAnimation* animation) { | 193 bool WebLayerImpl::addAnimation(WebKit::WebAnimation* animation) { |
194 return layer_->AddAnimation( | 194 bool result = layer_->AddAnimation( |
195 static_cast<WebAnimationImpl*>(animation)->CloneToAnimation()); | 195 static_cast<WebAnimationImpl*>(animation)->PassAnimation()); |
| 196 #if defined(ANIMATION_OWNERSHIP_TRANSFER) |
| 197 delete animation; |
| 198 #endif |
| 199 return result; |
196 } | 200 } |
197 | 201 |
198 void WebLayerImpl::removeAnimation(int animation_id) { | 202 void WebLayerImpl::removeAnimation(int animation_id) { |
199 layer_->RemoveAnimation(animation_id); | 203 layer_->RemoveAnimation(animation_id); |
200 } | 204 } |
201 | 205 |
202 void WebLayerImpl::removeAnimation( | 206 void WebLayerImpl::removeAnimation( |
203 int animation_id, | 207 int animation_id, |
204 WebKit::WebAnimation::TargetProperty target_property) { | 208 WebKit::WebAnimation::TargetProperty target_property) { |
205 layer_->layer_animation_controller()->RemoveAnimation( | 209 layer_->layer_animation_controller()->RemoveAnimation( |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 void WebLayerImpl::setClipParent(WebKit::WebLayer* parent) { | 389 void WebLayerImpl::setClipParent(WebKit::WebLayer* parent) { |
386 cc::Layer* clip_parent = NULL; | 390 cc::Layer* clip_parent = NULL; |
387 if (parent) | 391 if (parent) |
388 clip_parent = static_cast<WebLayerImpl*>(parent)->layer(); | 392 clip_parent = static_cast<WebLayerImpl*>(parent)->layer(); |
389 layer_->SetClipParent(clip_parent); | 393 layer_->SetClipParent(clip_parent); |
390 } | 394 } |
391 | 395 |
392 Layer* WebLayerImpl::layer() const { return layer_.get(); } | 396 Layer* WebLayerImpl::layer() const { return layer_.get(); } |
393 | 397 |
394 } // namespace webkit | 398 } // namespace webkit |
OLD | NEW |