Chromium Code Reviews| 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 80% |
| copy from tools/perf/page_sets/trivial_sites/trivial_canvas.html |
| copy to tools/perf/page_sets/trivial_sites/trivial_webgl.html |
| index 567193796aeae1d75dea787512b589330a631fd3..5a90573b8b48f97af884aa4afe6e644ab726de7d 100644 |
| --- a/tools/perf/page_sets/trivial_sites/trivial_canvas.html |
| +++ b/tools/perf/page_sets/trivial_sites/trivial_webgl.html |
| @@ -22,14 +22,15 @@ 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; |
|
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.
|
| rColor %= 255; |
| - ctx.fillStyle = 'rgb(' + rColor + ',0,0)'; |
| - ctx.fillRect(0, 0, canvas.width, canvas.height); |
| + gl.clearColor(rColor / 255, 0.0, 0.0, 1.0); |
| + gl.clear(gl.COLOR_BUFFER_BIT); |
| window.requestAnimationFrame(animate); |
| } |
| window.onload = animate; |