| Index: Source/core/html/canvas/WebGLRenderingContextBase.cpp
|
| diff --git a/Source/core/html/canvas/WebGLRenderingContextBase.cpp b/Source/core/html/canvas/WebGLRenderingContextBase.cpp
|
| index a39ff73483b76d1be2e00c225771ce5d5fa4611f..c8b8e9797024b83f604a452d9364748cff364f93 100644
|
| --- a/Source/core/html/canvas/WebGLRenderingContextBase.cpp
|
| +++ b/Source/core/html/canvas/WebGLRenderingContextBase.cpp
|
| @@ -719,6 +719,7 @@ void WebGLRenderingContextBase::destroyContext()
|
| webContext()->setErrorMessageCallback(0);
|
|
|
| ASSERT(m_drawingBuffer);
|
| + m_drawingBuffer->beginDestruction();
|
| m_drawingBuffer.clear();
|
| }
|
|
|
| @@ -5369,7 +5370,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));
|
|
|