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

Issue 749653002: WebGL: clarify which Front or Back buffer is used by each API. (Closed)

Created:
6 years, 1 month ago by dshwang
Modified:
6 years ago
CC:
blink-reviews, krit, pdr+graphicswatchlist_chromium.org, blink-reviews-css, blink-reviews-html_chromium.org, ed+blinkwatch_opera.com, jbroman, danakj, dglazkov+blink, Rik, apavlov+blink_chromium.org, groby+blinkspell_chromium.org, darktears, f(malita), Stephen Chennney, aandrey+blink_chromium.org, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

WebGL: clarify which Front or Back buffer is used by each API. WebGL has double buffers. Front buffer is the buffer used by the compositor and back buffer is the target buffer of WebGL. Following list shows what each API needs. Front buffer - Blink renderer, e.g. HTMLCanvasElement::paint(), CSSCanvasValue::image(), Editor::copyImage(), HTMLCanvasElement::imageSourceURL() - the Compositor, i.e. DrawingBuffer::prepareMailbox() Back buffer - Canvas, e.g. WebGLRenderingContextBase::texImage2D(canvas), CanvasRenderingContext2D::drawImage(canvas), CanvasRenderingContext2D::createPattern(canvas), HTMLCanvasElement::toDataURL() First of all, fix the bug of HTMLCanvasElement::imageSourceURL() when premultipliedAlpha == false. Currently, HTMLCanvasElement::imageSourceURL() always returns back buffer. Simplify code of texImage2D() and texSubImage2D() as copiedImage() can copy both Front and Back buffer. TEST=fast/canvas/webgl/canvas-to-data-url.html BUG=331181 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=186032

Patch Set 1 #

Total comments: 1

Patch Set 2 : Fix bot failure, and fix existing bug of HTMLCanvasElement::imageSourceURL() #

Total comments: 3

Patch Set 3 : fix toDataURL without context #

Total comments: 1

Patch Set 4 : fix fast/canvas/webgl/canvas-to-data-url.html #

Patch Set 5 : Rebase to ToT #

Total comments: 4

Patch Set 6 : Address nits #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+144 lines, -65 lines) Patch
A LayoutTests/fast/canvas/webgl/canvas-to-data-url.html View 1 1 chunk +60 lines, -0 lines 0 comments Download
A LayoutTests/fast/canvas/webgl/canvas-to-data-url-expected.txt View 1 1 chunk +14 lines, -0 lines 0 comments Download
M Source/core/css/CSSCanvasValue.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M Source/core/editing/Editor.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M Source/core/frame/ImageBitmap.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLCanvasElement.h View 1 2 3 4 5 3 chunks +3 lines, -4 lines 0 comments Download
M Source/core/html/HTMLCanvasElement.cpp View 1 2 3 4 5 6 chunks +14 lines, -23 lines 0 comments Download
M Source/core/html/canvas/CanvasRenderingContext.h View 1 2 3 4 5 1 chunk +1 line, -2 lines 0 comments Download
M Source/core/html/canvas/WebGLRenderingContextBase.h View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/html/canvas/WebGLRenderingContextBase.cpp View 1 2 3 4 5 7 chunks +12 lines, -20 lines 0 comments Download
M Source/platform/graphics/GraphicsTypes3D.h View 1 2 3 4 5 1 chunk +7 lines, -1 line 0 comments Download
M Source/platform/graphics/ImageBuffer.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M Source/platform/graphics/ImageBuffer.cpp View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M Source/platform/graphics/gpu/DrawingBuffer.h View 1 2 3 4 5 1 chunk +2 lines, -3 lines 0 comments Download
M Source/platform/graphics/gpu/DrawingBuffer.cpp View 1 2 3 4 5 4 chunks +23 lines, -4 lines 2 comments Download

Messages

