mtklein@google.com | d36522d | 2013-10-16 13:02:15 +0000 | [diff] [blame] | 1 | #include "DMComparisonTask.h" |
| 2 | #include "DMUtil.h" |
| 3 | |
| 4 | namespace DM { |
| 5 | |
| 6 | ComparisonTask::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 | |
| 15 | void ComparisonTask::draw() { |
commit-bot@chromium.org | 192cbf6 | 2013-10-21 18:40:25 +0000 | [diff] [blame] | 16 | if (!MeetsExpectations(fExpectations, fBitmap)) { |
mtklein@google.com | d36522d | 2013-10-16 13:02:15 +0000 | [diff] [blame] | 17 | this->fail(); |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | } // namespace DM |