skia2/dm/DMComparisonTask.cpp
commit-bot@chromium.org 192cbf67b2 DM: add --serialize
Plus:
  - minor ReplayTask refactoring to share code with SerializeTask
  - move --replay to ReplayTask and --serialize to SerializeTask like WriteTask
  - when --writePath is given, write failures for Replay and Serialize tasks
  - function names have fewer blatant Skia style violations

BUG=
R=bsalomon@google.com

Author: mtklein@google.com

Review URL: https://codereview.chromium.org/32613003

git-svn-id: http://skia.googlecode.com/svn/trunk@11890 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-10-21 18:40:25 +00:00

22 lines
535 B
C++

#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