OLD | NEW |
---|---|
(Empty) | |
1 #include "DMChecksumTask.h" | |
2 #include "DMUtil.h" | |
3 | |
4 namespace DM { | |
5 | |
6 ChecksumTask::ChecksumTask(const Task& parent, | |
7 skiagm::Expectations expectations, | |
8 SkBitmap bitmap) | |
9 : Task(parent) | |
10 , fName(parent.name()) // Masquerade as parent so failures are attributed t o it. | |
11 , fExpectations(expectations) | |
12 , fBitmap(bitmap) | |
epoger
2013/11/26 17:55:22
I take it that copying the SkBitmap struct is pret
bsalomon
2013/11/26 18:21:52
bitmap is very shallow.
mtklein
2013/11/26 18:25:30
Yes, copying SkBitmap is trivially cheap. This cl
| |
13 {} | |
14 | |
15 void ChecksumTask::draw() { | |
16 if (fExpectations.ignoreFailure() || fExpectations.empty()) { | |
17 return; | |
18 } | |
19 | |
20 const skiagm::GmResultDigest digest(fBitmap); | |
21 if (!fExpectations.match(digest)) { | |
22 this->fail(); | |
23 } | |
24 } | |
25 | |
26 } // namespace DM | |
OLD | NEW |