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

Unified Diff: cc/layers/texture_layer_unittest.cc

Issue 2633563003: Revert of Remove ForceReclaimResources (Closed)
Patch Set: 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') | no next file with comments »
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 8f30f68a370b882eb7225d4d9beb257ea1c45e75..7d10bf7ee4ae7739693a0d58c5afe75ac8d6d3fe 100644
--- a/cc/layers/texture_layer_unittest.cc
+++ b/cc/layers/texture_layer_unittest.cc
@@ -643,11 +643,15 @@
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);
+ ImplThreadTaskRunner(), synchronous_composite,
+ force_disable_reclaim_resources);
}
// Make sure callback is received on main and doesn't block the impl thread.
@@ -700,16 +704,8 @@
}
void DidCommit() override {
- ++total_commit_count_;
- if (total_commit_count_ % 2) {
- // Perform an extra commit after each meaningful commit to reclaim
- // resources.
- PostSetNeedsCommitToMainThread();
- return;
- }
-
- ++meaningful_commit_count_;
- switch (meaningful_commit_count_) {
+ ++commit_count_;
+ switch (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
@@ -759,8 +755,7 @@
private:
base::ThreadChecker main_thread_;
int callback_count_ = 0;
- int total_commit_count_ = 0;
- int meaningful_commit_count_ = 0;
+ int 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698