| 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.
|
|
|