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

Unified Diff: PerformanceTests/Animation/resources/framerate.js

Issue 1163373006: Revert of Finalize migration of blink_perf.animation to smoothness.tough_animation_cases (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « PerformanceTests/Animation/mix-blend-mode-propagating-isolation.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: PerformanceTests/Animation/resources/framerate.js
diff --git a/PerformanceTests/Animation/resources/framerate.js b/PerformanceTests/Animation/resources/framerate.js
new file mode 100644
index 0000000000000000000000000000000000000000..2b3d0c03c59ee2e0ea931f9e07ecfd5e1f1f1397
--- /dev/null
+++ b/PerformanceTests/Animation/resources/framerate.js
@@ -0,0 +1,32 @@
+(function(){
+
+var framesPerTimerReading = 10;
+var frameCount = 0;
+var startTime;
+var trackingFrameRate = false;
+
+function trackFrameRate(currTime)
+{
+ if (++frameCount == framesPerTimerReading) {
+ frameCount = 0;
+ PerfTestRunner.measureValueAsync(1000 * framesPerTimerReading / (currTime - startTime));
+ startTime = currTime;
+ }
+
+ if (trackingFrameRate)
+ requestAnimationFrame(trackFrameRate);
+}
+
+window.startTrackingFrameRate = function() {
+ if (trackingFrameRate)
+ return;
+ trackingFrameRate = true;
+ startTime = performance.now();
+ trackFrameRate();
+};
+
+window.stopTrackingFrameRate = function() {
+ trackingFrameRate = false;
+};
+
+})();
« no previous file with comments | « PerformanceTests/Animation/mix-blend-mode-propagating-isolation.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698