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

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

Issue 12310115: ui::ThreadedOpacityTransition::OnAbort should depend on tween_type() (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 9 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 | « 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.h" 8 #include "cc/animation.h"
9 #include "cc/animation_id_provider.h" 9 #include "cc/animation_id_provider.h"
10 #include "ui/base/animation/tween.h" 10 #include "ui/base/animation/tween.h"
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 virtual ~ThreadedOpacityTransition() {} 437 virtual ~ThreadedOpacityTransition() {}
438 438
439 protected: 439 protected:
440 virtual void OnStart(LayerAnimationDelegate* delegate) OVERRIDE { 440 virtual void OnStart(LayerAnimationDelegate* delegate) OVERRIDE {
441 start_ = delegate->GetOpacityForAnimation(); 441 start_ = delegate->GetOpacityForAnimation();
442 } 442 }
443 443
444 virtual void OnAbort(LayerAnimationDelegate* delegate) OVERRIDE { 444 virtual void OnAbort(LayerAnimationDelegate* delegate) OVERRIDE {
445 if (delegate && Started()) { 445 if (delegate && Started()) {
446 ThreadedLayerAnimationElement::OnAbort(delegate); 446 ThreadedLayerAnimationElement::OnAbort(delegate);
447 delegate->SetOpacityFromAnimation( 447 delegate->SetOpacityFromAnimation(Tween::ValueBetween(
448 Tween::ValueBetween(last_progressed_fraction(), start_, target_)); 448 Tween::CalculateValue(tween_type(), last_progressed_fraction()),
449 start_,
450 target_));
449 } 451 }
450 } 452 }
451 453
452 virtual void OnEnd(LayerAnimationDelegate* delegate) OVERRIDE { 454 virtual void OnEnd(LayerAnimationDelegate* delegate) OVERRIDE {
453 delegate->SetOpacityFromAnimation(target_); 455 delegate->SetOpacityFromAnimation(target_);
454 } 456 }
455 457
456 virtual scoped_ptr<cc::Animation> CreateCCAnimation() OVERRIDE { 458 virtual scoped_ptr<cc::Animation> CreateCCAnimation() OVERRIDE {
457 scoped_ptr<cc::AnimationCurve> animation_curve( 459 scoped_ptr<cc::AnimationCurve> animation_curve(
458 new FloatAnimationCurveAdapter(tween_type(), 460 new FloatAnimationCurveAdapter(tween_type(),
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 } 695 }
694 696
695 // static 697 // static
696 LayerAnimationElement* LayerAnimationElement::CreateColorElement( 698 LayerAnimationElement* LayerAnimationElement::CreateColorElement(
697 SkColor color, 699 SkColor color,
698 base::TimeDelta duration) { 700 base::TimeDelta duration) {
699 return new ColorTransition(color, duration); 701 return new ColorTransition(color, duration);
700 } 702 }
701 703
702 } // namespace ui 704 } // 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