| Index: Source/core/html/canvas/WebGLRenderingContextBase.cpp
|
| diff --git a/Source/core/html/canvas/WebGLRenderingContextBase.cpp b/Source/core/html/canvas/WebGLRenderingContextBase.cpp
|
| index d9a684713346b45c30412904a0e509eb76b010da..123ae27dba8f9e6b4a49bf008d0b76dffdf5fde8 100644
|
| --- a/Source/core/html/canvas/WebGLRenderingContextBase.cpp
|
| +++ b/Source/core/html/canvas/WebGLRenderingContextBase.cpp
|
| @@ -721,6 +721,7 @@ void WebGLRenderingContextBase::destroyContext()
|
| webContext()->setErrorMessageCallback(0);
|
|
|
| ASSERT(m_drawingBuffer);
|
| + m_drawingBuffer->beginDestruction();
|
| m_drawingBuffer.clear();
|
| }
|
|
|
| @@ -5372,7 +5373,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));
|
|
|