Issue metadata
Sign in to add a comment
|
offscreen canvas + bitmaprenderer nor working?
Reported by
iquilez...@hotmail.com,
Sep 19
|
||||||||||||||||||||||||
Issue description
UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
Steps to reproduce the problem:
1. Try the self contained HTML in attachment
2. It should display a red, green and blue squares
3. But it doesn't
4. If you remove the last transfer, the second square renders
What is the expected behavior?
All red, green and blue squares should display properly
What went wrong?
Seems like Canvas::transferToImageBitmap() isn't working as expected?
Did this work before? N/A
Does this work in other browsers? N/A
Chrome version: 69.0.3497.100 Channel: stable
OS Version: 10.0
Flash Version:
<html>
<head>
<script>
function main()
{
let options = { alpha:false, depth:false, stencil:false, antialias:false, premultipliedAlpha:false, preserveDrawingBuffer:false };
// Adquire canvases and contexts. First 3 come from DOM, last one is offscreen/gl
let c1 = document.getElementById("c1"); let k1 = c1.getContext("bitmaprenderer");
let c2 = document.getElementById("c2"); let k2 = c2.getContext("bitmaprenderer");
let c3 = document.getElementById("c3"); let k3 = c3.getContext("bitmaprenderer");
let cR = new OffscreenCanvas(256, 256); let gl = cR.getContext('webgl2',options);
// Render RED and transfer to canvas 1
gl.clearColor( 1.0, 0.0, 1.0, 1.0 ); gl.clear( gl.COLOR_BUFFER_BIT );
k1.transferFromImageBitmap(cR.transferToImageBitmap());
// Render GREEN and transfer to canvas 2
gl.clearColor( 0.0, 1.0, 0.0, 1.0 ); gl.clear( gl.COLOR_BUFFER_BIT );
k2.transferFromImageBitmap(cR.transferToImageBitmap());
// Render BLUE and transfer to canvas 3
gl.clearColor( 0.0, 0.0, 1.0, 1.0 ); gl.clear( gl.COLOR_BUFFER_BIT );
k3.transferFromImageBitmap(cR.transferToImageBitmap());
}
</script>
</head>
<body onload="main()">
<canvas id="c1" width="256" height="256" style="width:256px;height:256px"></canvas>
<canvas id="c2" width="256" height="256" style="width:256px;height:256px"></canvas>
<canvas id="c3" width="256" height="256" style="width:256px;height:256px"></canvas>
</body>
</html>
,
Sep 20
iquilezles@ Thanks for the issue. This issue is similar to issue 886568. Hence merging this to issue 886568. Thanks.. |
|||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||
Comment 1 by susan.boorgula@chromium.org
, Sep 19