| OLD | NEW |
| 1 #include "DMTask.h" | 1 #include "DMTask.h" |
| 2 #include "DMTaskRunner.h" | 2 #include "DMTaskRunner.h" |
| 3 #include "SkCommonFlags.h" | 3 #include "SkCommonFlags.h" |
| 4 | 4 |
| 5 namespace DM { | 5 namespace DM { |
| 6 | 6 |
| 7 Task::Task(Reporter* reporter, TaskRunner* taskRunner) | 7 Task::Task(Reporter* reporter, TaskRunner* taskRunner) |
| 8 : fReporter(reporter) | 8 : fReporter(reporter) |
| 9 , fTaskRunner(taskRunner) | 9 , fTaskRunner(taskRunner) |
| 10 , fDepth(0) { | 10 , fDepth(0) { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 task->run(); | 61 task->run(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 GpuTask::GpuTask(Reporter* reporter, TaskRunner* taskRunner) : Task(reporter, ta
skRunner) {} | 64 GpuTask::GpuTask(Reporter* reporter, TaskRunner* taskRunner) : Task(reporter, ta
skRunner) {} |
| 65 | 65 |
| 66 void GpuTask::run(GrContextFactory& factory) { | 66 void GpuTask::run(GrContextFactory& factory) { |
| 67 if (FLAGS_gpu && !this->shouldSkip()) { | 67 if (FLAGS_gpu && !this->shouldSkip()) { |
| 68 this->start(); | 68 this->start(); |
| 69 if (!FLAGS_dryRun) this->draw(&factory); | 69 if (!FLAGS_dryRun) this->draw(&factory); |
| 70 this->finish(); | 70 this->finish(); |
| 71 if (FLAGS_resetGpuContext) { | 71 if (FLAGS_abandonGpuContext) { |
| 72 factory.abandonContexts(); |
| 73 } |
| 74 if (FLAGS_resetGpuContext || FLAGS_abandonGpuContext) { |
| 72 factory.destroyContexts(); | 75 factory.destroyContexts(); |
| 73 } | 76 } |
| 74 } | 77 } |
| 75 SkDELETE(this); | 78 SkDELETE(this); |
| 76 } | 79 } |
| 77 | 80 |
| 78 void GpuTask::spawnChild(CpuTask* task) { | 81 void GpuTask::spawnChild(CpuTask* task) { |
| 79 // Really spawn a new task so it runs on the CPU threadpool instead of the G
PU one we're on now. | 82 // Really spawn a new task so it runs on the CPU threadpool instead of the G
PU one we're on now. |
| 80 // It goes on the front of the queue to minimize the time we must hold refer
ence bitmaps in RAM. | 83 // It goes on the front of the queue to minimize the time we must hold refer
ence bitmaps in RAM. |
| 81 this->spawnChildNext(task); | 84 this->spawnChildNext(task); |
| 82 } | 85 } |
| 83 | 86 |
| 84 } // namespace DM | 87 } // namespace DM |
| OLD | NEW |