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

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

Issue 251023004: WebGL: Free temporary GPU resources held by inactive or hidden WebGL. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use ASSERT instead of 'if' in prepareMailbox() 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/DrawingBufferTest.cpp
diff --git a/Source/platform/graphics/gpu/DrawingBufferTest.cpp b/Source/platform/graphics/gpu/DrawingBufferTest.cpp
index 767fcfdbff1c091bbb348c01d841da384e902627..c9195fac582fc5b234c889d540b0916711a54394 100644
--- a/Source/platform/graphics/gpu/DrawingBufferTest.cpp
+++ b/Source/platform/graphics/gpu/DrawingBufferTest.cpp
@@ -620,4 +620,22 @@ TEST(DrawingBufferDepthStencilTest, packedDepthStencilSupported)
}
}
+TEST_F(DrawingBufferTest, verifySetIsHiddenProperlyAffectsMailboxes)
+{
+ blink::WebExternalTextureMailbox mailbox;
+
+ // Produce mailboxes.
+ m_drawingBuffer->markContentsChanged();
+ EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0));
+
+ unsigned waitSyncPoint = webContext()->insertSyncPoint();
+ mailbox.syncPoint = waitSyncPoint;
+ m_drawingBuffer->setIsHidden(true);
+ m_drawingBuffer->mailboxReleased(mailbox);
+ // m_drawingBuffer deletes mailbox immediately when hidden.
+ EXPECT_EQ(waitSyncPoint, webContext()->mostRecentlyWaitedSyncPoint());
+
dshwang 2014/07/09 17:40:54 Remove EXPECT_FALSE(m_drawingBuffer->prepareMailbo
+ m_drawingBuffer->beginDestruction();
+}
+
} // namespace

Powered by Google App Engine
This is Rietveld 408576698