aboutsummaryrefslogtreecommitdiffhomepage
path: root/dm/DMComparisonTask.cpp
blob: bb4e656754325d0b07e52a16a214e87329dba99a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "DMComparisonTask.h"
#include "DMUtil.h"

namespace DM {

ComparisonTask::ComparisonTask(const Task& parent,
                               skiagm::Expectations expectations,
                               SkBitmap bitmap)
    : Task(parent)
    , fName(parent.name())  // Masquerade as parent so failures are attributed to it.
    , fExpectations(expectations)
    , fBitmap(bitmap)
    {}

void ComparisonTask::draw() {
    if (!MeetsExpectations(fExpectations, fBitmap)) {
        this->fail();
    }
}

}  // namespace DM