| Index: content/test/data/gpu/pixel_webgl2_blitframebuffer_noalpha.html
|
| diff --git a/content/test/data/gpu/pixel_webgl2_blitframebuffer_noalpha.html b/content/test/data/gpu/pixel_webgl2_blitframebuffer_noalpha.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..e5e65b01fa5e3b86147508eed7cf8a74ea6074ae
|
| --- /dev/null
|
| +++ b/content/test/data/gpu/pixel_webgl2_blitframebuffer_noalpha.html
|
| @@ -0,0 +1,78 @@
|
| +<!DOCTYPE HTML>
|
| +
|
| +<!-- READ BEFORE UPDATING:
|
| +If this test is updated make sure to increment the "revision" value of the
|
| +associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure
|
| +that the baseline images are regenerated on the next run.
|
| +-->
|
| +
|
| +<html>
|
| +<head>
|
| +<title>WebGL 2.0 Test: BlitFramebuffer to default back buffer with no alpha</title>
|
| +<style type="text/css">
|
| +.nomargin {
|
| + margin: 0px auto;
|
| +}
|
| +</style>
|
| +
|
| +<script src="pixel_webgl2_util.js"></script>
|
| +
|
| +<script>
|
| +'use strict';
|
| +function main()
|
| +{
|
| + let gl = initGL(document.getElementById("c"), false, false);
|
| +
|
| + // Assume a square framebuffer. Doesn't need to match the size of the canvas, necessarily.
|
| + let sz = 200;
|
| +
|
| + // Create a framebuffer with a 4x multisampled RGBA8 renderbuffer.
|
| + // Assume this is a commonly supported configuration.
|
| + let rb = gl.createRenderbuffer();
|
| + gl.bindRenderbuffer(gl.RENDERBUFFER, rb);
|
| + gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 4, gl.RGBA8, sz, sz);
|
| +
|
| + // Create a framebuffer.
|
| + let fb = gl.createFramebuffer();
|
| + gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
|
| + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rb);
|
| +
|
| + // Check for completeness.
|
| + if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE) {
|
| + if (window.domAutomationController) {
|
| + domAutomationController.setAutomationId(1);
|
| + domAutomationController.send("FAILED");
|
| + }
|
| + return;
|
| + }
|
| +
|
| + // Clear to transparent green.
|
| + gl.clearColor(0.0, 1.0, 0.0, 0.0);
|
| + gl.clear(gl.COLOR_BUFFER_BIT);
|
| +
|
| + // Unbind draw framebuffer. Read framebuffer is now user framebuffer;
|
| + // draw framebuffer is default framebuffer.
|
| + gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, null);
|
| +
|
| + // Blit from user framebuffer to default framebuffer.
|
| + gl.blitFramebuffer(0, 0, sz, sz, 0, 0, sz, sz, gl.COLOR_BUFFER_BIT, gl.NEAREST);
|
| +
|
| + let err = gl.getError();
|
| + if (err != gl.NO_ERROR) {
|
| + if (window.domAutomationController) {
|
| + domAutomationController.setAutomationId(1);
|
| + domAutomationController.send("FAILED");
|
| + }
|
| + }
|
| +
|
| + // Wait a few frames, and have the harness take a pixel snapshot.
|
| + waitAndSignalHarness();
|
| +}
|
| +</script>
|
| +</head>
|
| +<body onload="main()">
|
| +<div style="position:absolute; top:0px; left:0px">
|
| +<canvas id="c" width="200" height="200" class="nomargin"></canvas>
|
| +</div>
|
| +</body>
|
| +</html>
|
|
|