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

Side by Side Diff: tools/perf/page_sets/trivial_sites/trivial_webgl.html

Issue 2143523002: mac: Add WebGL power test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@temp82
Patch Set: add file. Created 4 years, 5 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 | « tools/perf/page_sets/mac_gpu_sites.py ('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 <!doctype html> 1 <!doctype html>
2 <!-- 2 <!--
3 Copyright 2016 The Chromium Authors. All rights reserved. 3 Copyright 2016 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be 4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file. 5 found in the LICENSE file.
6 --> 6 -->
7 <html style="height:100%"> 7 <html style="height:100%">
8 <head> 8 <head>
9 <style> 9 <style>
10 html, body { 10 html, body {
11 margin: 0; 11 margin: 0;
12 padding: 0; 12 padding: 0;
13 } 13 }
14 </style> 14 </style>
15 </head> 15 </head>
16 <body style="height:100%"> 16 <body style="height:100%">
17 <canvas id="canvas" width="200" height="100"></canvas> 17 <canvas id="canvas" width="200" height="100"></canvas>
18 </body> 18 </body>
19 <script> 19 <script>
20 var canvas = document.querySelector('canvas'); 20 var canvas = document.querySelector('canvas');
21 canvas.style.width ='100%'; 21 canvas.style.width ='100%';
22 canvas.style.height='100%'; 22 canvas.style.height='100%';
23 canvas.width = canvas.offsetWidth; 23 canvas.width = canvas.offsetWidth;
24 canvas.height = canvas.offsetHeight; 24 canvas.height = canvas.offsetHeight;
25 var ctx = canvas.getContext("2d"); 25 var gl = canvas.getContext("webgl");
26 gl.viewport(0, 0, gl.viewportWidth, gl.viewportHeight);
26 var rColor = 0; 27 var rColor = 0;
27 28
28 function animate() { 29 function animate() {
29 rColor += 1; 30 rColor += 1;
charliea (OOO until 10-5) 2016/07/12 15:30:09 nit: maybe rColor = (rColor + 1) % 255?
erikchen 2016/07/12 18:08:04 Done.
30 rColor %= 255; 31 rColor %= 255;
31 ctx.fillStyle = 'rgb(' + rColor + ',0,0)'; 32 gl.clearColor(rColor / 255, 0.0, 0.0, 1.0);
32 ctx.fillRect(0, 0, canvas.width, canvas.height); 33 gl.clear(gl.COLOR_BUFFER_BIT);
33 window.requestAnimationFrame(animate); 34 window.requestAnimationFrame(animate);
34 } 35 }
35 window.onload = animate; 36 window.onload = animate;
36 </script> 37 </script>
37 </html> 38 </html>
OLDNEW
« no previous file with comments | « tools/perf/page_sets/mac_gpu_sites.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698