1ecd9cf379
Here is the warning: ../../dm/DMTask.cpp: In copy constructor ‘DM::Task::Task(const DM::Task&)’: ../../dm/DMTask.cpp:17: warning: base class ‘class SkRunnable’ should be explicitly initialized in the copy constructor Also add an SK_OVERRIDE. R=mtklein@google.com Review URL: https://codereview.chromium.org/76903002 git-svn-id: http://skia.googlecode.com/svn/trunk@12317 2bbb7eff-a529-9590-31e7-b0007b416f81
46 lines
888 B
C++
46 lines
888 B
C++
#include "DMTask.h"
|
|
|
|
#include "DMTaskRunner.h"
|
|
#include "DMUtil.h"
|
|
#include "SkBitmap.h"
|
|
#include "SkCommandLineFlags.h"
|
|
|
|
namespace DM {
|
|
|
|
Task::Task(Reporter* reporter, TaskRunner* taskRunner)
|
|
: fReporter(reporter), fTaskRunner(taskRunner) {
|
|
fReporter->start();
|
|
}
|
|
|
|
Task::Task(const Task& that)
|
|
: INHERITED(that)
|
|
, fReporter(that.fReporter)
|
|
, fTaskRunner(that.fTaskRunner) {
|
|
fReporter->start();
|
|
}
|
|
|
|
Task::~Task() {}
|
|
|
|
void Task::run() {
|
|
if (!this->shouldSkip()) {
|
|
this->draw();
|
|
}
|
|
fReporter->finish();
|
|
fReporter->updateStatusLine();
|
|
delete this;
|
|
}
|
|
|
|
void Task::spawnChild(Task* task) {
|
|
if (!task->usesGpu()) {
|
|
fTaskRunner->add(task);
|
|
} else {
|
|
SkDEBUGFAIL("Sorry, we can't spawn GPU tasks. :( See comment in TaskRunner::wait().");
|
|
}
|
|
}
|
|
|
|
void Task::fail() {
|
|
fReporter->fail(this->name());
|
|
}
|
|
|
|
} // namespace DM
|