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

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

Issue 2537003002: Fix Canvas2DLayerBridge IOSurface leak. (Closed)
Patch Set: Created 4 years, 1 month 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 | third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
index b73872525bc1c6019b688410e8ba7aff7273d0c7..99c10e624e1c9ab499ccfcb1f60068fb29f6e3ca 100644
--- a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
+++ b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
@@ -976,6 +976,16 @@ void Canvas2DLayerBridge::mailboxReleased(const gpu::Mailbox& mailbox,
DCHECK(releasedMailboxInfo != firstMailbox);
}
+#if USE_IOSURFACE_FOR_2D_CANVAS
+ if (releasedMailboxInfo->m_imageInfo && !lostResource) {
+ if (contextLost) {
+ deleteCHROMIUMImage(releasedMailboxInfo->m_imageInfo);
+ } else {
+ m_imageInfoCache.append(releasedMailboxInfo->m_imageInfo);
+ }
+ }
+#endif // USE_IOSURFACE_FOR_2D_CANVAS
+
if (!contextLost) {
// Invalidate texture state in case the compositor altered it since the
// copy-on-write.
@@ -1001,12 +1011,6 @@ void Canvas2DLayerBridge::mailboxReleased(const gpu::Mailbox& mailbox,
}
}
}
-
-#if USE_IOSURFACE_FOR_2D_CANVAS
- if (releasedMailboxInfo->m_imageInfo && !lostResource) {
- m_imageInfoCache.append(releasedMailboxInfo->m_imageInfo);
- }
-#endif // USE_IOSURFACE_FOR_2D_CANVAS
}
RefPtr<Canvas2DLayerBridge> selfRef;
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698