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

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: Patch for landing Created 8 years 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 | « cc/layer_animation_controller.h ('k') | cc/layer_animation_controller_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 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
11 using WebKit::WebTransformationMatrix;
12 10
13 namespace cc { 11 namespace cc {
14 12
15 LayerAnimationController::LayerAnimationController(LayerAnimationControllerClien t* client) 13 LayerAnimationController::LayerAnimationController(LayerAnimationControllerClien t* client)
16 : m_forceSync(false) 14 : m_forceSync(false)
17 , m_client(client) 15 , m_client(client)
18 { 16 {
19 } 17 }
20 18
21 LayerAnimationController::~LayerAnimationController() 19 LayerAnimationController::~LayerAnimationController()
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 364
367 // Animation assumes its initial value until it gets the synchronize d start time 365 // Animation assumes its initial value until it gets the synchronize d start time
368 // from the impl thread and can start ticking. 366 // from the impl thread and can start ticking.
369 if (m_activeAnimations[i]->needsSynchronizedStartTime()) 367 if (m_activeAnimations[i]->needsSynchronizedStartTime())
370 trimmed = 0; 368 trimmed = 0;
371 369
372 switch (m_activeAnimations[i]->targetProperty()) { 370 switch (m_activeAnimations[i]->targetProperty()) {
373 371
374 case ActiveAnimation::Transform: { 372 case ActiveAnimation::Transform: {
375 const TransformAnimationCurve* transformAnimationCurve = m_activ eAnimations[i]->curve()->toTransformAnimationCurve(); 373 const TransformAnimationCurve* transformAnimationCurve = m_activ eAnimations[i]->curve()->toTransformAnimationCurve();
376 const WebTransformationMatrix matrix = transformAnimationCurve-> getValue(trimmed); 374 const gfx::Transform matrix = transformAnimationCurve->getValue( trimmed).toTransform();
377 if (m_activeAnimations[i]->isFinishedAt(monotonicTime)) 375 if (m_activeAnimations[i]->isFinishedAt(monotonicTime))
378 m_activeAnimations[i]->setRunState(ActiveAnimation::Finished , monotonicTime); 376 m_activeAnimations[i]->setRunState(ActiveAnimation::Finished , monotonicTime);
379 377
380 m_client->setTransformFromAnimation(matrix); 378 m_client->setTransformFromAnimation(matrix);
381 break; 379 break;
382 } 380 }
383 381
384 case ActiveAnimation::Opacity: { 382 case ActiveAnimation::Opacity: {
385 const FloatAnimationCurve* floatAnimationCurve = m_activeAnimati ons[i]->curve()->toFloatAnimationCurve(); 383 const FloatAnimationCurve* floatAnimationCurve = m_activeAnimati ons[i]->curve()->toFloatAnimationCurve();
386 const float opacity = floatAnimationCurve->getValue(trimmed); 384 const float opacity = floatAnimationCurve->getValue(trimmed);
387 if (m_activeAnimations[i]->isFinishedAt(monotonicTime)) 385 if (m_activeAnimations[i]->isFinishedAt(monotonicTime))
388 m_activeAnimations[i]->setRunState(ActiveAnimation::Finished , monotonicTime); 386 m_activeAnimations[i]->setRunState(ActiveAnimation::Finished , monotonicTime);
389 387
390 m_client->setOpacityFromAnimation(opacity); 388 m_client->setOpacityFromAnimation(opacity);
391 break; 389 break;
392 } 390 }
393 391
394 // Do nothing for sentinel value. 392 // Do nothing for sentinel value.
395 case ActiveAnimation::TargetPropertyEnumSize: 393 case ActiveAnimation::TargetPropertyEnumSize:
396 NOTREACHED(); 394 NOTREACHED();
397 } 395 }
398 } 396 }
399 } 397 }
400 } 398 }
401 399
402 } // namespace cc 400 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layer_animation_controller.h ('k') | cc/layer_animation_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698