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

Unified Diff: cc/output/direct_renderer.cc

Issue 160023002: cc: Only make num_threads - 1 SkPicture clones. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sw renderer too Created 6 years, 10 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/output/direct_renderer.h ('k') | cc/output/gl_renderer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/direct_renderer.cc
diff --git a/cc/output/direct_renderer.cc b/cc/output/direct_renderer.cc
index c077ffe21ae3c16d1409c1e11cb794ede263360d..d508869a39f95ec3b6f48d5f056df370624e36a0 100644
--- a/cc/output/direct_renderer.cc
+++ b/cc/output/direct_renderer.cc
@@ -14,6 +14,7 @@
#include "cc/base/math_util.h"
#include "cc/output/copy_output_request.h"
#include "cc/quads/draw_quad.h"
+#include "cc/resources/raster_worker_pool.h"
#include "ui/gfx/rect_conversions.h"
#include "ui/gfx/transform.h"
@@ -417,6 +418,35 @@ bool DirectRenderer::UseRenderPass(DrawingFrame* frame,
return BindFramebufferToTexture(frame, texture, render_pass->output_rect);
}
+void DirectRenderer::RunOnDemandRasterTask(
+ internal::Task* on_demand_raster_task) {
+ internal::TaskGraphRunner* task_graph_runner =
+ RasterWorkerPool::GetTaskGraphRunner();
+ DCHECK(task_graph_runner);
+
+ // Make sure we have a unique task namespace token.
+ if (!on_demand_task_namespace_.IsValid())
+ on_demand_task_namespace_ = task_graph_runner->GetNamespaceToken();
+
+ // Construct a task graph that contains this single raster task.
+ internal::TaskGraph graph;
+ graph.nodes.push_back(
+ internal::TaskGraph::Node(on_demand_raster_task,
+ RasterWorkerPool::kOnDemandRasterTaskPriority,
+ 0u));
+
+ // Schedule task and wait for task graph runner to finish running it.
+ task_graph_runner->SetTaskGraph(on_demand_task_namespace_, &graph);
+ task_graph_runner->WaitForTasksToFinishRunning(on_demand_task_namespace_);
+
+ // Collect task now that it has finished running.
+ internal::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);
+}
+
bool DirectRenderer::HasAllocatedResourcesForTesting(RenderPass::Id id)
const {
ScopedResource* texture = render_pass_textures_.get(id);
« no previous file with comments | « cc/output/direct_renderer.h ('k') | cc/output/gl_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698