DescriptionWebGL: 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
Messages
Total messages: 32 (0 generated)
|