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

Unified Diff: cc/test/layer_tree_test.cc

Issue 683113005: Update from chromium https://crrev.com/302282 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 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 | « cc/test/layer_tree_test.h ('k') | cc/test/test_gpu_memory_buffer_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/layer_tree_test.cc
diff --git a/cc/test/layer_tree_test.cc b/cc/test/layer_tree_test.cc
index 8c0255af03112cfa65e55d67314e049f880ca2a3..d1d196267ffc8c702da95a3fb6ec34401246d297 100644
--- a/cc/test/layer_tree_test.cc
+++ b/cc/test/layer_tree_test.cc
@@ -44,6 +44,15 @@ DrawResult TestHooks::PrepareToDrawOnThread(
return draw_result;
}
+void TestHooks::CreateResourceAndRasterWorkerPool(
+ LayerTreeHostImpl* host_impl,
+ scoped_ptr<RasterWorkerPool>* raster_worker_pool,
+ scoped_ptr<ResourcePool>* resource_pool,
+ scoped_ptr<ResourcePool>* staging_resource_pool) {
+ host_impl->LayerTreeHostImpl::CreateResourceAndRasterWorkerPool(
+ raster_worker_pool, resource_pool, staging_resource_pool);
+}
+
base::TimeDelta TestHooks::LowFrequencyAnimationInterval() const {
return base::TimeDelta::FromMilliseconds(16);
}
@@ -146,6 +155,14 @@ class LayerTreeHostImplForTesting : public LayerTreeHostImpl {
block_notify_ready_to_activate_for_testing_(false),
notify_ready_to_activate_was_blocked_(false) {}
+ void CreateResourceAndRasterWorkerPool(
+ scoped_ptr<RasterWorkerPool>* raster_worker_pool,
+ scoped_ptr<ResourcePool>* resource_pool,
+ scoped_ptr<ResourcePool>* staging_resource_pool) override {
+ test_hooks_->CreateResourceAndRasterWorkerPool(
+ this, raster_worker_pool, resource_pool, staging_resource_pool);
+ }
+
void WillBeginImplFrame(const BeginFrameArgs& args) override {
LayerTreeHostImpl::WillBeginImplFrame(args);
test_hooks_->WillBeginImplFrameOnThread(this, args);
@@ -399,7 +416,8 @@ class LayerTreeHostForTesting : public LayerTreeHost {
};
LayerTreeTest::LayerTreeTest()
- : beginning_(false),
+ : output_surface_(nullptr),
+ beginning_(false),
end_when_begin_returns_(false),
timed_out_(false),
scheduled_(false),
@@ -514,6 +532,13 @@ void LayerTreeTest::PostSetNextCommitForcesRedrawToMainThread() {
main_thread_weak_ptr_));
}
+void LayerTreeTest::PostCompositeImmediatelyToMainThread() {
+ main_task_runner_->PostTask(
+ FROM_HERE,
+ base::Bind(&LayerTreeTest::DispatchCompositeImmediately,
+ main_thread_weak_ptr_));
+}
+
void LayerTreeTest::WillBeginTest() {
layer_tree_host_->SetLayerTreeHostClientReady();
}
@@ -629,6 +654,12 @@ void LayerTreeTest::DispatchSetNextCommitForcesRedraw() {
layer_tree_host_->SetNextCommitForcesRedraw();
}
+void LayerTreeTest::DispatchCompositeImmediately() {
+ DCHECK(!proxy() || proxy()->IsMainThread());
+ if (layer_tree_host_)
+ layer_tree_host_->Composite(gfx::FrameTime::Now());
+}
+
void LayerTreeTest::RunTest(bool threaded,
bool delegating_renderer,
bool impl_side_painting) {
« no previous file with comments | « cc/test/layer_tree_test.h ('k') | cc/test/test_gpu_memory_buffer_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698