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

Side by Side Diff: dm/DMTask.cpp

Issue 22839016: Skeleton of DM (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: one last sync Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « dm/DMTask.h ('k') | dm/DMTaskRunner.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #include "DMTask.h"
2
3 #include "DMTaskRunner.h"
4 #include "DMUtil.h"
5 #include "SkBitmap.h"
6 #include "SkCommandLineFlags.h"
7
8 namespace DM {
9
10 Task::Task(Reporter* reporter, TaskRunner* taskRunner)
11 : fReporter(reporter), fTaskRunner(taskRunner) {
12 fReporter->start();
13 }
14
15 Task::Task(const Task& that) : fReporter(that.fReporter), fTaskRunner(that.fTask Runner) {
16 fReporter->start();
17 }
18
19 Task::~Task() {}
20
21 void Task::run() {
22 if (!this->shouldSkip()) {
23 this->draw();
24 }
25 fReporter->finish();
26 fReporter->updateStatusLine();
27 delete this;
28 }
29
30 void Task::spawnChild(Task* task) {
31 if (!task->usesGpu()) {
32 fTaskRunner->add(task);
33 } else {
34 SkDEBUGFAIL("Sorry, we can't spawn GPU tasks. :( See comment in TaskRun ner::wait().");
35 }
36 }
37
38 void Task::fail() {
39 fReporter->fail(this->name());
40 }
41
42 } // namespace DM
OLDNEW
« no previous file with comments | « dm/DMTask.h ('k') | dm/DMTaskRunner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698