skia2/dm/DMTask.h
scroggo@google.com 1ecd9cf379 Fix a warning building DM using ninja on Mac.
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
2013-11-20 16:44:59 +00:00

46 lines
978 B
C++

#ifndef DMTask_DEFINED
#define DMTask_DEFINED
#include "DMReporter.h"
#include "SkRunnable.h"
#include "SkThreadPool.h"
// DM will run() these tasks on one of two threadpools, depending on the result
// of usesGpu(). The subclasses can call fail() to mark this task as failed,
// or make any number of spawnChild() calls to kick off dependent tasks.
//
// Task deletes itself when run.
namespace DM {
class TaskRunner;
class Task : public SkRunnable {
public:
Task(Reporter* reporter, TaskRunner* taskRunner);
Task(const Task& that);
virtual ~Task();
void run() SK_OVERRIDE;
virtual void draw() = 0;
virtual bool usesGpu() const = 0;
virtual bool shouldSkip() const = 0;
virtual SkString name() const = 0;
protected:
void spawnChild(Task* task);
void fail();
private:
// Both unowned.
Reporter* fReporter;
TaskRunner* fTaskRunner;
typedef SkRunnable INHERITED;
};
} // namespace DM
#endif // DMTask_DEFINED