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

Unified Diff: dm/DMUtil.cpp

Issue 315743002: DM: go back to memcmp for BitmapsEqual (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMUtil.cpp
diff --git a/dm/DMUtil.cpp b/dm/DMUtil.cpp
index d7d6691550b2113b4991d157c68d9155f8a7e453..f142d47dda23f506b7fcc2b546ca2281fcacc256 100644
--- a/dm/DMUtil.cpp
+++ b/dm/DMUtil.cpp
@@ -84,7 +84,11 @@ unsigned MaxComponentDifference(const SkBitmap& a, const SkBitmap& b) {
}
bool BitmapsEqual(const SkBitmap& a, const SkBitmap& b) {
- return a.info() == b.info() && 0 == MaxComponentDifference(a, b);
+ if (a.info() != b.info()) {
+ return false;
+ }
+ const SkAutoLockPixels lockA(a), lockB(b);
+ return 0 == memcmp(a.getPixels(), b.getPixels(), a.getSize());
}
} // namespace DM
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698