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

Unified Diff: cc/layers/texture_layer_unittest.cc

Issue 2609253003: Remove ForceReclaimResources (Closed)
Patch Set: Fix tests and re-enable previous swap behavior Created 3 years, 11 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
« no previous file with comments | « no previous file | cc/output/compositor_frame_sink.h » ('j') | content/test/layouttest_support.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
};
« no previous file with comments | « no previous file | cc/output/compositor_frame_sink.h » ('j') | content/test/layouttest_support.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698