Total messages: 16 (3 generated)
dshwang
kbr@, could you review this further clean-up? https://codereview.chromium.org/749653002/diff/1/Source/core/html/HTMLCanvasElement.cpp File Source/core/html/HTMLCanvasElement.cpp (left): https://codereview.chromium.org/749653002/diff/1/Source/core/html/HTMLCanvasElement.cpp#oldcode394 Source/core/html/HTMLCanvasElement.cpp:394: // Try ...
6 years, 1 month ago (2014-11-20 21:14:28 UTC) #2
Ken Russell (switch to Gerrit)
I note there is a test failure on all GPU bots with this CL. Could ...
6 years, 1 month ago (2014-11-21 01:28:27 UTC) #3
dshwang
After digging into webconformance test failure, I realize paintRenderingResultsToImageData() is needed when premultipliedAlpha == false. ...
6 years, 1 month ago (2014-11-21 09:05:40 UTC) #4
Ken Russell (switch to Gerrit)
It looks like this new CL breaks several layout tests of Canvas.toDataURL. Could you please ...
6 years, 1 month ago (2014-11-22 00:16:59 UTC) #5
dshwang
Thank you for review. I fixed the broken toDataURL. https://codereview.chromium.org/749653002/diff/20001/Source/core/html/HTMLCanvasElement.cpp File Source/core/html/HTMLCanvasElement.cpp (right): https://codereview.chromium.org/749653002/diff/20001/Source/core/html/HTMLCanvasElement.cpp#newcode404 Source/core/html/HTMLCanvasElement.cpp:404: ...
6 years, 1 month ago (2014-11-22 19:32:18 UTC) #6
Ken Russell (switch to Gerrit)
On 2014/11/22 19:32:18, dshwang wrote: > Thank you for review. I fixed the broken toDataURL. ...
6 years, 1 month ago (2014-11-24 02:55:19 UTC) #7
dshwang
https://codereview.chromium.org/749653002/diff/20001/Source/core/html/HTMLCanvasElement.cpp > It looks like toDataURL tests are still failing against the most recent patch ...
6 years ago (2014-11-24 14:06:09 UTC) #8
Ken Russell (switch to Gerrit)
Thanks for doing this cleanup. Nice work in particular on the test. LGTM with a ...
6 years ago (2014-11-26 00:49:10 UTC) #9
dshwang
Thank you for review. I fix all nits. https://codereview.chromium.org/749653002/diff/80001/Source/core/html/HTMLCanvasElement.h File Source/core/html/HTMLCanvasElement.h (right): https://codereview.chromium.org/749653002/diff/80001/Source/core/html/HTMLCanvasElement.h#newcode122 Source/core/html/HTMLCanvasElement.h:122: enum ...
6 years ago (2014-11-26 13:37:30 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/749653002/100001
6 years ago (2014-11-26 13:41:24 UTC) #12
commit-bot: I haz the power
Committed patchset #6 (id:100001) as https://src.chromium.org/viewvc/blink?view=rev&revision=186032
6 years ago (2014-11-26 14:44:35 UTC) #13
Yuki
https://codereview.chromium.org/749653002/diff/100001/Source/platform/graphics/gpu/DrawingBuffer.cpp File Source/platform/graphics/gpu/DrawingBuffer.cpp (right): https://codereview.chromium.org/749653002/diff/100001/Source/platform/graphics/gpu/DrawingBuffer.cpp#newcode908 Source/platform/graphics/gpu/DrawingBuffer.cpp:908: GLint fbo = m_context->createFramebuffer(); Hi dongseong.hwang, It seems that ...
6 years ago (2014-11-27 04:30:22 UTC) #15
dshwang
6 years ago (2014-11-27 09:46:31 UTC) #16
Message was sent while issue was closed.
https://codereview.chromium.org/749653002/diff/100001/Source/platform/graphic...
File Source/platform/graphics/gpu/DrawingBuffer.cpp (right):

https://codereview.chromium.org/749653002/diff/100001/Source/platform/graphic...
Source/platform/graphics/gpu/DrawingBuffer.cpp:908: GLint fbo =
m_context->createFramebuffer();
On 2014/11/27 04:30:22, Yuki wrote:
> Hi dongseong.hwang,
> 
> It seems that you're shadowing |fbo| variable here, so the other |fbo| on line
> 906 will not be updated.  It seems a if-clause on line 918 never be true.
> 
> Is this right?  Is this what you intended?

Thank you very much for noting! it's a mistake.

Powered by Google App Engine
This is Rietveld 408576698