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

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

Issue 11087093: Migrate ui::Transform to gfx::Transform (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Should pass trybots this time Created 8 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 | « ui/compositor/layer_animator.h ('k') | ui/compositor/layer_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_animator.h" 5 #include "ui/compositor/layer_animator.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "ui/base/animation/animation_container.h" 10 #include "ui/base/animation/animation_container.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 // static 66 // static
67 LayerAnimator* LayerAnimator::CreateDefaultAnimator() { 67 LayerAnimator* LayerAnimator::CreateDefaultAnimator() {
68 return new LayerAnimator(base::TimeDelta::FromMilliseconds(0)); 68 return new LayerAnimator(base::TimeDelta::FromMilliseconds(0));
69 } 69 }
70 70
71 // static 71 // static
72 LayerAnimator* LayerAnimator::CreateImplicitAnimator() { 72 LayerAnimator* LayerAnimator::CreateImplicitAnimator() {
73 return new LayerAnimator(kDefaultTransitionDuration); 73 return new LayerAnimator(kDefaultTransitionDuration);
74 } 74 }
75 75
76 void LayerAnimator::SetTransform(const Transform& transform) { 76 void LayerAnimator::SetTransform(const gfx::Transform& transform) {
77 base::TimeDelta duration = GetTransitionDuration(); 77 base::TimeDelta duration = GetTransitionDuration();
78 scoped_ptr<LayerAnimationElement> element( 78 scoped_ptr<LayerAnimationElement> element(
79 LayerAnimationElement::CreateTransformElement(transform, duration)); 79 LayerAnimationElement::CreateTransformElement(transform, duration));
80 element->set_tween_type(tween_type_); 80 element->set_tween_type(tween_type_);
81 StartAnimation(new LayerAnimationSequence(element.release())); 81 StartAnimation(new LayerAnimationSequence(element.release()));
82 } 82 }
83 83
84 Transform LayerAnimator::GetTargetTransform() const { 84 gfx::Transform LayerAnimator::GetTargetTransform() const {
85 LayerAnimationElement::TargetValue target(delegate()); 85 LayerAnimationElement::TargetValue target(delegate());
86 GetTargetValue(&target); 86 GetTargetValue(&target);
87 return target.transform; 87 return target.transform;
88 } 88 }
89 89
90 void LayerAnimator::SetBounds(const gfx::Rect& bounds) { 90 void LayerAnimator::SetBounds(const gfx::Rect& bounds) {
91 base::TimeDelta duration = GetTransitionDuration(); 91 base::TimeDelta duration = GetTransitionDuration();
92 scoped_ptr<LayerAnimationElement> element( 92 scoped_ptr<LayerAnimationElement> element(
93 LayerAnimationElement::CreateBoundsElement(bounds, duration)); 93 LayerAnimationElement::CreateBoundsElement(bounds, duration));
94 element->set_tween_type(tween_type_); 94 element->set_tween_type(tween_type_);
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 removed->Abort(); 667 removed->Abort();
668 } 668 }
669 // This *should* have cleared the list of running animations. 669 // This *should* have cleared the list of running animations.
670 DCHECK(running_animations_.empty()); 670 DCHECK(running_animations_.empty());
671 running_animations_.clear(); 671 running_animations_.clear();
672 animation_queue_.clear(); 672 animation_queue_.clear();
673 UpdateAnimationState(); 673 UpdateAnimationState();
674 } 674 }
675 675
676 } // namespace ui 676 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/layer_animator.h ('k') | ui/compositor/layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698