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

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

Issue 159733003: Don't run paused animations on the compositor. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add automated test. Created 6 years, 10 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
« no previous file with comments | « LayoutTests/animations/animation-paused-hardware-expected.html ('k') | no next file » | 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 if (isNull(m_startTime)) 80 if (isNull(m_startTime))
81 return 0; 81 return 0;
82 return (effectiveTime(m_timeline.currentTime()) - startTime()) * m_playbackR ate; 82 return (effectiveTime(m_timeline.currentTime()) - startTime()) * m_playbackR ate;
83 } 83 }
84 84
85 bool Player::maybeStartAnimationOnCompositor() 85 bool Player::maybeStartAnimationOnCompositor()
86 { 86 {
87 // FIXME: Support starting compositor animations that have a fixed 87 // FIXME: Support starting compositor animations that have a fixed
88 // start time. 88 // start time.
89 ASSERT(!hasStartTime()); 89 ASSERT(!hasStartTime());
90 if (!m_content || !m_content->isAnimation()) 90 if (!m_content || !m_content->isAnimation() || paused())
91 return false; 91 return false;
92 92
93 return toAnimation(m_content.get())->maybeStartAnimationOnCompositor(); 93 return toAnimation(m_content.get())->maybeStartAnimationOnCompositor();
94 } 94 }
95 95
96 bool Player::hasActiveAnimationsOnCompositor() 96 bool Player::hasActiveAnimationsOnCompositor()
97 { 97 {
98 if (!m_content || !m_content->isAnimation()) 98 if (!m_content || !m_content->isAnimation())
99 return false; 99 return false;
100 return toAnimation(m_content.get())->hasActiveAnimationsOnCompositor(); 100 return toAnimation(m_content.get())->hasActiveAnimationsOnCompositor();
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 } 195 }
196 196
197 void Player::setPlaybackRate(double newRate) 197 void Player::setPlaybackRate(double newRate)
198 { 198 {
199 double previousTime = currentTime(); 199 double previousTime = currentTime();
200 m_playbackRate = newRate; 200 m_playbackRate = newRate;
201 setCurrentTime(previousTime); 201 setCurrentTime(previousTime);
202 } 202 }
203 203
204 } // namespace 204 } // namespace
OLDNEW
« no previous file with comments | « LayoutTests/animations/animation-paused-hardware-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698