aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/sk_tool_utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/sk_tool_utils.h')
-rw-r--r--tools/sk_tool_utils.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/sk_tool_utils.h b/tools/sk_tool_utils.h
index ea06c119e7..dc8c8c10a0 100644
--- a/tools/sk_tool_utils.h
+++ b/tools/sk_tool_utils.h
@@ -91,6 +91,17 @@ namespace sk_tool_utils {
*/
void write_pixels(SkCanvas*, const SkBitmap&, int x, int y, SkColorType, SkAlphaType);
+ /**
+ * Returns true iff all of the pixels between the two images differ by <= the maxDiff value
+ * per component.
+ *
+ * If the configs differ, return false.
+ *
+ * If the colorType is half-float, then maxDiff is interpreted as 0..255 --> 0..1
+ */
+ bool equal_pixels(const SkPixmap&, const SkPixmap&, unsigned maxDiff = 0);
+ bool equal_pixels(const SkBitmap&, const SkBitmap&, unsigned maxDiff = 0);
+
// private to sk_tool_utils
sk_sp<SkTypeface> create_font(const char* name, SkFontStyle);