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

Side by Side Diff: tools/perf/page_sets/tough_canvas_cases/rendering_throughput/bench.js

Issue 1995163002: Test page for rendering throughput for canvas arcs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing comments Created 4 years, 7 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 var bench = (function() { 5 var bench = (function() {
6 var rafFunc; 6 var rafFunc;
7 var drawFunc; 7 var drawFunc;
8 8
9 function tick() { 9 function tick() {
10 drawFunc(); 10 drawFunc();
11 rafFunc(tick); 11 rafFunc(tick);
12 }; 12 };
13 13
14 function startAnimation() { 14 function startAnimation() {
15 rafFunc = window.requestAnimationFrame || 15 rafFunc = window.requestAnimationFrame ||
16 window.webkitRequestAnimationFrame || 16 window.webkitRequestAnimationFrame ||
17 window.mozRequestAnimationFrame || 17 window.mozRequestAnimationFrame ||
18 window.oRequestAnimationFrame || 18 window.oRequestAnimationFrame ||
19 window.msRequestAnimationFrame; 19 window.msRequestAnimationFrame;
20 rafFunc(tick); 20 rafFunc(tick);
21 }; 21 };
22 22
23 var bench = {}; 23 var bench = {};
24 bench.run = function(df) { 24 bench.run = function(df) {
25 drawFunc = df; 25 drawFunc = df;
26 startAnimation(); 26 startAnimation();
27 }; 27 };
28 return bench; 28 return bench;
29 })(); 29 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698