summaryrefslogtreecommitdiffstats
path: root/cc/test/pixel_test.cc
diff options
context:
space:
mode:
authorboliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-21 01:11:57 +0000
committerboliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-21 01:11:57 +0000
commite7391c3bb6f2345e4ed1d6d9c9d1cf03f83ff48b (patch)
tree90d10d958d424e6d024500903eb1c84a3df4489a /cc/test/pixel_test.cc
parentf89ee437e25a2afde6f7dc2ca3d49fd462d23ea3 (diff)
downloadchromium_src-e7391c3bb6f2345e4ed1d6d9c9d1cf03f83ff48b.zip
chromium_src-e7391c3bb6f2345e4ed1d6d9c9d1cf03f83ff48b.tar.gz
chromium_src-e7391c3bb6f2345e4ed1d6d9c9d1cf03f83ff48b.tar.bz2
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
Diffstat (limited to 'cc/test/pixel_test.cc')
-rw-r--r--cc/test/pixel_test.cc25
1 files changed, 25 insertions, 0 deletions
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<SoftwareOutputDevice> device(new PixelTestSoftwareOutputDevice());
output_surface_.reset(new PixelTestOutputSurface(device.Pass()));