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

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

Issue 369043003: Let canvas decide how to handle the case of resource lost reported by client: 2D part (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: delete mailbox if context or resource is lost Created 6 years, 5 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/platform/graphics/gpu/DrawingBuffer.cpp
diff --git a/Source/platform/graphics/gpu/DrawingBuffer.cpp b/Source/platform/graphics/gpu/DrawingBuffer.cpp
index 0ec4bf9179012c1217b92aa3362f4f7d02e1e9df..dfb2056ba6cb307076c70f302e01a21bb9195c14 100644
--- a/Source/platform/graphics/gpu/DrawingBuffer.cpp
+++ b/Source/platform/graphics/gpu/DrawingBuffer.cpp
@@ -276,9 +276,9 @@ bool DrawingBuffer::prepareMailbox(blink::WebExternalTextureMailbox* outMailbox,
return true;
}
-void DrawingBuffer::mailboxReleased(const blink::WebExternalTextureMailbox& mailbox)
+void DrawingBuffer::mailboxReleased(const blink::WebExternalTextureMailbox& mailbox, bool lostResource)
{
- if (m_destructionInProgress) {
+ if (m_destructionInProgress || m_context->isContextLost() || lostResource) {
Hongbo Min 2014/07/08 09:56:38 dshwang@, does it cover the cases you mentioned?
dshwang 2014/07/08 12:26:40 yes, it covers all. thanks.
mailboxReleasedWhileDestructionInProgress(mailbox);
return;
}
@@ -354,6 +354,7 @@ void DrawingBuffer::deleteMailbox(const blink::WebExternalTextureMailbox& mailbo
deleteChromiumImageForTexture(&m_textureMailboxes[i]->textureInfo);
m_context->deleteTexture(m_textureMailboxes[i]->textureInfo.textureId);
+ m_textureMailboxes[i]->m_parentDrawingBuffer.clear();
dshwang 2014/07/08 12:26:40 this line is not necessary. do you add it to clari
Hongbo Min 2014/07/08 14:19:35 It ensures the reference to DrawingBuffer is defin
dshwang 2014/07/08 15:07:05 It's not important part but I want to ask why? On
Hongbo Min 2014/07/09 01:43:09 Since each element in the list is ref-counted obje
m_textureMailboxes.remove(i);
return;
}

Powered by Google App Engine
This is Rietveld 408576698