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

Side by Side Diff: Source/core/animation/CompositorAnimations.cpp

Issue 96093002: Web Animations CSS: Fixing startDelay for compositor translation. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@origin-master
Patch Set: Created 7 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
« no previous file with comments | « no previous file | Source/core/animation/CompositorAnimationsTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 if (out.alternate && (skippedIterations % 2)) 350 if (out.alternate && (skippedIterations % 2))
351 out.reverse = !out.reverse; 351 out.reverse = !out.reverse;
352 352
353 if (!std::isfinite(timing.iterationCount)) { 353 if (!std::isfinite(timing.iterationCount)) {
354 out.adjustedIterationCount = -1; 354 out.adjustedIterationCount = -1;
355 } else { 355 } else {
356 out.adjustedIterationCount = std::floor(timing.iterationCount) - skipped Iterations; 356 out.adjustedIterationCount = std::floor(timing.iterationCount) - skipped Iterations;
357 ASSERT(out.adjustedIterationCount > 0); 357 ASSERT(out.adjustedIterationCount > 0);
358 } 358 }
359 359
360 out.scaledTimeOffset = scaledStartDelay + skippedIterations * out.scaledDura tion; 360 // Compositor's time offset is positive for seeking into the animation.
361 ASSERT(out.scaledTimeOffset <= 0); 361 out.scaledTimeOffset = -(scaledStartDelay + skippedIterations * out.scaledDu ration);
362 ASSERT(out.scaledTimeOffset >= 0);
362 return true; 363 return true;
363 } 364 }
364 365
365 namespace { 366 namespace {
366 367
367 template<typename PlatformAnimationKeyframeType> 368 template<typename PlatformAnimationKeyframeType>
368 static PassOwnPtr<PlatformAnimationKeyframeType> createPlatformKeyframe(double o ffset, const AnimatableValue&) 369 static PassOwnPtr<PlatformAnimationKeyframeType> createPlatformKeyframe(double o ffset, const AnimatableValue&)
369 { 370 {
370 // Only the specialized versions of this templated function (found in 371 // Only the specialized versions of this templated function (found in
371 // the cpp file) should ever be called. 372 // the cpp file) should ever be called.
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 animation->setIterations(compositorTiming.adjustedIterationCount); 548 animation->setIterations(compositorTiming.adjustedIterationCount);
548 animation->setTimeOffset(compositorTiming.scaledTimeOffset); 549 animation->setTimeOffset(compositorTiming.scaledTimeOffset);
549 animation->setAlternatesDirection(compositorTiming.alternate); 550 animation->setAlternatesDirection(compositorTiming.alternate);
550 551
551 animations.append(animation.release()); 552 animations.append(animation.release());
552 } 553 }
553 ASSERT(!animations.isEmpty()); 554 ASSERT(!animations.isEmpty());
554 } 555 }
555 556
556 } // namespace WebCore 557 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/animation/CompositorAnimationsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698