Index: cc/layers/texture_layer_unittest.cc |
diff --git a/cc/layers/texture_layer_unittest.cc b/cc/layers/texture_layer_unittest.cc |
index 7d10bf7ee4ae7739693a0d58c5afe75ac8d6d3fe..8f30f68a370b882eb7225d4d9beb257ea1c45e75 100644 |
--- a/cc/layers/texture_layer_unittest.cc |
+++ b/cc/layers/texture_layer_unittest.cc |
@@ -643,15 +643,11 @@ class TextureLayerImplWithMailboxThreadedCallback : public LayerTreeTest { |
bool synchronous_composite = |
!HasImplThread() && |
!layer_tree_host()->GetSettings().single_thread_proxy_scheduler; |
- // Allow relaim resources for this test so that mailboxes in the display |
- // will be returned inside the commit that replaces them. |
- bool force_disable_reclaim_resources = false; |
return base::MakeUnique<TestCompositorFrameSink>( |
compositor_context_provider, std::move(worker_context_provider), |
shared_bitmap_manager(), gpu_memory_buffer_manager(), |
layer_tree_host()->GetSettings().renderer_settings, |
- ImplThreadTaskRunner(), synchronous_composite, |
- force_disable_reclaim_resources); |
+ ImplThreadTaskRunner(), synchronous_composite); |
} |
// Make sure callback is received on main and doesn't block the impl thread. |
@@ -704,8 +700,16 @@ class TextureLayerImplWithMailboxThreadedCallback : public LayerTreeTest { |
} |
void DidCommit() override { |
- ++commit_count_; |
- switch (commit_count_) { |
+ ++total_commit_count_; |
+ if (total_commit_count_ % 2) { |
+ // Perform an extra commit after each meaningful commit to reclaim |
+ // resources. |
danakj
2017/01/11 19:28:24
^_^b
|
+ PostSetNeedsCommitToMainThread(); |
+ return; |
+ } |
+ |
+ ++meaningful_commit_count_; |
+ switch (meaningful_commit_count_) { |
case 1: |
// Case #2: change mailbox after the commit (and draw), where the |
// layer draws. The old mailbox should be released during the next |
@@ -755,7 +759,8 @@ class TextureLayerImplWithMailboxThreadedCallback : public LayerTreeTest { |
private: |
base::ThreadChecker main_thread_; |
int callback_count_ = 0; |
- int commit_count_ = 0; |
+ int total_commit_count_ = 0; |
+ int meaningful_commit_count_ = 0; |
scoped_refptr<Layer> root_; |
scoped_refptr<TextureLayer> layer_; |
}; |