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

Unified 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: Comments. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/perf/page_sets/mac_gpu_sites.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/page_sets/trivial_sites/trivial_webgl.html
diff --git a/tools/perf/page_sets/trivial_sites/trivial_canvas.html b/tools/perf/page_sets/trivial_sites/trivial_webgl.html
similarity index 77%
copy from tools/perf/page_sets/trivial_sites/trivial_canvas.html
copy to tools/perf/page_sets/trivial_sites/trivial_webgl.html
index 567193796aeae1d75dea787512b589330a631fd3..cbfbe384a65f3cc939c26d875ade6b9e869abfb8 100644
--- a/tools/perf/page_sets/trivial_sites/trivial_canvas.html
+++ b/tools/perf/page_sets/trivial_sites/trivial_webgl.html
@@ -22,14 +22,14 @@ found in the LICENSE file.
canvas.style.height='100%';
canvas.width = canvas.offsetWidth;
canvas.height = canvas.offsetHeight;
- var ctx = canvas.getContext("2d");
+ var gl = canvas.getContext("webgl");
+ gl.viewport(0, 0, gl.viewportWidth, gl.viewportHeight);
var rColor = 0;
function animate() {
- rColor += 1;
- rColor %= 255;
- ctx.fillStyle = 'rgb(' + rColor + ',0,0)';
- ctx.fillRect(0, 0, canvas.width, canvas.height);
+ rColor = (rColor + 1) % 255;
+ gl.clearColor(rColor / 255, 0.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
window.requestAnimationFrame(animate);
}
window.onload = animate;
« 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