Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4192)

Unified Diff: dm/DMComparisonTask.cpp

Issue 22839016: Skeleton of DM (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: one last sync Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dm/DMComparisonTask.h ('k') | dm/DMCpuTask.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMComparisonTask.cpp
diff --git a/dm/DMComparisonTask.cpp b/dm/DMComparisonTask.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..f4f742c921077da558e0cad60cc6ea5569fcd0c1
--- /dev/null
+++ b/dm/DMComparisonTask.cpp
@@ -0,0 +1,22 @@
+#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() {
+ const skiagm::GmResultDigest digest(fBitmap);
+ if (!meetsExpectations(fExpectations, digest)) {
+ this->fail();
+ }
+}
+
+} // namespace DM
« no previous file with comments | « dm/DMComparisonTask.h ('k') | dm/DMCpuTask.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698