ee21a3e395
- rename ComparisonTask to ChecksumTask - have ChecksumTask handle all the checksum-checking - turn on all extra modes by default - simplify progress output to a countdown BUG= R=bsalomon@google.com Review URL: https://codereview.chromium.org/88543002 git-svn-id: http://skia.googlecode.com/svn/trunk@12398 2bbb7eff-a529-9590-31e7-b0007b416f81
27 lines
644 B
C++
27 lines
644 B
C++
#include "DMChecksumTask.h"
|
|
#include "DMUtil.h"
|
|
|
|
namespace DM {
|
|
|
|
ChecksumTask::ChecksumTask(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 ChecksumTask::draw() {
|
|
if (fExpectations.ignoreFailure() || fExpectations.empty()) {
|
|
return;
|
|
}
|
|
|
|
const skiagm::GmResultDigest digest(fBitmap);
|
|
if (!fExpectations.match(digest)) {
|
|
this->fail();
|
|
}
|
|
}
|
|
|
|
} // namespace DM
|