Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(935)

Unified Diff: Source/core/html/canvas/WebGLRenderingContextBase.cpp

Issue 169933002: WebGL: Don't destroy mailbox textures in the destructor until they're released. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Define operator!= also Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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));
« no previous file with comments | « no previous file | Source/platform/graphics/gpu/DrawingBuffer.h » ('j') | public/platform/WebExternalTextureMailbox.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698