| Index: Source/core/html/canvas/WebGLRenderingContextBase.cpp
|
| diff --git a/Source/core/html/canvas/WebGLRenderingContextBase.cpp b/Source/core/html/canvas/WebGLRenderingContextBase.cpp
|
| index 2abffdb3c203a6e83ef618e5bc0731d53d7602f7..55456a7e586c049f39dac4b66255f9dd2a7dfc60 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();
|
| }
|
|
|
| @@ -5439,7 +5440,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));
|
|
|