From e7391c3bb6f2345e4ed1d6d9c9d1cf03f83ff48b Mon Sep 17 00:00:00 2001 From: "boliu@chromium.org" Date: Sat, 21 Jun 2014 01:11:57 +0000 Subject: cc: Support on demand raster with gpu rasterization Normal gpu rasterization happens on compositor thread, so on-demand rasteration must also be on compositor thread. So if impl-side painting is off or if gpu rasterization is on, then directly raster on compositor thread. BUG=383379 Review URL: https://codereview.chromium.org/334133002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278887 0039d316-1c4b-4281-b951-d872f2087c98 --- cc/test/pixel_test.cc | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'cc/test/pixel_test.cc') diff --git a/cc/test/pixel_test.cc b/cc/test/pixel_test.cc index ae2e998..73abc1c 100644 --- a/cc/test/pixel_test.cc +++ b/cc/test/pixel_test.cc @@ -15,6 +15,7 @@ #include "cc/output/gl_renderer.h" #include "cc/output/output_surface_client.h" #include "cc/output/software_renderer.h" +#include "cc/resources/raster_worker_pool.h" #include "cc/resources/resource_provider.h" #include "cc/resources/texture_mailbox_deleter.h" #include "cc/test/fake_output_surface_client.h" @@ -146,6 +147,30 @@ void PixelTest::EnableExternalStencilTest() { ->set_has_external_stencil_test(true); } +void PixelTest::RunOnDemandRasterTask(Task* on_demand_raster_task) { + TaskGraphRunner task_graph_runner; + NamespaceToken on_demand_task_namespace = + task_graph_runner.GetNamespaceToken(); + + // Construct a task graph that contains this single raster task. + TaskGraph graph; + graph.nodes.push_back( + TaskGraph::Node(on_demand_raster_task, + RasterWorkerPool::kOnDemandRasterTaskPriority, + 0u)); + + // Schedule task and wait for task graph runner to finish running it. + task_graph_runner.ScheduleTasks(on_demand_task_namespace, &graph); + task_graph_runner.RunUntilIdle(); + + // Collect task now that it has finished running. + Task::Vector completed_tasks; + task_graph_runner.CollectCompletedTasks(on_demand_task_namespace, + &completed_tasks); + DCHECK_EQ(1u, completed_tasks.size()); + DCHECK_EQ(completed_tasks[0], on_demand_raster_task); +} + void PixelTest::SetUpSoftwareRenderer() { scoped_ptr device(new PixelTestSoftwareOutputDevice()); output_surface_.reset(new PixelTestOutputSurface(device.Pass())); -- cgit v1.1