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

Issue 776293002: Window.createImageBitmap(HTMLCanvasElement) should copy the front buffer of WebGL, not back buffer (Closed)

Created:
6 years ago by dshwang
Modified:
6 years ago
CC:
blink-reviews, bajones, Zhenyao Mo
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

Window.createImageBitmap(HTMLCanvasElement) should copy the front buffer of WebGL, not back buffer BUG=438986

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+38 lines, -7 lines) Patch
M LayoutTests/fast/canvas/canvas-createImageBitmap-webgl.html View 2 chunks +27 lines, -6 lines 0 comments Download
M LayoutTests/fast/canvas/canvas-createImageBitmap-webgl-expected.txt View 1 chunk +10 lines, -0 lines 0 comments Download
M Source/core/frame/ImageBitmap.cpp View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 6 (1 generated)
dshwang
@kbr, could you review? Although the w3c bug [1] is not resolved yet, I'm willing ...
6 years ago (2014-12-04 16:49:41 UTC) #2
Ken Russell (switch to Gerrit)
Thanks for pointing this out and working on it. A change definitely needs to be ...
6 years ago (2014-12-05 02:56:06 UTC) #3
dshwang
On 2014/12/05 02:56:06, Ken Russell wrote: > Thanks for pointing this out and working on ...
6 years ago (2014-12-05 10:10:44 UTC) #4
Ken Russell (switch to Gerrit)
On 2014/12/05 10:10:44, dshwang wrote: > On 2014/12/05 02:56:06, Ken Russell wrote: > > Thanks ...
6 years ago (2014-12-05 20:22:32 UTC) #5
dshwang
6 years ago (2014-12-05 20:33:23 UTC) #6
On 2014/12/05 20:22:32, Ken Russell wrote:
> On 2014/12/05 10:10:44, dshwang wrote:
> > On 2014/12/05 02:56:06, Ken Russell wrote:
> > > Thanks for pointing this out and working on it.
> > > 
> > > A change definitely needs to be made here, to the spec as well, but I
think
> > the
> > > fix needs to be more subtle. If a user does the following all in a single
> > frame:
> > > 
> > >  1. Draws some WebGL to a canvas
> > >  2. Turns that canvas into an ImageBitmap
> > >  3. When the ImageBitmap is resolved, draws it to a different canvas's 2D
> > > context
> > > 
> > > the ImageBitmap should conceptually contain the rendering results from
(1),
> > > wouldn't you say?
> > 
> > I agree. (1) should belong to the results.
> > 
> > > I think we need to specify this as something like: if the WebGL context's
> > > results have been modified since the last time its results were presented
to
> > the
> > > web page compositor, then the most recent results are used (i.e., the back
> > > buffer); otherwise, the front buffer is used.
> > 
> > After reading your explanation, I think copying back buffer is better than
> > copying front buffer.
> > And this subtle way might be better than copying back buffer.
> > 
> > > Is this feasible to implement? I think there are enough state bits on the
> > > WebGLRenderingContextBase to track this.
> > 
> > It's feasible while it makes code more complicated mainly because we cache
the
> > rendering results until next frame.
> > 
> > By the way, canvas.drawImage(WebGLCanvas) and webgl.texImage2D(WebGLCanvas)
> copy
> > transparent buffer since the last time its results were presented to the web
> > page compositor.
> > Do we need to give this special care to only ImageBuffer? I think
ImageBuffer
> > should behave similar to canvas.drawImage(WebGLCanvas) and
> > webgl.texImage2D(WebGLCanvas).
> > I mean copying back buffer for ImageBuffer is not bad, instead of subtle
care.
> 
> Right, I don't know what I was thinking. All of these APIs should behave
> identically, so I don't think any changes should be made in this area.

I agree. I close it as WontFix

Powered by Google App Engine
This is Rietveld 408576698