diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-09-10 19:10:20 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-09-10 19:10:20 +0200 |
commit | 284837daa07b29d6a63a748544a90b1f5842ac5c (patch) | |
tree | ecd258180bde91fe741e0cfd2638beb3c6da7e8e /Source/WebKit/chromium/tests/CCPrioritizedTextureTest.cpp | |
parent | 2e2ba8ff45915f40ed3e014101269c175f2a89a0 (diff) | |
download | qtwebkit-284837daa07b29d6a63a748544a90b1f5842ac5c.tar.gz |
Imported WebKit commit 68645295d2e3e09af2c942f092556f06aa5f8b0d (http://svn.webkit.org/repository/webkit/trunk@128073)
New snapshot
Diffstat (limited to 'Source/WebKit/chromium/tests/CCPrioritizedTextureTest.cpp')
-rw-r--r-- | Source/WebKit/chromium/tests/CCPrioritizedTextureTest.cpp | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/Source/WebKit/chromium/tests/CCPrioritizedTextureTest.cpp b/Source/WebKit/chromium/tests/CCPrioritizedTextureTest.cpp index 4bcaccdc3..9076d34d4 100644 --- a/Source/WebKit/chromium/tests/CCPrioritizedTextureTest.cpp +++ b/Source/WebKit/chromium/tests/CCPrioritizedTextureTest.cpp @@ -31,6 +31,7 @@ #include "CCTexture.h" #include "CCTiledLayerTestCommon.h" #include "FakeCCGraphicsContext.h" +#include "WebCompositorInitializer.h" #include <gtest/gtest.h> using namespace WebCore; @@ -44,6 +45,7 @@ public: CCPrioritizedTextureTest() : m_textureSize(256, 256) , m_textureFormat(GraphicsContext3D::RGBA) + , m_compositorInitializer(0) , m_context(WebKit::createFakeCCGraphicsContext()) { DebugScopedSetImplThread implThread; @@ -68,12 +70,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()); @@ -88,6 +90,7 @@ public: protected: const IntSize m_textureSize; const GC3Denum m_textureFormat; + WebCompositorInitializer m_compositorInitializer; OwnPtr<CCGraphicsContext> m_context; OwnPtr<CCResourceProvider> m_resourceProvider; }; @@ -128,7 +131,7 @@ TEST_F(CCPrioritizedTextureTest, requestTextureExceedingMaxLimit) EXPECT_EQ(texturesMemorySize(maxTextures), textureManager->memoryAboveCutoffBytes()); EXPECT_LE(textureManager->memoryUseBytes(), textureManager->memoryAboveCutoffBytes()); - DebugScopedSetImplThread implThread; + DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked; textureManager->clearAllMemory(resourceProvider()); } @@ -149,7 +152,7 @@ TEST_F(CCPrioritizedTextureTest, changeMemoryLimits) for (size_t i = 0; i < maxTextures; ++i) validateTexture(textures[i], false); { - DebugScopedSetImplThread implThread; + DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked; textureManager->reduceMemory(resourceProvider()); } @@ -162,7 +165,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()); } @@ -175,14 +178,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()); } @@ -242,7 +245,7 @@ TEST_F(CCPrioritizedTextureTest, textureManagerPartialUpdateTextures) EXPECT_FALSE(textures[2]->haveBackingTexture()); EXPECT_FALSE(textures[3]->haveBackingTexture()); - DebugScopedSetImplThread implThread; + DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked; textureManager->clearAllMemory(resourceProvider()); } @@ -282,7 +285,7 @@ TEST_F(CCPrioritizedTextureTest, textureManagerPrioritiesAreEqual) EXPECT_EQ(texturesMemorySize(8), textureManager->memoryAboveCutoffBytes()); EXPECT_LE(textureManager->memoryUseBytes(), textureManager->memoryAboveCutoffBytes()); - DebugScopedSetImplThread implThread; + DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked; textureManager->clearAllMemory(resourceProvider()); } @@ -302,7 +305,7 @@ TEST_F(CCPrioritizedTextureTest, textureManagerDestroyedFirst) EXPECT_TRUE(texture->haveBackingTexture()); { - DebugScopedSetImplThread implThread; + DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked; textureManager->clearAllMemory(resourceProvider()); } textureManager.clear(); @@ -330,7 +333,7 @@ TEST_F(CCPrioritizedTextureTest, textureMovedToNewManager) texture->setTextureManager(0); { - DebugScopedSetImplThread implThread; + DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked; textureManagerOne->clearAllMemory(resourceProvider()); } textureManagerOne.clear(); @@ -346,7 +349,7 @@ TEST_F(CCPrioritizedTextureTest, textureMovedToNewManager) EXPECT_TRUE(texture->canAcquireBackingTexture()); EXPECT_TRUE(texture->haveBackingTexture()); - DebugScopedSetImplThread implThread; + DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked; textureManagerTwo->clearAllMemory(resourceProvider()); } @@ -392,7 +395,7 @@ TEST_F(CCPrioritizedTextureTest, renderSurfacesReduceMemoryAvailableOutsideRootS EXPECT_EQ(texturesMemorySize(4), textureManager->memoryForSelfManagedTextures()); EXPECT_LE(textureManager->memoryUseBytes(), textureManager->memoryAboveCutoffBytes()); - DebugScopedSetImplThread implThread; + DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked; textureManager->clearAllMemory(resourceProvider()); } @@ -429,7 +432,7 @@ TEST_F(CCPrioritizedTextureTest, renderSurfacesReduceMemoryAvailableForRequestLa EXPECT_EQ(texturesMemorySize(4), textureManager->memoryForSelfManagedTextures()); EXPECT_LE(textureManager->memoryUseBytes(), textureManager->memoryAboveCutoffBytes()); - DebugScopedSetImplThread implThread; + DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked; textureManager->clearAllMemory(resourceProvider()); } @@ -469,7 +472,7 @@ TEST_F(CCPrioritizedTextureTest, whenRenderSurfaceNotAvailableTexturesAlsoNotAva EXPECT_EQ(texturesMemorySize(2), textureManager->memoryForSelfManagedTextures()); EXPECT_LE(textureManager->memoryUseBytes(), textureManager->memoryAboveCutoffBytes()); - DebugScopedSetImplThread implThread; + DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked; textureManager->clearAllMemory(resourceProvider()); } |