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

Issue 163773007: WebGL: Transfer ownership of WebGraphicsContext3D from WebGLRenderingContext to DrawingBuffer. (Closed)

Created:
6 years, 10 months ago by dshwang
Modified:
6 years, 9 months ago
CC:
blink-reviews, jamesr, krit, dsinclair, jbroman, danakj, dglazkov+blink, Rik, adamk+blink_chromium.org, Stephen Chennney, aandrey+blink_chromium.org, pdr., rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/blink.git@correct_webgl_destroy
Visibility:
Public.

Description

WebGL: Transfer ownership of WebGraphicsContext3D from WebGLRenderingContext to DrawingBuffer. Currently, the lifecycle of DrawingBuffer is different from it of WebGraphicsContext3D, so there is so many checks if the context is valid. This complexity is not necessary because DrawingBuffer does not own any objects when the context is lost or impossible to be created. To be clear the lifecycle, this CL makes DrawingBuffer take ownership of WebGraphicsContext3D. The DrawingBuffer creation or resize can fail if the memory is not enough. This logic is preserved. In detail, 1. If it occurs during WebGLRenderingContext creation, we give up creating WebGLRenderingContext. 2. If it occurs during restoration of lost context, we will try again. 3. If it occurs during resizing DrawingBuffer, we slightly ignore, because we can reuse different size FBO in this case. In addition, this CL fixes two bugs. 1. maybeRestoreContext() pretends to success to restore although creating FBO in DrawingBuffer fails. As mentioned earlier, we will try again. 2. WebGLRenderingContext calls DrawingBuffer::reset() twice during creation, because the constructor of DrawingBuffer internally calls reset(). BUG=344393 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=168457

Patch Set 1 #

Patch Set 2 : Transfer ownership of GraphicsContext3D from WebGLRenderingContext to DrawingBuffer. #

Patch Set 3 : #

Total comments: 1

Patch Set 4 : replace all uses of m_context with m_drawingBuffer->context() #

Patch Set 5 : rebase to upstream #

Total comments: 7

Patch Set 6 : Use webContext() instead of m_drawingBuffer->context() #

Total comments: 2

Patch Set 7 : Rebase to upstream #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+384 lines, -422 lines) Patch
M Source/core/html/canvas/OESVertexArrayObject.cpp View 1 2 3 4 5 3 chunks +5 lines, -5 lines 0 comments Download
M Source/core/html/canvas/WebGLBuffer.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/canvas/WebGLContextGroup.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/canvas/WebGLContextObject.cpp View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/html/canvas/WebGLDebugShaders.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/canvas/WebGLDrawBuffers.cpp View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/html/canvas/WebGLFramebuffer.cpp View 1 2 3 4 5 5 chunks +5 lines, -5 lines 0 comments Download
M Source/core/html/canvas/WebGLProgram.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/canvas/WebGLRenderbuffer.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/canvas/WebGLRenderingContext.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/canvas/WebGLRenderingContextBase.h View 1 2 3 4 5 5 chunks +4 lines, -6 lines 0 comments Download
M Source/core/html/canvas/WebGLRenderingContextBase.cpp View 1 2 3 4 5 161 chunks +300 lines, -305 lines 0 comments Download
M Source/core/html/canvas/WebGLShader.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/canvas/WebGLTexture.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/canvas/WebGLVertexArrayObjectOES.cpp View 1 2 3 4 5 5 chunks +6 lines, -6 lines 0 comments Download
M Source/platform/graphics/gpu/DrawingBuffer.h View 1 2 3 3 chunks +6 lines, -10 lines 0 comments Download
M Source/platform/graphics/gpu/DrawingBuffer.cpp View 1 2 3 4 5 6 19 chunks +41 lines, -59 lines 2 comments Download
M Source/web/tests/DrawingBufferTest.cpp View 1 2 chunks +5 lines, -14 lines 0 comments Download

Messages

