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

Unified Diff: Source/platform/graphics/Canvas2DLayerBridge.cpp

Issue 166193004: PrepareMailbox when all mailboxes have been returned (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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 | « Source/platform/graphics/Canvas2DLayerBridge.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/Canvas2DLayerBridge.cpp
diff --git a/Source/platform/graphics/Canvas2DLayerBridge.cpp b/Source/platform/graphics/Canvas2DLayerBridge.cpp
index 8a3f810532ede8abeac0d74831a239ff53d77922..638cd4b77ae78bf055967a8cad973ed1bed9847d 100644
--- a/Source/platform/graphics/Canvas2DLayerBridge.cpp
+++ b/Source/platform/graphics/Canvas2DLayerBridge.cpp
@@ -93,6 +93,7 @@ Canvas2DLayerBridge::Canvas2DLayerBridge(PassOwnPtr<blink::WebGraphicsContext3DP
, m_prev(0)
, m_lastImageId(0)
, m_releasedMailboxInfoIndex(InvalidMailboxIndex)
+ , m_activeMailboxCount(0)
{
ASSERT(m_canvas);
ASSERT(m_contextProvider);
@@ -369,6 +370,7 @@ bool Canvas2DLayerBridge::prepareMailbox(blink::WebExternalTextureMailbox* outMa
MailboxInfo* mailboxInfo = createMailboxInfo();
mailboxInfo->m_status = MailboxInUse;
mailboxInfo->m_image = image;
+ m_activeMailboxCount++;
// Because of texture sharing with the compositor, we must invalidate
// the state cached in skia so that the deferred copy on write
@@ -439,6 +441,9 @@ void Canvas2DLayerBridge::mailboxReleased(const blink::WebExternalTextureMailbox
mailboxInfo->m_mailbox.syncPoint = mailbox.syncPoint;
ASSERT(mailboxInfo->m_status == MailboxInUse);
mailboxInfo->m_status = MailboxReleased;
+ ASSERT(m_activeMailboxCount > 0);
+ if (!--m_activeMailboxCount)
+ m_lastImageId = 0;
// Trigger Canvas2DLayerBridge self-destruction if this is the
// last live mailbox and the layer bridge is not externally
// referenced.
« no previous file with comments | « Source/platform/graphics/Canvas2DLayerBridge.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698