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

Side by Side Diff: cc/trees/layer_tree_host_unittest.cc

Issue 1228323004: NotifyAllTileTasksCompleted for synchronous renderer compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 bool success) override { 346 bool success) override {
347 ManagedMemoryPolicy zero_policy( 347 ManagedMemoryPolicy zero_policy(
348 0, gpu::MemoryAllocation::CUTOFF_ALLOW_NOTHING, 0); 348 0, gpu::MemoryAllocation::CUTOFF_ALLOW_NOTHING, 0);
349 host_impl->SetMemoryPolicy(zero_policy); 349 host_impl->SetMemoryPolicy(zero_policy);
350 } 350 }
351 }; 351 };
352 352
353 SINGLE_AND_MULTI_THREAD_TEST_F( 353 SINGLE_AND_MULTI_THREAD_TEST_F(
354 LayerTreeHostFreeWorkerContextResourcesOnZeroMemoryLimit); 354 LayerTreeHostFreeWorkerContextResourcesOnZeroMemoryLimit);
355 355
356 // Test if the LTH successfully frees resources on the worker context when
357 // hard memory limit is set to zero while using a synchronous compositor (like
358 // Android WebView).
359 class LayerTreeHostFreeWorkerContextResourcesOnZeroMemoryLimitSynchronous
360 : public LayerTreeHostFreeWorkerContextResourcesOnZeroMemoryLimit {
361 public:
362 void InitializeSettings(LayerTreeSettings* settings) override {
363 LayerTreeHostFreeWorkerContextResourcesTest::InitializeSettings(settings);
364 settings->use_external_begin_frame_source = true;
365 settings->using_synchronous_renderer_compositor = true;
366 }
367 };
368
369 SINGLE_AND_MULTI_THREAD_TEST_F(
370 LayerTreeHostFreeWorkerContextResourcesOnZeroMemoryLimitSynchronous);
371
356 // Two setNeedsCommits in a row should lead to at least 1 commit and at least 1 372 // Two setNeedsCommits in a row should lead to at least 1 commit and at least 1
357 // draw with frame 0. 373 // draw with frame 0.
358 class LayerTreeHostTestSetNeedsCommit1 : public LayerTreeHostTest { 374 class LayerTreeHostTestSetNeedsCommit1 : public LayerTreeHostTest {
359 public: 375 public:
360 LayerTreeHostTestSetNeedsCommit1() : num_commits_(0), num_draws_(0) {} 376 LayerTreeHostTestSetNeedsCommit1() : num_commits_(0), num_draws_(0) {}
361 377
362 void BeginTest() override { 378 void BeginTest() override {
363 PostSetNeedsCommitToMainThread(); 379 PostSetNeedsCommitToMainThread();
364 PostSetNeedsCommitToMainThread(); 380 PostSetNeedsCommitToMainThread();
365 } 381 }
(...skipping 5670 matching lines...) Expand 10 before | Expand all | Expand 10 after
6036 void AfterTest() override {} 6052 void AfterTest() override {}
6037 6053
6038 std::vector<int> affected_by_page_scale_; 6054 std::vector<int> affected_by_page_scale_;
6039 std::vector<int> not_affected_by_page_scale_; 6055 std::vector<int> not_affected_by_page_scale_;
6040 }; 6056 };
6041 6057
6042 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeTestPageScaleFlags); 6058 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeTestPageScaleFlags);
6043 6059
6044 } // namespace 6060 } // namespace
6045 } // namespace cc 6061 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698