Index: tools/skpdiff/SkImageDiffer.h |
diff --git a/tools/skpdiff/SkImageDiffer.h b/tools/skpdiff/SkImageDiffer.h |
index 641bbe8f8f863b4610348b5b41573564e21fc88b..1f9ffd1886b52e5eb2feba7f1b0c5ab32c8adfd1 100644 |
--- a/tools/skpdiff/SkImageDiffer.h |
+++ b/tools/skpdiff/SkImageDiffer.h |
@@ -24,10 +24,30 @@ public: |
struct Result { |
double result; |
int poiCount; |
+ // TODO(djsollen): Figure out a way that the differ can report which of the |
+ // optional fields it has filled in. See http://skbug.com/2712 ('allow |
+ // skpdiff to report different sets of result fields for different comparison algorithms') |
SkBitmap poiAlphaMask; // optional |
+ SkBitmap rgbDiffBitmap; // optional |
+ SkBitmap whiteDiffBitmap; // optional |
+ int maxRedDiff; // optional |
+ int maxGreenDiff; // optional |
+ int maxBlueDiff; // optional |
double timeElapsed; // optional |
}; |
+ // A bitfield indicating which bitmap types we want a differ to create. |
+ // |
+ // TODO(epoger): Remove whiteDiffBitmap, because alphaMask can provide |
+ // the same functionality and more. |
+ // It will be a little bit tricky, because the rebaseline_server client |
+ // and server side code will both need to change to use the alphaMask. |
+ struct BitmapsToCreate { |
+ bool alphaMask; |
+ bool rgbDiff; |
+ bool whiteDiff; |
+ }; |
+ |
/** |
* Gets a unique and descriptive name of this differ |
* @return A statically allocated null terminated string that is the name of this differ |
@@ -43,10 +63,10 @@ public: |
* diff on a pair of bitmaps. |
* @param baseline The correct bitmap |
* @param test The bitmap whose difference is being tested |
- * @param computeMask true if the differ is to attempt to create poiAlphaMask |
+ * @param bitmapsToCreate Which bitmaps the differ should attempt to create |
* @return true on success, and false in the case of failure |
*/ |
- virtual bool diff(SkBitmap* baseline, SkBitmap* test, bool computeMask, |
+ virtual bool diff(SkBitmap* baseline, SkBitmap* test, const BitmapsToCreate& bitmapsToCreate, |
Result* result) const = 0; |
}; |