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

Side by Side Diff: cc/animation/layer_animation_controller.cc

Issue 817653003: Update from https://crrev.com/309717 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "cc/animation/layer_animation_controller.h" 5 #include "cc/animation/layer_animation_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "cc/animation/animation.h" 10 #include "cc/animation/animation.h"
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 494
495 const TransformAnimationCurve* transform_animation_curve = 495 const TransformAnimationCurve* transform_animation_curve =
496 animations_[i]->curve()->ToTransformAnimationCurve(); 496 animations_[i]->curve()->ToTransformAnimationCurve();
497 if (!transform_animation_curve->IsTranslation()) 497 if (!transform_animation_curve->IsTranslation())
498 return false; 498 return false;
499 } 499 }
500 500
501 return true; 501 return true;
502 } 502 }
503 503
504 bool LayerAnimationController::AnimationsPreserveAxisAlignment() const {
505 for (size_t i = 0; i < animations_.size(); ++i) {
506 if (animations_[i]->is_finished() ||
507 animations_[i]->target_property() != Animation::Transform)
508 continue;
509
510 const TransformAnimationCurve* transform_animation_curve =
511 animations_[i]->curve()->ToTransformAnimationCurve();
512 if (!transform_animation_curve->PreservesAxisAlignment())
513 return false;
514 }
515
516 return true;
517 }
518
504 bool LayerAnimationController::MaximumTargetScale(float* max_scale) const { 519 bool LayerAnimationController::MaximumTargetScale(float* max_scale) const {
505 *max_scale = 0.f; 520 *max_scale = 0.f;
506 for (size_t i = 0; i < animations_.size(); ++i) { 521 for (size_t i = 0; i < animations_.size(); ++i) {
507 if (animations_[i]->is_finished() || 522 if (animations_[i]->is_finished() ||
508 animations_[i]->target_property() != Animation::Transform) 523 animations_[i]->target_property() != Animation::Transform)
509 continue; 524 continue;
510 525
511 bool forward_direction = true; 526 bool forward_direction = true;
512 switch (animations_[i]->direction()) { 527 switch (animations_[i]->direction()) {
513 case Animation::Normal: 528 case Animation::Normal:
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
1034 value_observers_); 1049 value_observers_);
1035 LayerAnimationValueObserver* obs; 1050 LayerAnimationValueObserver* obs;
1036 while ((obs = it.GetNext()) != nullptr) 1051 while ((obs = it.GetNext()) != nullptr)
1037 if (obs->IsActive()) 1052 if (obs->IsActive())
1038 return true; 1053 return true;
1039 } 1054 }
1040 return false; 1055 return false;
1041 } 1056 }
1042 1057
1043 } // namespace cc 1058 } // namespace cc
OLDNEW
« no previous file with comments | « cc/animation/layer_animation_controller.h ('k') | cc/animation/layer_animation_event_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698