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

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

Issue 13725015: Merge ui::Layer's concept of position with cc::Layer's (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 | « ui/compositor/layer.cc ('k') | ui/compositor/layer_animation_sequence.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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 ThreadedTransformTransition(const gfx::Transform& target, 502 ThreadedTransformTransition(const gfx::Transform& target,
503 base::TimeDelta duration) 503 base::TimeDelta duration)
504 : ThreadedLayerAnimationElement(GetProperties(), duration), 504 : ThreadedLayerAnimationElement(GetProperties(), duration),
505 target_(target) { 505 target_(target) {
506 } 506 }
507 virtual ~ThreadedTransformTransition() {} 507 virtual ~ThreadedTransformTransition() {}
508 508
509 protected: 509 protected:
510 virtual void OnStart(LayerAnimationDelegate* delegate) OVERRIDE { 510 virtual void OnStart(LayerAnimationDelegate* delegate) OVERRIDE {
511 start_ = delegate->GetTransformForAnimation(); 511 start_ = delegate->GetTransformForAnimation();
512 gfx::Rect bounds = delegate->GetBoundsForAnimation();
513 float device_scale_factor = delegate->GetDeviceScaleFactor(); 512 float device_scale_factor = delegate->GetDeviceScaleFactor();
514 cc_start_ = Layer::ConvertTransformToCCTransform(start_, 513 cc_start_ = Layer::ConvertTransformToCCTransform(start_,
515 bounds,
516 device_scale_factor); 514 device_scale_factor);
517 cc_target_ = Layer::ConvertTransformToCCTransform(target_, 515 cc_target_ = Layer::ConvertTransformToCCTransform(target_,
518 bounds,
519 device_scale_factor); 516 device_scale_factor);
520 } 517 }
521 518
522 virtual void OnAbort(LayerAnimationDelegate* delegate) OVERRIDE { 519 virtual void OnAbort(LayerAnimationDelegate* delegate) OVERRIDE {
523 if (delegate && animation_id()) { 520 if (delegate && animation_id()) {
524 ThreadedLayerAnimationElement::OnAbort(delegate); 521 ThreadedLayerAnimationElement::OnAbort(delegate);
525 delegate->SetTransformFromAnimation(Tween::ValueBetween( 522 delegate->SetTransformFromAnimation(Tween::ValueBetween(
526 Tween::CalculateValue(tween_type(), last_progressed_fraction()), 523 Tween::CalculateValue(tween_type(), last_progressed_fraction()),
527 start_, 524 start_,
528 target_)); 525 target_));
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 } 779 }
783 780
784 // static 781 // static
785 LayerAnimationElement* LayerAnimationElement::CreateColorElement( 782 LayerAnimationElement* LayerAnimationElement::CreateColorElement(
786 SkColor color, 783 SkColor color,
787 base::TimeDelta duration) { 784 base::TimeDelta duration) {
788 return new ColorTransition(color, duration); 785 return new ColorTransition(color, duration);
789 } 786 }
790 787
791 } // namespace ui 788 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/layer.cc ('k') | ui/compositor/layer_animation_sequence.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698