OLD | NEW |
1 #include "DMUtil.h" | 1 #include "DMUtil.h" |
2 | 2 |
3 #include "SkColorPriv.h" | 3 #include "SkColorPriv.h" |
4 #include "SkPicture.h" | 4 #include "SkPicture.h" |
5 #include "SkPictureRecorder.h" | 5 #include "SkPictureRecorder.h" |
6 | 6 |
7 namespace DM { | 7 namespace DM { |
8 | 8 |
9 SkString UnderJoin(const char* a, const char* b) { | 9 SkString UnderJoin(const char* a, const char* b) { |
10 SkString s; | 10 SkString s; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 const uint8_t* bBytes = (const uint8_t*)b.getPixels(); | 77 const uint8_t* bBytes = (const uint8_t*)b.getPixels(); |
78 for (size_t i = 0; i < a.getSize(); i++) { | 78 for (size_t i = 0; i < a.getSize(); i++) { |
79 max = SkTMax(max, abs_diff(aBytes[i], bBytes[i])); | 79 max = SkTMax(max, abs_diff(aBytes[i], bBytes[i])); |
80 } | 80 } |
81 } | 81 } |
82 | 82 |
83 return max; | 83 return max; |
84 } | 84 } |
85 | 85 |
86 bool BitmapsEqual(const SkBitmap& a, const SkBitmap& b) { | 86 bool BitmapsEqual(const SkBitmap& a, const SkBitmap& b) { |
87 return a.info() == b.info() && 0 == MaxComponentDifference(a, b); | 87 if (a.info() != b.info()) { |
| 88 return false; |
| 89 } |
| 90 const SkAutoLockPixels lockA(a), lockB(b); |
| 91 return 0 == memcmp(a.getPixels(), b.getPixels(), a.getSize()); |
88 } | 92 } |
89 | 93 |
90 } // namespace DM | 94 } // namespace DM |
OLD | NEW |