aboutsummaryrefslogtreecommitdiffhomepage
path: root/dm/DMExpectationsTask.h
blob: 7000de4b68e46ef7381f73eca105a24be338eca8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef DMExpectationsTask_DEFINED
#define DMExpectationsTask_DEFINED

#include "DMExpectations.h"
#include "DMTask.h"
#include "SkBitmap.h"
#include "SkString.h"

namespace DM {

// ExpectationsTask compares an SkBitmap against some Expectations.
// Moving this off the GPU threadpool is a nice (~30%) runtime win.
class ExpectationsTask : public CpuTask {
public:
    ExpectationsTask(const Task& parent, const Expectations&, SkBitmap);

    virtual void draw() SK_OVERRIDE;
    virtual bool shouldSkip() const SK_OVERRIDE { return false; }
    virtual SkString name() const SK_OVERRIDE { return fName; }

private:
    const SkString fName;
    const Expectations& fExpectations;
    const SkBitmap fBitmap;
};

}  // namespace DM

#endif  // DMExpectationsTask_DEFINED