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

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

Issue 369043003: Let canvas decide how to handle the case of resource lost reported by client: 2D part (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: delete mailbox for lostResource 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..76db56bd6d5bb848215ff6fd66a31d19ae9f4c2c 100644
--- a/Source/platform/graphics/gpu/DrawingBufferTest.cpp
+++ b/Source/platform/graphics/gpu/DrawingBufferTest.cpp
@@ -252,7 +252,7 @@ TEST_F(DrawingBufferTest, verifyResizingProperlyAffectsMailboxes)
// Resize to 100x50.
m_drawingBuffer->reset(IntSize(initialWidth, alternateHeight));
- m_drawingBuffer->mailboxReleased(mailbox);
+ m_drawingBuffer->mailboxReleased(mailbox, false);
// Produce a mailbox at this size.
m_drawingBuffer->markContentsChanged();
@@ -261,7 +261,7 @@ TEST_F(DrawingBufferTest, verifyResizingProperlyAffectsMailboxes)
// Reset to initial size.
m_drawingBuffer->reset(IntSize(initialWidth, initialHeight));
- m_drawingBuffer->mailboxReleased(mailbox);
+ m_drawingBuffer->mailboxReleased(mailbox, false);
// Prepare another mailbox and verify that it's the correct size.
m_drawingBuffer->markContentsChanged();
@@ -269,7 +269,7 @@ TEST_F(DrawingBufferTest, verifyResizingProperlyAffectsMailboxes)
EXPECT_EQ(initialSize, webContext()->mostRecentlyProducedSize());
// Prepare one final mailbox and verify that it's the correct size.
- m_drawingBuffer->mailboxReleased(mailbox);
+ m_drawingBuffer->mailboxReleased(mailbox, false);
m_drawingBuffer->markContentsChanged();
EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0));
EXPECT_EQ(initialSize, webContext()->mostRecentlyProducedSize());
@@ -296,7 +296,7 @@ TEST_F(DrawingBufferTest, verifyDestructionCompleteAfterAllMailboxesReleased)
EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox3, 0));
m_drawingBuffer->markContentsChanged();
- m_drawingBuffer->mailboxReleased(mailbox1);
+ m_drawingBuffer->mailboxReleased(mailbox1, false);
m_drawingBuffer->beginDestruction();
EXPECT_EQ(live, true);
@@ -306,11 +306,11 @@ TEST_F(DrawingBufferTest, verifyDestructionCompleteAfterAllMailboxesReleased)
EXPECT_EQ(live, true);
weakPointer->markContentsChanged();
- weakPointer->mailboxReleased(mailbox2);
+ weakPointer->mailboxReleased(mailbox2, false);
EXPECT_EQ(live, true);
weakPointer->markContentsChanged();
- weakPointer->mailboxReleased(mailbox3);
+ weakPointer->mailboxReleased(mailbox3, false);
EXPECT_EQ(live, false);
}
@@ -345,11 +345,11 @@ TEST_F(DrawingBufferTest, verifyRecyclingMailboxesByFIFO)
// Release mailboxes by specific order; 2, 3, 1.
m_drawingBuffer->markContentsChanged();
- m_drawingBuffer->mailboxReleased(mailbox2);
+ m_drawingBuffer->mailboxReleased(mailbox2, false);
m_drawingBuffer->markContentsChanged();
- m_drawingBuffer->mailboxReleased(mailbox3);
+ m_drawingBuffer->mailboxReleased(mailbox3, false);
m_drawingBuffer->markContentsChanged();
- m_drawingBuffer->mailboxReleased(mailbox1);
+ m_drawingBuffer->mailboxReleased(mailbox1, false);
// The first recycled mailbox must be 2.
blink::WebExternalTextureMailbox recycledMailbox;
@@ -367,9 +367,9 @@ TEST_F(DrawingBufferTest, verifyRecyclingMailboxesByFIFO)
EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&recycledMailbox, 0));
EXPECT_EQ(TextureMailboxWrapper(mailbox1), TextureMailboxWrapper(recycledMailbox));
- m_drawingBuffer->mailboxReleased(mailbox1);
- m_drawingBuffer->mailboxReleased(mailbox2);
- m_drawingBuffer->mailboxReleased(mailbox3);
+ m_drawingBuffer->mailboxReleased(mailbox1, false);
+ m_drawingBuffer->mailboxReleased(mailbox2, false);
+ m_drawingBuffer->mailboxReleased(mailbox3, false);
m_drawingBuffer->beginDestruction();
}
@@ -386,7 +386,7 @@ TEST_F(DrawingBufferTest, verifyInsertAndWaitSyncPointCorrectly)
unsigned waitSyncPoint = webContext()->insertSyncPoint();
mailbox.syncPoint = waitSyncPoint;
- m_drawingBuffer->mailboxReleased(mailbox);
+ m_drawingBuffer->mailboxReleased(mailbox, false);
// m_drawingBuffer will wait for the sync point when recycling.
EXPECT_EQ(0u, webContext()->mostRecentlyWaitedSyncPoint());
@@ -398,7 +398,7 @@ TEST_F(DrawingBufferTest, verifyInsertAndWaitSyncPointCorrectly)
m_drawingBuffer->beginDestruction();
waitSyncPoint = webContext()->insertSyncPoint();
mailbox.syncPoint = waitSyncPoint;
- m_drawingBuffer->mailboxReleased(mailbox);
+ m_drawingBuffer->mailboxReleased(mailbox, false);
// m_drawingBuffer waits for the sync point because the destruction is in progress.
EXPECT_EQ(waitSyncPoint, webContext()->mostRecentlyWaitedSyncPoint());
}
@@ -447,7 +447,7 @@ TEST_F(DrawingBufferImageChromiumTest, verifyResizingReallocatesImages)
EXPECT_CALL(*webContext(), releaseTexImage2DMock(m_imageId0)).Times(1);
// Resize to 100x50.
m_drawingBuffer->reset(IntSize(initialWidth, alternateHeight));
- m_drawingBuffer->mailboxReleased(mailbox);
+ m_drawingBuffer->mailboxReleased(mailbox, false);
testing::Mock::VerifyAndClearExpectations(webContext());
WGC3Duint m_imageId3 = webContext()->nextImageIdToBeCreated();
@@ -467,7 +467,7 @@ TEST_F(DrawingBufferImageChromiumTest, verifyResizingReallocatesImages)
EXPECT_CALL(*webContext(), releaseTexImage2DMock(m_imageId2)).Times(1);
// Reset to initial size.
m_drawingBuffer->reset(IntSize(initialWidth, initialHeight));
- m_drawingBuffer->mailboxReleased(mailbox);
+ m_drawingBuffer->mailboxReleased(mailbox, false);
testing::Mock::VerifyAndClearExpectations(webContext());
WGC3Duint m_imageId5 = webContext()->nextImageIdToBeCreated();
@@ -482,12 +482,12 @@ TEST_F(DrawingBufferImageChromiumTest, verifyResizingReallocatesImages)
testing::Mock::VerifyAndClearExpectations(webContext());
// Prepare one final mailbox and verify that it's the correct size.
- m_drawingBuffer->mailboxReleased(mailbox);
+ m_drawingBuffer->mailboxReleased(mailbox, false);
m_drawingBuffer->markContentsChanged();
EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0));
EXPECT_EQ(initialSize, webContext()->mostRecentlyProducedSize());
EXPECT_TRUE(mailbox.allowOverlay);
- m_drawingBuffer->mailboxReleased(mailbox);
+ m_drawingBuffer->mailboxReleased(mailbox, false);
EXPECT_CALL(*webContext(), destroyImageMock(m_imageId5)).Times(1);
EXPECT_CALL(*webContext(), releaseTexImage2DMock(m_imageId5)).Times(1);

Powered by Google App Engine
This is Rietveld 408576698