blob: f4f742c921077da558e0cad60cc6ea5569fcd0c1 [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() {
16 const skiagm::GmResultDigest digest(fBitmap);
17 if (!meetsExpectations(fExpectations, digest)) {
18 this->fail();
19 }
20}
21
22} // namespace DM