diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-26 12:44:52 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-26 12:44:52 +0000 |
commit | 40f84269ce9163b37845e65f9d8d765f97804a28 (patch) | |
tree | eacb8d5c0b394d352f71c59deab393c50d8251d5 /cc/resources | |
parent | 4612b236c0c4d6f6c4f77e53a4967885ff3ebc2b (diff) | |
download | chromium_src-40f84269ce9163b37845e65f9d8d765f97804a28.zip chromium_src-40f84269ce9163b37845e65f9d8d765f97804a28.tar.gz chromium_src-40f84269ce9163b37845e65f9d8d765f97804a28.tar.bz2 |
cc: Sort backings in the parent compositor to the back of the list.
Backings in the parent should not be preferred for eviction since
deleting them in the renderer won't actually free any memory. So sort
them to the back of the backings list, so they are evicted last.
Also mark them as not CanBeRecycled() so that they will not be evicted
at all if we are only evicting recyclable stuff.
Tests:
PrioritizedResourceTest.NotEvictingTexturesInParent
R=ccameron@chromium.org, jbauman@chromium.org
BUG=292971
Review URL: https://codereview.chromium.org/42483002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231202 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/resources')
-rw-r--r-- | cc/resources/prioritized_resource.cc | 8 | ||||
-rw-r--r-- | cc/resources/prioritized_resource.h | 5 | ||||
-rw-r--r-- | cc/resources/prioritized_resource_manager.cc | 8 | ||||
-rw-r--r-- | cc/resources/prioritized_resource_manager.h | 6 | ||||
-rw-r--r-- | cc/resources/prioritized_resource_unittest.cc | 222 |
5 files changed, 206 insertions, 43 deletions
diff --git a/cc/resources/prioritized_resource.cc b/cc/resources/prioritized_resource.cc index 313b275..72a867d 100644 --- a/cc/resources/prioritized_resource.cc +++ b/cc/resources/prioritized_resource.cc @@ -124,6 +124,7 @@ PrioritizedResource::Backing::Backing(unsigned id, priority_at_last_priority_update_(PriorityCalculator::LowestPriority()), was_above_priority_cutoff_at_last_priority_update_(false), in_drawing_impl_tree_(false), + in_parent_compositor_(false), #ifdef NDEBUG resource_has_been_deleted_(false) {} #else @@ -157,7 +158,7 @@ bool PrioritizedResource::Backing::ResourceHasBeenDeleted() const { bool PrioritizedResource::Backing::CanBeRecycled() const { DCHECK(!proxy() || proxy()->IsImplThread()); return !was_above_priority_cutoff_at_last_priority_update_ && - !in_drawing_impl_tree_; + !in_drawing_impl_tree_ && !in_parent_compositor_; } void PrioritizedResource::Backing::UpdatePriority() { @@ -173,10 +174,13 @@ void PrioritizedResource::Backing::UpdatePriority() { } } -void PrioritizedResource::Backing::UpdateInDrawingImplTree() { +void PrioritizedResource::Backing::UpdateState( + ResourceProvider* resource_provider) { DCHECK(!proxy() || (proxy()->IsImplThread() && proxy()->IsMainThreadBlocked())); in_drawing_impl_tree_ = !!owner(); + in_parent_compositor_ = resource_provider->InUseByConsumer(id()) && + !resource_provider->IsLost(id()); if (!in_drawing_impl_tree_) { DCHECK_EQ(priority_at_last_priority_update_, PriorityCalculator::LowestPriority()); diff --git a/cc/resources/prioritized_resource.h b/cc/resources/prioritized_resource.h index a3d5d89..bdd906d 100644 --- a/cc/resources/prioritized_resource.h +++ b/cc/resources/prioritized_resource.h @@ -111,7 +111,7 @@ class CC_EXPORT PrioritizedResource { ResourceFormat format); ~Backing(); void UpdatePriority(); - void UpdateInDrawingImplTree(); + void UpdateState(ResourceProvider* resource_provider); PrioritizedResource* owner() { return owner_; } bool CanBeRecycled() const; @@ -122,6 +122,7 @@ class CC_EXPORT PrioritizedResource { return was_above_priority_cutoff_at_last_priority_update_; } bool in_drawing_impl_tree() const { return in_drawing_impl_tree_; } + bool in_parent_compositor() const { return in_parent_compositor_; } void DeleteResource(ResourceProvider* resource_provider); bool ResourceHasBeenDeleted() const; @@ -137,6 +138,8 @@ class CC_EXPORT PrioritizedResource { // Set if this is currently-drawing impl tree. bool in_drawing_impl_tree_; + // Set if this is in the parent compositor. + bool in_parent_compositor_; bool resource_has_been_deleted_; diff --git a/cc/resources/prioritized_resource_manager.cc b/cc/resources/prioritized_resource_manager.cc index 6c7682b..ece04b1 100644 --- a/cc/resources/prioritized_resource_manager.cc +++ b/cc/resources/prioritized_resource_manager.cc @@ -160,7 +160,8 @@ void PrioritizedResourceManager::PushTexturePrioritiesToBackings() { memory_visible_and_nearby_bytes_; } -void PrioritizedResourceManager::UpdateBackingsInDrawingImplTree() { +void PrioritizedResourceManager::UpdateBackingsState( + ResourceProvider* resource_provider) { TRACE_EVENT0("cc", "PrioritizedResourceManager::UpdateBackingsInDrawingImplTree"); DCHECK(proxy_->IsImplThread() && proxy_->IsMainThreadBlocked()); @@ -169,7 +170,7 @@ void PrioritizedResourceManager::UpdateBackingsInDrawingImplTree() { for (BackingList::iterator it = backings_.begin(); it != backings_.end(); ++it) { PrioritizedResource::Backing* backing = (*it); - backing->UpdateInDrawingImplTree(); + backing->UpdateState(resource_provider); } SortBackings(); AssertInvariants(); @@ -320,8 +321,7 @@ void PrioritizedResourceManager::ReduceWastedMemory( ++it) { if ((*it)->owner()) break; - if (resource_provider->InUseByConsumer((*it)->id()) && - !resource_provider->IsLost((*it)->id())) + if ((*it)->in_parent_compositor()) continue; wasted_memory += (*it)->bytes(); } diff --git a/cc/resources/prioritized_resource_manager.h b/cc/resources/prioritized_resource_manager.h index 48b73c4..8a7c275 100644 --- a/cc/resources/prioritized_resource_manager.h +++ b/cc/resources/prioritized_resource_manager.h @@ -125,7 +125,7 @@ class CC_EXPORT PrioritizedResourceManager { void PushTexturePrioritiesToBackings(); // Mark all textures' backings as being in the drawing impl tree. - void UpdateBackingsInDrawingImplTree(); + void UpdateBackingsState(ResourceProvider* resource_provider); const Proxy* ProxyForDebug() const; @@ -155,6 +155,10 @@ class CC_EXPORT PrioritizedResourceManager { // Make textures that can be recycled appear first if (a->CanBeRecycled() != b->CanBeRecycled()) return (a->CanBeRecycled() > b->CanBeRecycled()); + // Put textures in the parent compositor last since they can't be + // freed when they are evicted anyhow. + if (a->in_parent_compositor() != b->in_parent_compositor()) + return (a->in_parent_compositor() < b->in_parent_compositor()); // Then sort by being above or below the priority cutoff. if (a->was_above_priority_cutoff_at_last_priority_update() != b->was_above_priority_cutoff_at_last_priority_update()) diff --git a/cc/resources/prioritized_resource_unittest.cc b/cc/resources/prioritized_resource_unittest.cc index 21cafd1..82178c2 100644 --- a/cc/resources/prioritized_resource_unittest.cc +++ b/cc/resources/prioritized_resource_unittest.cc @@ -4,6 +4,8 @@ #include "cc/resources/prioritized_resource.h" +#include <vector> + #include "cc/resources/prioritized_resource_manager.h" #include "cc/resources/resource.h" #include "cc/test/fake_output_surface.h" @@ -24,7 +26,7 @@ class PrioritizedResourceTest : public testing::Test { DebugScopedSetImplThread impl_thread(&proxy_); CHECK(output_surface_->BindToClient(&output_surface_client_)); resource_provider_ = - cc::ResourceProvider::Create(output_surface_.get(), NULL, 0, false); + ResourceProvider::Create(output_surface_.get(), NULL, 0, false); } virtual ~PrioritizedResourceTest() { @@ -51,7 +53,7 @@ class PrioritizedResourceTest : public testing::Test { texture->RequestLate(); ResourceManagerAssertInvariants(texture->resource_manager()); DebugScopedSetImplThreadAndMainThreadBlocked - impl_thread_and_main_thread_blocked(&proxy_); + impl_thread_and_main_thread_blocked(&proxy_); bool success = texture->can_acquire_backing_texture(); if (success) texture->AcquireBackingTexture(ResourceProvider()); @@ -67,7 +69,7 @@ class PrioritizedResourceTest : public testing::Test { void ResourceManagerUpdateBackingsPriorities( PrioritizedResourceManager* resource_manager) { DebugScopedSetImplThreadAndMainThreadBlocked - impl_thread_and_main_thread_blocked(&proxy_); + impl_thread_and_main_thread_blocked(&proxy_); resource_manager->PushTexturePrioritiesToBackings(); } @@ -77,7 +79,7 @@ class PrioritizedResourceTest : public testing::Test { PrioritizedResourceManager* resource_manager) { #ifndef NDEBUG DebugScopedSetImplThreadAndMainThreadBlocked - impl_thread_and_main_thread_blocked(&proxy_); + impl_thread_and_main_thread_blocked(&proxy_); resource_manager->AssertInvariants(); #endif } @@ -91,12 +93,23 @@ class PrioritizedResourceTest : public testing::Test { return resource_manager->evicted_backings_.size(); } + std::vector<unsigned> BackingResources( + PrioritizedResourceManager* resource_manager) { + std::vector<unsigned> resources; + for (PrioritizedResourceManager::BackingList::iterator it = + resource_manager->backings_.begin(); + it != resource_manager->backings_.end(); + ++it) + resources.push_back((*it)->id()); + return resources; + } + protected: FakeProxy proxy_; const gfx::Size texture_size_; const ResourceFormat texture_format_; FakeOutputSurfaceClient output_surface_client_; - scoped_ptr<OutputSurface> output_surface_; + scoped_ptr<cc::OutputSurface> output_surface_; scoped_ptr<cc::ResourceProvider> resource_provider_; }; @@ -144,7 +157,7 @@ TEST_F(PrioritizedResourceTest, RequestTextureExceedingMaxLimit) { resource_manager->MaxMemoryNeededBytes()); DebugScopedSetImplThreadAndMainThreadBlocked - impl_thread_and_main_thread_blocked(&proxy_); + impl_thread_and_main_thread_blocked(&proxy_); resource_manager->ClearAllMemory(ResourceProvider()); } @@ -168,7 +181,7 @@ TEST_F(PrioritizedResourceTest, ChangeMemoryLimits) { ValidateTexture(textures[i].get(), false); { DebugScopedSetImplThreadAndMainThreadBlocked - impl_thread_and_main_thread_blocked(&proxy_); + impl_thread_and_main_thread_blocked(&proxy_); resource_manager->ReduceMemory(ResourceProvider()); } @@ -183,7 +196,7 @@ TEST_F(PrioritizedResourceTest, ChangeMemoryLimits) { EXPECT_EQ(ValidateTexture(textures[i].get(), false), i < 5); { DebugScopedSetImplThreadAndMainThreadBlocked - impl_thread_and_main_thread_blocked(&proxy_); + impl_thread_and_main_thread_blocked(&proxy_); resource_manager->ReduceMemory(ResourceProvider()); } @@ -200,7 +213,7 @@ TEST_F(PrioritizedResourceTest, ChangeMemoryLimits) { EXPECT_EQ(ValidateTexture(textures[i].get(), false), i < 4); { DebugScopedSetImplThreadAndMainThreadBlocked - impl_thread_and_main_thread_blocked(&proxy_); + impl_thread_and_main_thread_blocked(&proxy_); resource_manager->ReduceMemory(ResourceProvider()); } @@ -211,7 +224,7 @@ TEST_F(PrioritizedResourceTest, ChangeMemoryLimits) { resource_manager->MaxMemoryNeededBytes()); DebugScopedSetImplThreadAndMainThreadBlocked - impl_thread_and_main_thread_blocked(&proxy_); + impl_thread_and_main_thread_blocked(&proxy_); resource_manager->ClearAllMemory(ResourceProvider()); } @@ -249,7 +262,7 @@ TEST_F(PrioritizedResourceTest, ReduceWastedMemory) { } { DebugScopedSetImplThreadAndMainThreadBlocked - impl_thread_and_main_thread_blocked(&proxy_); + impl_thread_and_main_thread_blocked(&proxy_); resource_manager->ReduceMemory(ResourceProvider()); } @@ -261,7 +274,8 @@ TEST_F(PrioritizedResourceTest, ReduceWastedMemory) { PrioritizeTexturesAndBackings(resource_manager.get()); { DebugScopedSetImplThreadAndMainThreadBlocked - impl_thread_and_main_thread_blocked(&proxy_); + impl_thread_and_main_thread_blocked(&proxy_); + resource_manager->UpdateBackingsState(ResourceProvider()); resource_manager->ReduceWastedMemory(ResourceProvider()); } EXPECT_EQ(TexturesMemorySize(20), resource_manager->MemoryUseBytes()); @@ -273,13 +287,14 @@ TEST_F(PrioritizedResourceTest, ReduceWastedMemory) { PrioritizeTexturesAndBackings(resource_manager.get()); { DebugScopedSetImplThreadAndMainThreadBlocked - impl_thread_and_main_thread_blocked(&proxy_); + impl_thread_and_main_thread_blocked(&proxy_); + resource_manager->UpdateBackingsState(ResourceProvider()); resource_manager->ReduceWastedMemory(ResourceProvider()); } EXPECT_GT(TexturesMemorySize(20), resource_manager->MemoryUseBytes()); DebugScopedSetImplThreadAndMainThreadBlocked - impl_thread_and_main_thread_blocked(&proxy_); + impl_thread_and_main_thread_blocked(&proxy_); resource_manager->ClearAllMemory(ResourceProvider()); } @@ -339,7 +354,8 @@ TEST_F(PrioritizedResourceTest, InUseNotWastedMemory) { PrioritizeTexturesAndBackings(resource_manager.get()); { DebugScopedSetImplThreadAndMainThreadBlocked - impl_thread_and_main_thread_blocked(&proxy_); + impl_thread_and_main_thread_blocked(&proxy_); + resource_manager->UpdateBackingsState(ResourceProvider()); resource_manager->ReduceWastedMemory(ResourceProvider()); } EXPECT_EQ(TexturesMemorySize(20), resource_manager->MemoryUseBytes()); @@ -351,13 +367,14 @@ TEST_F(PrioritizedResourceTest, InUseNotWastedMemory) { resource_provider_->ReceiveReturnsFromParent(returns); { DebugScopedSetImplThreadAndMainThreadBlocked - impl_thread_and_main_thread_blocked(&proxy_); + impl_thread_and_main_thread_blocked(&proxy_); + resource_manager->UpdateBackingsState(ResourceProvider()); resource_manager->ReduceWastedMemory(ResourceProvider()); } EXPECT_GT(TexturesMemorySize(20), resource_manager->MemoryUseBytes()); DebugScopedSetImplThreadAndMainThreadBlocked - impl_thread_and_main_thread_blocked(&proxy_); + impl_thread_and_main_thread_blocked(&proxy_); resource_manager->ClearAllMemory(ResourceProvider()); } @@ -384,7 +401,7 @@ TEST_F(PrioritizedResourceTest, ChangePriorityCutoff) { EXPECT_EQ(ValidateTexture(textures[i].get(), true), i < 6); { DebugScopedSetImplThreadAndMainThreadBlocked - impl_thread_and_main_thread_blocked(&proxy_); + impl_thread_and_main_thread_blocked(&proxy_); resource_manager->ReduceMemory(ResourceProvider()); } EXPECT_EQ(TexturesMemorySize(6), resource_manager->MemoryAboveCutoffBytes()); @@ -398,17 +415,16 @@ TEST_F(PrioritizedResourceTest, ChangePriorityCutoff) { EXPECT_EQ(ValidateTexture(textures[i].get(), false), i < 4); { DebugScopedSetImplThreadAndMainThreadBlocked - impl_thread_and_main_thread_blocked(&proxy_); + impl_thread_and_main_thread_blocked(&proxy_); resource_manager->ReduceMemory(ResourceProvider()); } EXPECT_EQ(TexturesMemorySize(4), resource_manager->MemoryAboveCutoffBytes()); // Do a one-time eviction for one more texture based on priority cutoff - PrioritizedResourceManager::BackingList evicted_backings; resource_manager->UnlinkAndClearEvictedBackings(); { DebugScopedSetImplThreadAndMainThreadBlocked - impl_thread_and_main_thread_blocked(&proxy_); + impl_thread_and_main_thread_blocked(&proxy_); resource_manager->ReduceMemoryOnImplThread( TexturesMemorySize(8), 104, ResourceProvider()); EXPECT_EQ(0u, EvictedBackingCount(resource_manager.get())); @@ -425,13 +441,149 @@ TEST_F(PrioritizedResourceTest, ChangePriorityCutoff) { EXPECT_EQ(ValidateTexture(textures[i].get(), false), i < 4); { DebugScopedSetImplThreadAndMainThreadBlocked - impl_thread_and_main_thread_blocked(&proxy_); + impl_thread_and_main_thread_blocked(&proxy_); resource_manager->ReduceMemory(ResourceProvider()); } EXPECT_EQ(TexturesMemorySize(4), resource_manager->MemoryAboveCutoffBytes()); DebugScopedSetImplThreadAndMainThreadBlocked - impl_thread_and_main_thread_blocked(&proxy_); + impl_thread_and_main_thread_blocked(&proxy_); + resource_manager->ClearAllMemory(ResourceProvider()); +} + +TEST_F(PrioritizedResourceTest, NotEvictingTexturesInParent) { + const size_t kMaxTextures = 8; + scoped_ptr<PrioritizedResourceManager> resource_manager = + CreateManager(kMaxTextures); + scoped_ptr<PrioritizedResource> textures[kMaxTextures]; + unsigned texture_resource_ids[kMaxTextures]; + + for (size_t i = 0; i < kMaxTextures; ++i) { + textures[i] = + resource_manager->CreateTexture(texture_size_, texture_format_); + textures[i]->set_request_priority(100 + i); + } + + PrioritizeTexturesAndBackings(resource_manager.get()); + for (size_t i = 0; i < kMaxTextures; ++i) { + EXPECT_TRUE(ValidateTexture(textures[i].get(), true)); + + { + DebugScopedSetImplThreadAndMainThreadBlocked + impl_thread_and_main_thread_blocked(&proxy_); + uint8_t image[4] = {0}; + textures[i]->SetPixels(resource_provider_.get(), + image, + gfx::Rect(1, 1), + gfx::Rect(1, 1), + gfx::Vector2d()); + } + } + { + DebugScopedSetImplThreadAndMainThreadBlocked + impl_thread_and_main_thread_blocked(&proxy_); + resource_manager->ReduceMemory(ResourceProvider()); + } + EXPECT_EQ(TexturesMemorySize(8), resource_manager->MemoryAboveCutoffBytes()); + + for (size_t i = 0; i < 8; ++i) + texture_resource_ids[i] = textures[i]->resource_id(); + + // Evict four textures. It will be the last four. + { + DebugScopedSetImplThreadAndMainThreadBlocked + impl_thread_and_main_thread_blocked(&proxy_); + resource_manager->ReduceMemoryOnImplThread( + TexturesMemorySize(4), 200, ResourceProvider()); + + EXPECT_EQ(4u, EvictedBackingCount(resource_manager.get())); + + // The last four backings are evicted. + std::vector<unsigned> remaining = BackingResources(resource_manager.get()); + EXPECT_TRUE(std::find(remaining.begin(), + remaining.end(), + texture_resource_ids[0]) != remaining.end()); + EXPECT_TRUE(std::find(remaining.begin(), + remaining.end(), + texture_resource_ids[1]) != remaining.end()); + EXPECT_TRUE(std::find(remaining.begin(), + remaining.end(), + texture_resource_ids[2]) != remaining.end()); + EXPECT_TRUE(std::find(remaining.begin(), + remaining.end(), + texture_resource_ids[3]) != remaining.end()); + } + resource_manager->UnlinkAndClearEvictedBackings(); + EXPECT_EQ(TexturesMemorySize(4), resource_manager->MemoryUseBytes()); + + // Re-allocate the the texture after the eviction. + PrioritizeTexturesAndBackings(resource_manager.get()); + for (size_t i = 0; i < kMaxTextures; ++i) { + EXPECT_TRUE(ValidateTexture(textures[i].get(), true)); + + { + DebugScopedSetImplThreadAndMainThreadBlocked + impl_thread_and_main_thread_blocked(&proxy_); + uint8_t image[4] = {0}; + textures[i]->SetPixels(resource_provider_.get(), + image, + gfx::Rect(1, 1), + gfx::Rect(1, 1), + gfx::Vector2d()); + } + } + { + DebugScopedSetImplThreadAndMainThreadBlocked + impl_thread_and_main_thread_blocked(&proxy_); + resource_manager->ReduceMemory(ResourceProvider()); + } + EXPECT_EQ(TexturesMemorySize(8), resource_manager->MemoryAboveCutoffBytes()); + + // Send the last two of the textures to a parent compositor. + ResourceProvider::ResourceIdArray to_send; + TransferableResourceArray transferable; + for (size_t i = 6; i < 8; ++i) + to_send.push_back(textures[i]->resource_id()); + resource_provider_->PrepareSendToParent(to_send, &transferable); + + for (size_t i = 0; i < 8; ++i) + texture_resource_ids[i] = textures[i]->resource_id(); + + // Drop all the textures. Now we have backings that can be recycled. + for (size_t i = 0; i < 8; ++i) + textures[0].reset(); + PrioritizeTexturesAndBackings(resource_manager.get()); + + // The next commit finishes. + { + DebugScopedSetImplThreadAndMainThreadBlocked + impl_thread_and_main_thread_blocked(&proxy_); + resource_manager->UpdateBackingsState(ResourceProvider()); + } + + // Evict four textures. It would be the last four again, except that 2 of them + // are sent to the parent, so they are evicted last. + { + DebugScopedSetImplThreadAndMainThreadBlocked + impl_thread_and_main_thread_blocked(&proxy_); + resource_manager->ReduceMemoryOnImplThread( + TexturesMemorySize(4), 200, ResourceProvider()); + + EXPECT_EQ(4u, EvictedBackingCount(resource_manager.get())); + // The last 2 backings remain this time. + std::vector<unsigned> remaining = BackingResources(resource_manager.get()); + EXPECT_TRUE(std::find(remaining.begin(), + remaining.end(), + texture_resource_ids[6]) != remaining.end()); + EXPECT_TRUE(std::find(remaining.begin(), + remaining.end(), + texture_resource_ids[7]) != remaining.end()); + } + resource_manager->UnlinkAndClearEvictedBackings(); + EXPECT_EQ(TexturesMemorySize(4), resource_manager->MemoryUseBytes()); + + DebugScopedSetImplThreadAndMainThreadBlocked + impl_thread_and_main_thread_blocked(&proxy_); resource_manager->ClearAllMemory(ResourceProvider()); } @@ -494,7 +646,7 @@ TEST_F(PrioritizedResourceTest, ResourceManagerPartialUpdateTextures) { EXPECT_FALSE(textures[3]->have_backing_texture()); DebugScopedSetImplThreadAndMainThreadBlocked - impl_thread_and_main_thread_blocked(&proxy_); + impl_thread_and_main_thread_blocked(&proxy_); resource_manager->ClearAllMemory(ResourceProvider()); } @@ -539,7 +691,7 @@ TEST_F(PrioritizedResourceTest, ResourceManagerPrioritiesAreEqual) { resource_manager->MemoryAboveCutoffBytes()); DebugScopedSetImplThreadAndMainThreadBlocked - impl_thread_and_main_thread_blocked(&proxy_); + impl_thread_and_main_thread_blocked(&proxy_); resource_manager->ClearAllMemory(ResourceProvider()); } @@ -559,7 +711,7 @@ TEST_F(PrioritizedResourceTest, ResourceManagerDestroyedFirst) { EXPECT_TRUE(texture->have_backing_texture()); { DebugScopedSetImplThreadAndMainThreadBlocked - impl_thread_and_main_thread_blocked(&proxy_); + impl_thread_and_main_thread_blocked(&proxy_); resource_manager->ClearAllMemory(ResourceProvider()); } resource_manager.reset(); @@ -589,7 +741,7 @@ TEST_F(PrioritizedResourceTest, TextureMovedToNewManager) { texture->SetTextureManager(NULL); { DebugScopedSetImplThreadAndMainThreadBlocked - impl_thread_and_main_thread_blocked(&proxy_); + impl_thread_and_main_thread_blocked(&proxy_); resource_manager_one->ClearAllMemory(ResourceProvider()); } resource_manager_one.reset(); @@ -606,7 +758,7 @@ TEST_F(PrioritizedResourceTest, TextureMovedToNewManager) { EXPECT_TRUE(texture->have_backing_texture()); DebugScopedSetImplThreadAndMainThreadBlocked - impl_thread_and_main_thread_blocked(&proxy_); + impl_thread_and_main_thread_blocked(&proxy_); resource_manager_two->ClearAllMemory(ResourceProvider()); } @@ -663,7 +815,7 @@ TEST_F(PrioritizedResourceTest, resource_manager->MaxMemoryNeededBytes()); DebugScopedSetImplThreadAndMainThreadBlocked - impl_thread_and_main_thread_blocked(&proxy_); + impl_thread_and_main_thread_blocked(&proxy_); resource_manager->ClearAllMemory(ResourceProvider()); } @@ -711,7 +863,7 @@ TEST_F(PrioritizedResourceTest, resource_manager->MaxMemoryNeededBytes()); DebugScopedSetImplThreadAndMainThreadBlocked - impl_thread_and_main_thread_blocked(&proxy_); + impl_thread_and_main_thread_blocked(&proxy_); resource_manager->ClearAllMemory(ResourceProvider()); } @@ -763,7 +915,7 @@ TEST_F(PrioritizedResourceTest, resource_manager->MemoryAboveCutoffBytes()); DebugScopedSetImplThreadAndMainThreadBlocked - impl_thread_and_main_thread_blocked(&proxy_); + impl_thread_and_main_thread_blocked(&proxy_); resource_manager->ClearAllMemory(ResourceProvider()); } @@ -815,7 +967,7 @@ TEST_F(PrioritizedResourceTest, RequestLateBackingsSorting) { EXPECT_FALSE(TextureBackingIsAbovePriorityCutoff(textures[i].get())); DebugScopedSetImplThreadAndMainThreadBlocked - impl_thread_and_main_thread_blocked(&proxy_); + impl_thread_and_main_thread_blocked(&proxy_); resource_manager->ClearAllMemory(ResourceProvider()); } @@ -841,7 +993,7 @@ TEST_F(PrioritizedResourceTest, ClearUploadsToEvictedResources) { ResourceUpdateQueue queue; DebugScopedSetImplThreadAndMainThreadBlocked - impl_thread_and_main_thread_blocked(&proxy_); + impl_thread_and_main_thread_blocked(&proxy_); for (size_t i = 0; i < kMaxTextures; ++i) { const ResourceUpdate upload = ResourceUpdate::Create( textures[i].get(), NULL, gfx::Rect(), gfx::Rect(), gfx::Vector2d()); @@ -934,7 +1086,7 @@ TEST_F(PrioritizedResourceTest, UsageStatistics) { // Push priorities to backings, and verify we see the new values. { DebugScopedSetImplThreadAndMainThreadBlocked - impl_thread_and_main_thread_blocked(&proxy_); + impl_thread_and_main_thread_blocked(&proxy_); resource_manager->PushTexturePrioritiesToBackings(); EXPECT_EQ(TexturesMemorySize(2), resource_manager->MemoryUseBytes()); EXPECT_EQ(TexturesMemorySize(3), resource_manager->MemoryVisibleBytes()); @@ -943,7 +1095,7 @@ TEST_F(PrioritizedResourceTest, UsageStatistics) { } DebugScopedSetImplThreadAndMainThreadBlocked - impl_thread_and_main_thread_blocked(&proxy_); + impl_thread_and_main_thread_blocked(&proxy_); resource_manager->ClearAllMemory(ResourceProvider()); } |