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

Unified Diff: experimental/skpdiff/SkImageDiffer.cpp

Issue 16284007: add skpdiff tool to compare bitmaps (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: add commmand line opts Created 7 years, 6 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 | « experimental/skpdiff/SkImageDiffer.h ('k') | experimental/skpdiff/diff_pixels.cl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/skpdiff/SkImageDiffer.cpp
diff --git a/experimental/skpdiff/SkImageDiffer.cpp b/experimental/skpdiff/SkImageDiffer.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..41be949ac6417f13a44d3339c1c42a4047224da8
--- /dev/null
+++ b/experimental/skpdiff/SkImageDiffer.cpp
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2013 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include <cstring>
+
+#include "SkBitmap.h"
+#include "SkImageDecoder.h"
+
+#include "SkImageDiffer.h"
+
+#include "skpdiff_util.h"
+
+
+SkImageDiffer::SkImageDiffer()
+ : fIsGood(true) {
+
+}
+
+SkImageDiffer::~SkImageDiffer() {
+
+}
+
+int SkImageDiffer::queueDiffOfFile(const char baseline[], const char test[]) {
+ SkBitmap baselineBitmap;
+ SkBitmap testBitmap;
+ if (!SkImageDecoder::DecodeFile(baseline, &baselineBitmap)) {
+ SkDebugf("Failed to load bitmap \"%s\"\n", baseline);
+ return -1;
+ }
+ if (!SkImageDecoder::DecodeFile(test, &testBitmap)) {
+ SkDebugf("Failed to load bitmap \"%s\"\n", test);
+ return -1;
+ }
+ return this->queueDiff(&baselineBitmap, &testBitmap);
+}
« no previous file with comments | « experimental/skpdiff/SkImageDiffer.h ('k') | experimental/skpdiff/diff_pixels.cl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698