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

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

Issue 2270533002: cc: Remove the software compositing bool from PrepareTextureMailbox (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@softwarerendering
Patch Set: remove-prepare-mailbox-param: bad-merge Created 4 years, 4 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: third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp
index 6dd2eec63a774857926c6a31c4bc2d225e17bddc..11713ec1b75c5d7cbd602d9c91f385ef5ae60192 100644
--- a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp
@@ -182,16 +182,23 @@ protected:
bridge->flush();
}
- void prepareMailboxSoftwareTest()
+ void prepareMailboxWhenContextIsLost()
{
FakeGLES2Interface gl;
std::unique_ptr<FakeWebGraphicsContext3DProvider> contextProvider = wrapUnique(new FakeWebGraphicsContext3DProvider(&gl));
Canvas2DLayerBridgePtr bridge(adoptRef(new Canvas2DLayerBridge(std::move(contextProvider), IntSize(300, 150), 0, NonOpaque, Canvas2DLayerBridge::ForceAccelerationForTesting)));
+ // TODO(junov): The PrepareTextureMailbox() method will fail a DCHECK if we don't
+ // do this before calling it the first time when the context is lost.
+ bridge->prepareSurfaceForPaintingIfNeeded();
+
+ // When the context is lost we are not sure if we should be producing GL frames for the
+ // compositor still or not, so fail to generate frames.
+ gl.setIsContextLost(true);
+
cc::TextureMailbox textureMailbox;
std::unique_ptr<cc::SingleReleaseCallback> releaseCallback;
- bool useSharedMemory = true;
- EXPECT_FALSE(bridge->PrepareTextureMailbox(&textureMailbox, &releaseCallback, useSharedMemory));
+ EXPECT_FALSE(bridge->PrepareTextureMailbox(&textureMailbox, &releaseCallback));
}
void prepareMailboxAndLoseResourceTest()
@@ -205,8 +212,7 @@ protected:
cc::TextureMailbox textureMailbox;
std::unique_ptr<cc::SingleReleaseCallback> releaseCallback;
- bool useSharedMemory = false;
- EXPECT_TRUE(bridge->PrepareTextureMailbox(&textureMailbox, &releaseCallback, useSharedMemory));
+ EXPECT_TRUE(bridge->PrepareTextureMailbox(&textureMailbox, &releaseCallback));
bool lostResource = true;
releaseCallback->Run(gpu::SyncToken(), lostResource);
@@ -219,11 +225,10 @@ protected:
cc::TextureMailbox textureMailbox;
std::unique_ptr<cc::SingleReleaseCallback> releaseCallback;
- bool useSharedMemory = false;
{
Canvas2DLayerBridgePtr bridge(adoptRef(new Canvas2DLayerBridge(std::move(contextProvider), IntSize(300, 150), 0, NonOpaque, Canvas2DLayerBridge::ForceAccelerationForTesting)));
- bridge->PrepareTextureMailbox(&textureMailbox, &releaseCallback, useSharedMemory);
+ bridge->PrepareTextureMailbox(&textureMailbox, &releaseCallback);
// |bridge| goes out of scope and would normally be destroyed, but object is kept alive by self references.
}
@@ -271,9 +276,9 @@ TEST_F(Canvas2DLayerBridgeTest, NoDrawOnContextLost)
noDrawOnContextLostTest();
}
-TEST_F(Canvas2DLayerBridgeTest, PrepareMailboxSoftware)
+TEST_F(Canvas2DLayerBridgeTest, PrepareMailboxWhenContextIsLost)
{
- prepareMailboxSoftwareTest();
+ prepareMailboxWhenContextIsLost();
}
TEST_F(Canvas2DLayerBridgeTest, PrepareMailboxAndLoseResource)
@@ -1005,8 +1010,7 @@ TEST_F(Canvas2DLayerBridgeTest, DISABLED_PrepareMailboxWhileHibernating)
// Test prepareMailbox while hibernating
cc::TextureMailbox textureMailbox;
std::unique_ptr<cc::SingleReleaseCallback> releaseCallback;
- bool useSharedMemory = false;
- EXPECT_FALSE(bridge->PrepareTextureMailbox(&textureMailbox, &releaseCallback, useSharedMemory));
+ EXPECT_FALSE(bridge->PrepareTextureMailbox(&textureMailbox, &releaseCallback));
EXPECT_TRUE(bridge->checkSurfaceValid());
// Tear down the bridge on the thread so that 'bridge' can go out of scope
@@ -1054,8 +1058,7 @@ TEST_F(Canvas2DLayerBridgeTest, DISABLED_PrepareMailboxWhileBackgroundRendering)
// Test prepareMailbox while background rendering
cc::TextureMailbox textureMailbox;
std::unique_ptr<cc::SingleReleaseCallback> releaseCallback;
- bool useSharedMemory = false;
- EXPECT_FALSE(bridge->PrepareTextureMailbox(&textureMailbox, &releaseCallback, useSharedMemory));
+ EXPECT_FALSE(bridge->PrepareTextureMailbox(&textureMailbox, &releaseCallback));
EXPECT_TRUE(bridge->checkSurfaceValid());
// Tear down the bridge on the thread so that 'bridge' can go out of scope

Powered by Google App Engine
This is Rietveld 408576698