| Index: cc/CCPrioritizedTextureTest.cpp
|
| diff --git a/cc/CCPrioritizedTextureTest.cpp b/cc/CCPrioritizedTextureTest.cpp
|
| index 0594d6b5ed0a1d3b84c9fca4b90a5e8433efc212..1fec393381aca45f995896a1cd49bdf1aa4a6225 100644
|
| --- a/cc/CCPrioritizedTextureTest.cpp
|
| +++ b/cc/CCPrioritizedTextureTest.cpp
|
| @@ -12,6 +12,7 @@
|
| #include "CCTiledLayerTestCommon.h"
|
| #include "FakeCCGraphicsContext.h"
|
| #include <gtest/gtest.h>
|
| +#include <public/WebCompositor.h>
|
|
|
| using namespace WebCore;
|
| using namespace WebKitTests;
|
| @@ -26,14 +27,18 @@ public:
|
| , m_textureFormat(GraphicsContext3D::RGBA)
|
| , m_context(WebKit::createFakeCCGraphicsContext())
|
| {
|
| + WebKit::WebCompositor::initialize(0);
|
| DebugScopedSetImplThread implThread;
|
| m_resourceProvider = CCResourceProvider::create(m_context.get());
|
| }
|
|
|
| virtual ~CCPrioritizedTextureTest()
|
| {
|
| - DebugScopedSetImplThread implThread;
|
| - m_resourceProvider.clear();
|
| + {
|
| + DebugScopedSetImplThread implThread;
|
| + m_resourceProvider.clear();
|
| + }
|
| + WebKit::WebCompositor::shutdown();
|
| }
|
|
|
| size_t texturesMemorySize(size_t textureCount)
|
| @@ -48,12 +53,12 @@ public:
|
|
|
| bool validateTexture(OwnPtr<CCPrioritizedTexture>& texture, bool requestLate)
|
| {
|
| - DebugScopedSetImplThread implThread;
|
| #if !ASSERT_DISABLED
|
| texture->textureManager()->assertInvariants();
|
| #endif
|
| if (requestLate)
|
| texture->requestLate();
|
| + DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked;
|
| bool success = texture->canAcquireBackingTexture();
|
| if (success)
|
| texture->acquireBackingTexture(resourceProvider());
|
| @@ -108,7 +113,7 @@ TEST_F(CCPrioritizedTextureTest, requestTextureExceedingMaxLimit)
|
| EXPECT_EQ(texturesMemorySize(maxTextures), textureManager->memoryAboveCutoffBytes());
|
| EXPECT_LE(textureManager->memoryUseBytes(), textureManager->memoryAboveCutoffBytes());
|
|
|
| - DebugScopedSetImplThread implThread;
|
| + DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked;
|
| textureManager->clearAllMemory(resourceProvider());
|
| }
|
|
|
| @@ -129,7 +134,7 @@ TEST_F(CCPrioritizedTextureTest, changeMemoryLimits)
|
| for (size_t i = 0; i < maxTextures; ++i)
|
| validateTexture(textures[i], false);
|
| {
|
| - DebugScopedSetImplThread implThread;
|
| + DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked;
|
| textureManager->reduceMemory(resourceProvider());
|
| }
|
|
|
| @@ -142,7 +147,7 @@ TEST_F(CCPrioritizedTextureTest, changeMemoryLimits)
|
| for (size_t i = 0; i < maxTextures; ++i)
|
| EXPECT_EQ(validateTexture(textures[i], false), i < 5);
|
| {
|
| - DebugScopedSetImplThread implThread;
|
| + DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked;
|
| textureManager->reduceMemory(resourceProvider());
|
| }
|
|
|
| @@ -155,14 +160,14 @@ TEST_F(CCPrioritizedTextureTest, changeMemoryLimits)
|
| for (size_t i = 0; i < maxTextures; ++i)
|
| EXPECT_EQ(validateTexture(textures[i], false), i < 4);
|
| {
|
| - DebugScopedSetImplThread implThread;
|
| + DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked;
|
| textureManager->reduceMemory(resourceProvider());
|
| }
|
|
|
| EXPECT_EQ(texturesMemorySize(4), textureManager->memoryAboveCutoffBytes());
|
| EXPECT_LE(textureManager->memoryUseBytes(), textureManager->memoryAboveCutoffBytes());
|
|
|
| - DebugScopedSetImplThread implThread;
|
| + DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked;
|
| textureManager->clearAllMemory(resourceProvider());
|
| }
|
|
|
| @@ -222,7 +227,7 @@ TEST_F(CCPrioritizedTextureTest, textureManagerPartialUpdateTextures)
|
| EXPECT_FALSE(textures[2]->haveBackingTexture());
|
| EXPECT_FALSE(textures[3]->haveBackingTexture());
|
|
|
| - DebugScopedSetImplThread implThread;
|
| + DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked;
|
| textureManager->clearAllMemory(resourceProvider());
|
| }
|
|
|
| @@ -262,7 +267,7 @@ TEST_F(CCPrioritizedTextureTest, textureManagerPrioritiesAreEqual)
|
| EXPECT_EQ(texturesMemorySize(8), textureManager->memoryAboveCutoffBytes());
|
| EXPECT_LE(textureManager->memoryUseBytes(), textureManager->memoryAboveCutoffBytes());
|
|
|
| - DebugScopedSetImplThread implThread;
|
| + DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked;
|
| textureManager->clearAllMemory(resourceProvider());
|
| }
|
|
|
| @@ -282,7 +287,7 @@ TEST_F(CCPrioritizedTextureTest, textureManagerDestroyedFirst)
|
| EXPECT_TRUE(texture->haveBackingTexture());
|
|
|
| {
|
| - DebugScopedSetImplThread implThread;
|
| + DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked;
|
| textureManager->clearAllMemory(resourceProvider());
|
| }
|
| textureManager.clear();
|
| @@ -310,7 +315,7 @@ TEST_F(CCPrioritizedTextureTest, textureMovedToNewManager)
|
| texture->setTextureManager(0);
|
|
|
| {
|
| - DebugScopedSetImplThread implThread;
|
| + DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked;
|
| textureManagerOne->clearAllMemory(resourceProvider());
|
| }
|
| textureManagerOne.clear();
|
| @@ -326,7 +331,7 @@ TEST_F(CCPrioritizedTextureTest, textureMovedToNewManager)
|
| EXPECT_TRUE(texture->canAcquireBackingTexture());
|
| EXPECT_TRUE(texture->haveBackingTexture());
|
|
|
| - DebugScopedSetImplThread implThread;
|
| + DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked;
|
| textureManagerTwo->clearAllMemory(resourceProvider());
|
| }
|
|
|
| @@ -372,7 +377,7 @@ TEST_F(CCPrioritizedTextureTest, renderSurfacesReduceMemoryAvailableOutsideRootS
|
| EXPECT_EQ(texturesMemorySize(4), textureManager->memoryForSelfManagedTextures());
|
| EXPECT_LE(textureManager->memoryUseBytes(), textureManager->memoryAboveCutoffBytes());
|
|
|
| - DebugScopedSetImplThread implThread;
|
| + DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked;
|
| textureManager->clearAllMemory(resourceProvider());
|
| }
|
|
|
| @@ -409,7 +414,7 @@ TEST_F(CCPrioritizedTextureTest, renderSurfacesReduceMemoryAvailableForRequestLa
|
| EXPECT_EQ(texturesMemorySize(4), textureManager->memoryForSelfManagedTextures());
|
| EXPECT_LE(textureManager->memoryUseBytes(), textureManager->memoryAboveCutoffBytes());
|
|
|
| - DebugScopedSetImplThread implThread;
|
| + DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked;
|
| textureManager->clearAllMemory(resourceProvider());
|
| }
|
|
|
| @@ -449,7 +454,7 @@ TEST_F(CCPrioritizedTextureTest, whenRenderSurfaceNotAvailableTexturesAlsoNotAva
|
| EXPECT_EQ(texturesMemorySize(2), textureManager->memoryForSelfManagedTextures());
|
| EXPECT_LE(textureManager->memoryUseBytes(), textureManager->memoryAboveCutoffBytes());
|
|
|
| - DebugScopedSetImplThread implThread;
|
| + DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked;
|
| textureManager->clearAllMemory(resourceProvider());
|
| }
|
|
|
|
|