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

Side by Side Diff: cc/layer_animation_controller.cc

Issue 11308153: Migrate most of cc/ from WebKit::WebTransformationMatrix to gfx::Transform (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased to tip of tree and addressed feedback Created 8 years, 1 month 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 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/layer_animation_controller.h" 5 #include "cc/layer_animation_controller.h"
6 6
7 #include "cc/active_animation.h" 7 #include "cc/active_animation.h"
8 #include "cc/keyframed_animation_curve.h" 8 #include "cc/keyframed_animation_curve.h"
9 #include <public/WebTransformationMatrix.h> 9 #include "ui/gfx/transform.h"
10 10
11 using WebKit::WebTransformationMatrix; 11 using gfx::Transform;
12 12
13 namespace cc { 13 namespace cc {
14 14
15 LayerAnimationController::LayerAnimationController(LayerAnimationControllerClien t* client) 15 LayerAnimationController::LayerAnimationController(LayerAnimationControllerClien t* client)
16 : m_forceSync(false) 16 : m_forceSync(false)
17 , m_client(client) 17 , m_client(client)
18 { 18 {
19 } 19 }
20 20
21 LayerAnimationController::~LayerAnimationController() 21 LayerAnimationController::~LayerAnimationController()
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 366
367 // Animation assumes its initial value until it gets the synchronize d start time 367 // Animation assumes its initial value until it gets the synchronize d start time
368 // from the impl thread and can start ticking. 368 // from the impl thread and can start ticking.
369 if (m_activeAnimations[i]->needsSynchronizedStartTime()) 369 if (m_activeAnimations[i]->needsSynchronizedStartTime())
370 trimmed = 0; 370 trimmed = 0;
371 371
372 switch (m_activeAnimations[i]->targetProperty()) { 372 switch (m_activeAnimations[i]->targetProperty()) {
373 373
374 case ActiveAnimation::Transform: { 374 case ActiveAnimation::Transform: {
375 const TransformAnimationCurve* transformAnimationCurve = m_activ eAnimations[i]->curve()->toTransformAnimationCurve(); 375 const TransformAnimationCurve* transformAnimationCurve = m_activ eAnimations[i]->curve()->toTransformAnimationCurve();
376 const WebTransformationMatrix matrix = transformAnimationCurve-> getValue(trimmed); 376 const Transform matrix = transformAnimationCurve->getValue(trimm ed).toTransform();
377 if (m_activeAnimations[i]->isFinishedAt(monotonicTime)) 377 if (m_activeAnimations[i]->isFinishedAt(monotonicTime))
378 m_activeAnimations[i]->setRunState(ActiveAnimation::Finished , monotonicTime); 378 m_activeAnimations[i]->setRunState(ActiveAnimation::Finished , monotonicTime);
379 379
380 m_client->setTransformFromAnimation(matrix); 380 m_client->setTransformFromAnimation(matrix);
381 break; 381 break;
382 } 382 }
383 383
384 case ActiveAnimation::Opacity: { 384 case ActiveAnimation::Opacity: {
385 const FloatAnimationCurve* floatAnimationCurve = m_activeAnimati ons[i]->curve()->toFloatAnimationCurve(); 385 const FloatAnimationCurve* floatAnimationCurve = m_activeAnimati ons[i]->curve()->toFloatAnimationCurve();
386 const float opacity = floatAnimationCurve->getValue(trimmed); 386 const float opacity = floatAnimationCurve->getValue(trimmed);
387 if (m_activeAnimations[i]->isFinishedAt(monotonicTime)) 387 if (m_activeAnimations[i]->isFinishedAt(monotonicTime))
388 m_activeAnimations[i]->setRunState(ActiveAnimation::Finished , monotonicTime); 388 m_activeAnimations[i]->setRunState(ActiveAnimation::Finished , monotonicTime);
389 389
390 m_client->setOpacityFromAnimation(opacity); 390 m_client->setOpacityFromAnimation(opacity);
391 break; 391 break;
392 } 392 }
393 393
394 // Do nothing for sentinel value. 394 // Do nothing for sentinel value.
395 case ActiveAnimation::TargetPropertyEnumSize: 395 case ActiveAnimation::TargetPropertyEnumSize:
396 NOTREACHED(); 396 NOTREACHED();
397 } 397 }
398 } 398 }
399 } 399 }
400 } 400 }
401 401
402 } // namespace cc 402 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698