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

Unified Diff: dm/DMTask.cpp

Issue 219403004: Make DM play nice with the plan to split CPU and GPU work. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 9 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 419463a5b4e3e7dd11d6341b4c6490acf2a983a9..8b6a94e52ad33a016eadbb7c033be77789c496eb 100644
--- a/dm/DMTask.cpp
+++ b/dm/DMTask.cpp
@@ -1,5 +1,9 @@
#include "DMTask.h"
#include "DMTaskRunner.h"
+#include "SkCommandLineFlags.h"
+
+DEFINE_bool(cpu, true, "Master switch for running CPU-bound work.");
+DEFINE_bool(gpu, true, "Master switch for running GPU-bound work.");
namespace DM {
@@ -42,7 +46,7 @@ CpuTask::CpuTask(const Task& parent) : Task(parent) {}
void CpuTask::run() {
this->start();
- if (!this->shouldSkip()) {
+ if (FLAGS_cpu && !this->shouldSkip()) {
this->draw();
}
this->finish();
@@ -53,7 +57,7 @@ GpuTask::GpuTask(Reporter* reporter, TaskRunner* taskRunner) : Task(reporter, ta
void GpuTask::run(GrContextFactory& factory) {
this->start();
- if (!this->shouldSkip()) {
+ if (FLAGS_gpu && !this->shouldSkip()) {
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