Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Side by Side Diff: webkit/renderer/compositor_bindings/web_layer_impl.cc

Issue 24165003: Don't clone WebAnimation in WebLayerImpl::addAnimation(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CL to land Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webkit/renderer/compositor_bindings/web_animation_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « webkit/renderer/compositor_bindings/web_animation_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698