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

Unified Diff: Source/platform/graphics/gpu/DrawingBuffer.cpp

Issue 259533003: WebGL: Fix assertion hit of gpu tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/gpu/DrawingBuffer.cpp
diff --git a/Source/platform/graphics/gpu/DrawingBuffer.cpp b/Source/platform/graphics/gpu/DrawingBuffer.cpp
index e0254864410b0dfe8179a2fd76eea549e89f1293..4967200760aa47b3e78f2992546dea0e3f31bb55 100644
--- a/Source/platform/graphics/gpu/DrawingBuffer.cpp
+++ b/Source/platform/graphics/gpu/DrawingBuffer.cpp
@@ -191,12 +191,18 @@ blink::WebGraphicsContext3D* DrawingBuffer::context()
bool DrawingBuffer::prepareMailbox(blink::WebExternalTextureMailbox* outMailbox, blink::WebExternalBitmap* bitmap)
{
- // prepareMailbox() is always called after layout.
- ASSERT(!m_destructionInProgress);
-
if (!m_contentsChanged)
return false;
+ if (m_destructionInProgress) {
+ // It can be hit in the following sequence.
+ // 1. WebGL draws something.
+ // 2. The compositor begins the frame.
+ // 3. Javascript makes a context lost using WEBGL_lose_context extension.
+ // 4. Here.
+ return false;
+ }
+
m_context->makeContextCurrent();
// Resolve the multisampled buffer into m_colorBuffer texture.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698