add tool_util to compare images
Bug: skia:
Change-Id: I826190aa15cf42a3ca7f3c7d5271ead5b514c116
Reviewed-on: https://skia-review.googlesource.com/32220
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp
index 93389b3..b8492d2 100644
--- a/tests/ImageFilterTest.cpp
+++ b/tests/ImageFilterTest.cpp
@@ -38,6 +38,7 @@
#include "SkTileImageFilter.h"
#include "SkXfermodeImageFilter.h"
#include "Test.h"
+#include "sk_tool_utils.h"
#if SK_SUPPORT_GPU
#include "GrContext.h"
@@ -749,12 +750,9 @@
}
untiledCanvas.flush();
tiledCanvas.flush();
- for (int y = 0; y < height; y++) {
- int diffs = memcmp(untiledResult.getAddr32(0, y), tiledResult.getAddr32(0, y), untiledResult.rowBytes());
- REPORTER_ASSERT_MESSAGE(reporter, !diffs, filters.getName(i));
- if (diffs) {
- break;
- }
+ if (!sk_tool_utils::equal_pixels(untiledResult, tiledResult, 0)) {
+ REPORTER_ASSERT_MESSAGE(reporter, false, filters.getName(i));
+ break;
}
}
}