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

Unified Diff: cc/test/pixel_test.cc

Issue 334133002: cc: Support on demand raster with ganesh (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 6 years, 6 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
Index: cc/test/pixel_test.cc
diff --git a/cc/test/pixel_test.cc b/cc/test/pixel_test.cc
index ae2e9984fdb9c1485015e2b976561aeae9142414..73abc1c3828bd6cda9eab556cda460fff187ea9e 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()));

Powered by Google App Engine
This is Rietveld 408576698