blob: bb4e656754325d0b07e52a16a214e87329dba99a [file] [log] [blame]
mtklein@google.comd36522d2013-10-16 13:02:15 +00001#include "DMComparisonTask.h"
2#include "DMUtil.h"
3
4namespace DM {
5
6ComparisonTask::ComparisonTask(const Task& parent,
7 skiagm::Expectations expectations,
8 SkBitmap bitmap)
9 : Task(parent)
10 , fName(parent.name()) // Masquerade as parent so failures are attributed to it.
11 , fExpectations(expectations)
12 , fBitmap(bitmap)
13 {}
14
15void ComparisonTask::draw() {
commit-bot@chromium.org192cbf62013-10-21 18:40:25 +000016 if (!MeetsExpectations(fExpectations, fBitmap)) {
mtklein@google.comd36522d2013-10-16 13:02:15 +000017 this->fail();
18 }
19}
20
21} // namespace DM