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

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

Issue 2542033003: [Merge to 2924] Fix Canvas2DLayerBridge IOSurface leak. (Closed)
Patch Set: Created 4 years 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 82a8999a88a1cc5b4537877d62168eec5ed54379..04741f1fe548096223521d797babe52d1abb9f48 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