blob: 24976f011dcf98cffe4fac029a43c1d2f22488e3 [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.org66bb3d12013-10-16 19:13:38 +000016 if (!meetsExpectations(fExpectations, fBitmap)) {
mtklein@google.comd36522d2013-10-16 13:02:15 +000017 this->fail();
18 }
19}
20
21} // namespace DM