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

Side by Side Diff: ui/compositor/layer_animation_element.cc

Issue 18660005: Make ui::ThreadedTransformTransition::OnAbort correctly check whether the animation has started (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/compositor/layer_animation_element_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/compositor/layer_animation_element.h" 5 #include "ui/compositor/layer_animation_element.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "cc/animation/animation.h" 8 #include "cc/animation/animation.h"
9 #include "cc/animation/animation_id_provider.h" 9 #include "cc/animation/animation_id_provider.h"
10 #include "ui/base/animation/tween.h" 10 #include "ui/base/animation/tween.h"
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 virtual void OnStart(LayerAnimationDelegate* delegate) OVERRIDE { 510 virtual void OnStart(LayerAnimationDelegate* delegate) OVERRIDE {
511 start_ = delegate->GetTransformForAnimation(); 511 start_ = delegate->GetTransformForAnimation();
512 float device_scale_factor = delegate->GetDeviceScaleFactor(); 512 float device_scale_factor = delegate->GetDeviceScaleFactor();
513 cc_start_ = Layer::ConvertTransformToCCTransform(start_, 513 cc_start_ = Layer::ConvertTransformToCCTransform(start_,
514 device_scale_factor); 514 device_scale_factor);
515 cc_target_ = Layer::ConvertTransformToCCTransform(target_, 515 cc_target_ = Layer::ConvertTransformToCCTransform(target_,
516 device_scale_factor); 516 device_scale_factor);
517 } 517 }
518 518
519 virtual void OnAbort(LayerAnimationDelegate* delegate) OVERRIDE { 519 virtual void OnAbort(LayerAnimationDelegate* delegate) OVERRIDE {
520 if (delegate && animation_id()) { 520 if (delegate && Started()) {
521 ThreadedLayerAnimationElement::OnAbort(delegate); 521 ThreadedLayerAnimationElement::OnAbort(delegate);
522 delegate->SetTransformFromAnimation(Tween::ValueBetween( 522 delegate->SetTransformFromAnimation(Tween::ValueBetween(
523 Tween::CalculateValue(tween_type(), last_progressed_fraction()), 523 Tween::CalculateValue(tween_type(), last_progressed_fraction()),
524 start_, 524 start_,
525 target_)); 525 target_));
526 } 526 }
527 } 527 }
528 528
529 virtual void OnEnd(LayerAnimationDelegate* delegate) OVERRIDE { 529 virtual void OnEnd(LayerAnimationDelegate* delegate) OVERRIDE {
530 delegate->SetTransformFromAnimation(target_); 530 delegate->SetTransformFromAnimation(target_);
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 } 779 }
780 780
781 // static 781 // static
782 LayerAnimationElement* LayerAnimationElement::CreateColorElement( 782 LayerAnimationElement* LayerAnimationElement::CreateColorElement(
783 SkColor color, 783 SkColor color,
784 base::TimeDelta duration) { 784 base::TimeDelta duration) {
785 return new ColorTransition(color, duration); 785 return new ColorTransition(color, duration);
786 } 786 }
787 787
788 } // namespace ui 788 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | ui/compositor/layer_animation_element_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698