| Index: Source/core/html/canvas/WebGLRenderingContextBase.cpp
|
| diff --git a/Source/core/html/canvas/WebGLRenderingContextBase.cpp b/Source/core/html/canvas/WebGLRenderingContextBase.cpp
|
| index 1d515ad3835ca1a6a3c58e56511bcc77ba0cd531..24d9c28a5ae5e530466e2eaecc9e683cb311dbf4 100644
|
| --- a/Source/core/html/canvas/WebGLRenderingContextBase.cpp
|
| +++ b/Source/core/html/canvas/WebGLRenderingContextBase.cpp
|
| @@ -723,6 +723,7 @@ void WebGLRenderingContextBase::destroyContext()
|
| webContext()->setErrorMessageCallback(0);
|
|
|
| ASSERT(m_drawingBuffer);
|
| + m_drawingBuffer->beginDestruction();
|
| m_drawingBuffer.clear();
|
| }
|
|
|
| @@ -5441,7 +5442,10 @@ void WebGLRenderingContextBase::maybeRestoreContext(Timer<WebGLRenderingContextB
|
| return;
|
|
|
| // If the context was lost due to RealLostContext, we need to destroy the old DrawingBuffer before creating new DrawingBuffer to ensure resource budget enough.
|
| - m_drawingBuffer.clear();
|
| + if (m_drawingBuffer) {
|
| + m_drawingBuffer->beginDestruction();
|
| + m_drawingBuffer.clear();
|
| + }
|
|
|
| blink::WebGraphicsContext3D::Attributes attributes = m_requestedAttributes->attributes(canvas()->document().topDocument().url().string(), settings);
|
| OwnPtr<blink::WebGraphicsContext3D> context = adoptPtr(blink::Platform::current()->createOffscreenGraphicsContext3D(attributes, 0));
|
|
|