Index: content/test/data/gpu/pixel_canvas2d_webgl.html |
diff --git a/content/test/data/gpu/pixel_canvas2d_accelerated.html b/content/test/data/gpu/pixel_canvas2d_webgl.html |
similarity index 69% |
copy from content/test/data/gpu/pixel_canvas2d_accelerated.html |
copy to content/test/data/gpu/pixel_canvas2d_webgl.html |
index 700179c70653036bc4bfec8d72ef11228c09497d..2eea10aa5d69b1278229355a499f285fe7b0b9e6 100644 |
--- a/content/test/data/gpu/pixel_canvas2d_accelerated.html |
+++ b/content/test/data/gpu/pixel_canvas2d_webgl.html |
@@ -8,14 +8,18 @@ that the baseline images are regenerated on the next run. |
<html> |
<head> |
-<title>Accelerated Canvas 2D Test: Red Box over Black Background</title> |
+<title>Accelerated Retina Canvas 2D and WebGL Test: Red Box and Green Triangle over Black Background</title> |
<style type="text/css"> |
.nomargin { |
margin: 0px auto; |
} |
</style> |
+ |
+<script src="pixel_webgl_util.js"></script> |
+ |
<script> |
var g_swapsBeforeAck = 15; |
+var gl; |
function main() |
{ |
@@ -26,10 +30,18 @@ function main() |
function draw() |
{ |
var canvas = document.getElementById("c"); |
+ canvas.style.width = canvas.style.height = "150px"; |
var c2d = canvas.getContext("2d"); |
c2d.clearRect(0, 0, canvas.width, canvas.height); |
c2d.fillStyle = "rgba(255, 0, 0, 0.5)"; |
c2d.fillRect(50, 50, 100, 100); |
+ |
+ var webglCanvas = document.getElementById("c2"); |
+ gl = initGL(webglCanvas); |
+ if (!setup(gl)) { |
+ domAutomationController.setAutomationId(1); |
+ domAutomationController.send("FAILURE"); |
+ } |
} |
function waitForFinish() |
@@ -40,19 +52,21 @@ function waitForFinish() |
} else { |
g_swapsBeforeAck--; |
document.getElementById('container').style.zIndex = g_swapsBeforeAck + 1; |
+ drawTriangle(gl); |
window.webkitRequestAnimationFrame(waitForFinish); |
} |
} |
</script> |
</head> |
<body onload="main()"> |
-<div style="position:relative; width:300px; height:300px; background-color:black"> |
+<div style="position:relative; width:400px; height:400px; background-color:black"> |
</div> |
<div id="container" style="position:absolute; top:0px; left:0px"> |
<!-- |
Canvas acceleration requires that the canvas be at least 256x257. |
--> |
<canvas id="c" width="300" height="300" class="nomargin"></canvas> |
+<canvas id="c2" width="300" height="300" class="nomargin"></canvas> |
</div> |
</body> |
</html> |