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

Unified Diff: dm/DMTask.cpp

Issue 578033002: DM: --gpu and --cpu should only control top-level tasks. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMTask.cpp
diff --git a/dm/DMTask.cpp b/dm/DMTask.cpp
index 5ceb53b0625088a3077fab3237a16da4a122c5a6..3fa5c39718b0f4f8bc53cfe7a91fee5f93d3498e 100644
--- a/dm/DMTask.cpp
+++ b/dm/DMTask.cpp
@@ -46,7 +46,9 @@ CpuTask::CpuTask(Reporter* reporter, TaskRunner* taskRunner) : Task(reporter, ta
CpuTask::CpuTask(const Task& parent) : Task(parent) {}
void CpuTask::run() {
- if (FLAGS_cpu && !this->shouldSkip()) {
+ // If the task says skip, or if we're starting a top-level CPU task and we don't want to, skip.
+ const bool skip = this->shouldSkip() || (this->depth() == 0 && !FLAGS_cpu);
+ if (!skip) {
this->start();
if (!FLAGS_dryRun) this->draw();
this->finish();
@@ -64,7 +66,9 @@ void CpuTask::spawnChild(CpuTask* task) {
GpuTask::GpuTask(Reporter* reporter, TaskRunner* taskRunner) : Task(reporter, taskRunner) {}
void GpuTask::run(GrContextFactory* factory) {
- if (FLAGS_gpu && !this->shouldSkip()) {
+ // If the task says skip, or if we're starting a top-level GPU task and we don't want to, skip.
+ const bool skip = this->shouldSkip() || (this->depth() == 0 && !FLAGS_gpu);
+ if (!skip) {
this->start();
if (!FLAGS_dryRun) this->draw(factory);
this->finish();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698