Total messages: 32 (0 generated)
dshwang
6 years, 10 months ago (2014-02-17 19:03:08 UTC) #1
dshwang
6 years, 10 months ago (2014-02-19 10:44:11 UTC) #2
dshwang
I change this CL's goal to make more self-sufficient CL. This CL is preparation of ...
6 years, 10 months ago (2014-02-20 14:49:08 UTC) #3
dshwang
Could you have a chance to review?
6 years, 10 months ago (2014-02-21 07:07:59 UTC) #4
dshwang
On 2014/02/21 07:07:59, dshwang wrote: > Could you have a chance to review?
6 years, 10 months ago (2014-02-24 15:07:18 UTC) #5
Justin Novosad
https://codereview.chromium.org/163773007/diff/130001/Source/core/html/canvas/WebGLRenderingContext.h File Source/core/html/canvas/WebGLRenderingContext.h (right): https://codereview.chromium.org/163773007/diff/130001/Source/core/html/canvas/WebGLRenderingContext.h#newcode392 Source/core/html/canvas/WebGLRenderingContext.h:392: blink::WebGraphicsContext3D* m_context; Having m_context is fragile because future code ...
6 years, 10 months ago (2014-02-24 15:25:56 UTC) #6
dshwang
On 2014/02/24 15:25:56, junov wrote: > https://codereview.chromium.org/163773007/diff/130001/Source/core/html/canvas/WebGLRenderingContext.h > File Source/core/html/canvas/WebGLRenderingContext.h (right): > > https://codereview.chromium.org/163773007/diff/130001/Source/core/html/canvas/WebGLRenderingContext.h#newcode392 > ...
6 years, 10 months ago (2014-02-25 20:05:31 UTC) #7
Justin Novosad
Looks right to me, but I'd rather defer approval to the WebGL experts.
6 years, 10 months ago (2014-02-25 21:58:17 UTC) #8
dshwang
On 2014/02/25 21:58:17, junov wrote: > Looks right to me, but I'd rather defer approval ...
6 years, 10 months ago (2014-02-26 15:23:39 UTC) #9
dshwang
all layout tests are passed on debug build. webgl conformance test results are the same ...
6 years, 10 months ago (2014-02-26 16:53:27 UTC) #10
dshwang
6 years, 9 months ago (2014-02-27 20:39:59 UTC) #11
Ken Russell (switch to Gerrit)
I'm sorry for taking so long to review this. Overall it seems good. A couple ...
6 years, 9 months ago (2014-02-27 22:49:09 UTC) #12
dshwang
On 2014/02/27 22:49:09, Ken Russell wrote: > I'm sorry for taking so long to review ...
6 years, 9 months ago (2014-02-28 13:10:18 UTC) #13
dshwang
hi, could you have a chance to review again?
6 years, 9 months ago (2014-03-03 11:28:16 UTC) #14
Ken Russell (switch to Gerrit)
I'm sorry again for taking so long to get to this. Thanks for the contribution. ...
6 years, 9 months ago (2014-03-04 03:12:06 UTC) #15
dshwang
thank you for lgtm :) https://codereview.chromium.org/163773007/diff/240001/Source/platform/graphics/gpu/DrawingBuffer.cpp File Source/platform/graphics/gpu/DrawingBuffer.cpp (right): https://codereview.chromium.org/163773007/diff/240001/Source/platform/graphics/gpu/DrawingBuffer.cpp#newcode129 Source/platform/graphics/gpu/DrawingBuffer.cpp:129: , m_sampleCount(4) On 2014/03/04 ...
6 years, 9 months ago (2014-03-04 08:51:05 UTC) #16
dshwang
The CQ bit was checked by dongseong.hwang@intel.com
6 years, 9 months ago (2014-03-04 08:51:13 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dongseong.hwang@intel.com/163773007/240001
6 years, 9 months ago (2014-03-04 08:51:26 UTC) #18
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-04 09:15:57 UTC) #19
commit-bot: I haz the power
Retried try job too often on blink_presubmit for step(s) presubmit http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=blink_presubmit&number=17177
6 years, 9 months ago (2014-03-04 09:15:58 UTC) #20
dshwang
On 2014/03/04 09:15:58, I haz the power (commit-bot) wrote: > Retried try job too often ...
6 years, 9 months ago (2014-03-04 09:47:58 UTC) #21
dshwang
On 2014/03/04 09:47:58, dshwang wrote: > Hi jamesr@, could you review Source/web/tests/DrawingBufferTest.cpp ? I remove ...
6 years, 9 months ago (2014-03-04 09:49:03 UTC) #22
dshwang
https://codereview.chromium.org/163773007/diff/260001/Source/platform/graphics/gpu/DrawingBuffer.cpp File Source/platform/graphics/gpu/DrawingBuffer.cpp (right): https://codereview.chromium.org/163773007/diff/260001/Source/platform/graphics/gpu/DrawingBuffer.cpp#newcode129 Source/platform/graphics/gpu/DrawingBuffer.cpp:129: , m_sampleCount(0) I change from m_sampleCount(4) to m_sampleCount(0) for ...
6 years, 9 months ago (2014-03-04 09:54:28 UTC) #23
Ken Russell (switch to Gerrit)
https://codereview.chromium.org/163773007/diff/260001/Source/platform/graphics/gpu/DrawingBuffer.cpp File Source/platform/graphics/gpu/DrawingBuffer.cpp (right): https://codereview.chromium.org/163773007/diff/260001/Source/platform/graphics/gpu/DrawingBuffer.cpp#newcode129 Source/platform/graphics/gpu/DrawingBuffer.cpp:129: , m_sampleCount(0) On 2014/03/04 09:54:28, dshwang wrote: > I ...
6 years, 9 months ago (2014-03-04 12:35:08 UTC) #24
dshwang
On 2014/03/04 12:35:08, Ken Russell wrote: > > std::min(4, maxSampleCount). > > That's fine, and ...
6 years, 9 months ago (2014-03-04 17:21:57 UTC) #25
jamesr
/web/tests/ lgtm The best way to fix the OWNERS awkwardness here is to move the ...
6 years, 9 months ago (2014-03-04 18:13:13 UTC) #26
Ken Russell (switch to Gerrit)
+a couple more Source/web/ OWNERS
6 years, 9 months ago (2014-03-04 18:21:08 UTC) #27
dshwang
The CQ bit was checked by dongseong.hwang@intel.com
6 years, 9 months ago (2014-03-04 18:44:09 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dongseong.hwang@intel.com/163773007/260001
6 years, 9 months ago (2014-03-04 18:45:00 UTC) #29
commit-bot: I haz the power
Change committed as 168457
6 years, 9 months ago (2014-03-05 09:33:00 UTC) #30
Ken Russell (switch to Gerrit)
Note: this was reverted because of assertion failures on the debug GPU bots. See Issue ...
6 years, 9 months ago (2014-03-05 19:59:17 UTC) #31
dshwang
6 years, 9 months ago (2014-03-05 20:20:02 UTC) #32
Message was sent while issue was closed.
On 2014/03/05 19:59:17, Ken Russell wrote:
> Note: this was reverted because of assertion failures on the debug GPU bots.
See
> Issue 344393.

Yes, thank you very much. I felt concern about lost context also, so I run
layout tests and webgl conformance test using debug build. It was not enough.
I’m glad that GPU bots catch it. I'll look at it carefully.

Powered by Google App Engine
This is Rietveld 408576698