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

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

Issue 12517003: cc: Chromify the Animation and LayerAnimationController classes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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 | Annotate | Revision Log
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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 406
407 virtual void RequestEffectiveStart( 407 virtual void RequestEffectiveStart(
408 LayerAnimationDelegate* delegate) OVERRIDE { 408 LayerAnimationDelegate* delegate) OVERRIDE {
409 DCHECK(animation_group_id()); 409 DCHECK(animation_group_id());
410 if (duration() == base::TimeDelta()) { 410 if (duration() == base::TimeDelta()) {
411 set_effective_start_time(requested_start_time()); 411 set_effective_start_time(requested_start_time());
412 return; 412 return;
413 } 413 }
414 set_effective_start_time(base::TimeTicks()); 414 set_effective_start_time(base::TimeTicks());
415 scoped_ptr<cc::Animation> animation = CreateCCAnimation(); 415 scoped_ptr<cc::Animation> animation = CreateCCAnimation();
416 animation->setNeedsSynchronizedStartTime(true); 416 animation->set_needs_synchronized_start_time(true);
417 delegate->AddThreadedAnimation(animation.Pass()); 417 delegate->AddThreadedAnimation(animation.Pass());
418 } 418 }
419 419
420 virtual void OnEnd(LayerAnimationDelegate* delegate) = 0; 420 virtual void OnEnd(LayerAnimationDelegate* delegate) = 0;
421 421
422 virtual scoped_ptr<cc::Animation> CreateCCAnimation() = 0; 422 virtual scoped_ptr<cc::Animation> CreateCCAnimation() = 0;
423 423
424 private: 424 private:
425 DISALLOW_COPY_AND_ASSIGN(ThreadedLayerAnimationElement); 425 DISALLOW_COPY_AND_ASSIGN(ThreadedLayerAnimationElement);
426 }; 426 };
(...skipping 28 matching lines...) Expand all
455 delegate->SetOpacityFromAnimation(target_); 455 delegate->SetOpacityFromAnimation(target_);
456 } 456 }
457 457
458 virtual scoped_ptr<cc::Animation> CreateCCAnimation() OVERRIDE { 458 virtual scoped_ptr<cc::Animation> CreateCCAnimation() OVERRIDE {
459 scoped_ptr<cc::AnimationCurve> animation_curve( 459 scoped_ptr<cc::AnimationCurve> animation_curve(
460 new FloatAnimationCurveAdapter(tween_type(), 460 new FloatAnimationCurveAdapter(tween_type(),
461 start_, 461 start_,
462 target_, 462 target_,
463 duration())); 463 duration()));
464 scoped_ptr<cc::Animation> animation( 464 scoped_ptr<cc::Animation> animation(
465 cc::Animation::create(animation_curve.Pass(), 465 cc::Animation::Create(animation_curve.Pass(),
466 animation_id(), 466 animation_id(),
467 animation_group_id(), 467 animation_group_id(),
468 cc::Animation::Opacity)); 468 cc::Animation::Opacity));
469 return animation.Pass(); 469 return animation.Pass();
470 } 470 }
471 471
472 virtual void OnGetTarget(TargetValue* target) const OVERRIDE { 472 virtual void OnGetTarget(TargetValue* target) const OVERRIDE {
473 target->opacity = target_; 473 target->opacity = target_;
474 } 474 }
475 475
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 } 695 }
696 696
697 // static 697 // static
698 LayerAnimationElement* LayerAnimationElement::CreateColorElement( 698 LayerAnimationElement* LayerAnimationElement::CreateColorElement(
699 SkColor color, 699 SkColor color,
700 base::TimeDelta duration) { 700 base::TimeDelta duration) {
701 return new ColorTransition(color, duration); 701 return new ColorTransition(color, duration);
702 } 702 }
703 703
704 } // namespace ui 704 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698