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

Side by Side Diff: PerformanceTests/Blending/resources/framerate.js

Issue 643693006: Add performance tests for accelerated elements with CSS Blending. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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 | « PerformanceTests/Blending/mix-blend-mode-propagating-isolation.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
(Empty)
1 (function(){
2
3 var framesPerTimerReading = 10;
4 var frameCount = 0;
5 var startTime;
6 var trackingFrameRate = false;
7 var currentTest;
8
9 function trackFrameRate(currTime)
10 {
11 if (++frameCount == framesPerTimerReading) {
12 frameCount = 0;
13 PerfTestRunner.measureValueAsync(1000 * framesPerTimerReading / (currTim e - startTime));
14 startTime = currTime;
15 }
16
17 if (currentTest && currentTest.run)
18 currentTest.run();
19
20 if (trackingFrameRate)
21 requestAnimationFrame(trackFrameRate);
22 }
23
24 window.startTrackingFrameRate = function(test) {
25 if (trackingFrameRate)
26 return;
27 trackingFrameRate = true;
28 currentTest = test;
29 startTime = performance.now();
30 trackFrameRate();
31 };
32
33 window.stopTrackingFrameRate = function() {
34 trackingFrameRate = false;
35 currentTest = undefined;
36 };
37
38 })();
OLDNEW
« no previous file with comments | « PerformanceTests/Blending/mix-blend-mode-propagating-isolation.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698