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

Unified Diff: src/utils/SkBitmapHasher.cpp

Issue 15060008: Re-land r9059 with empty cityhash.gyp, instead of deleted cityhash.gyp (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 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 | « src/utils/SkBitmapHasher.h ('k') | src/utils/SkCityHash.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkBitmapHasher.cpp
===================================================================
--- src/utils/SkBitmapHasher.cpp (revision 9063)
+++ src/utils/SkBitmapHasher.cpp (working copy)
@@ -10,12 +10,7 @@
#include "SkEndian.h"
#include "SkImageEncoder.h"
-#ifdef BITMAPHASHER_USES_TRUNCATED_MD5
#include "SkMD5.h"
-#else
-#include "SkCityHash.h"
-#include "SkStream.h"
-#endif
/**
* Write an int32 value to a stream in little-endian order.
@@ -37,17 +32,8 @@
/*static*/ bool SkBitmapHasher::ComputeDigestInternal(const SkBitmap& bitmap,
SkHashDigest *result) {
-#ifdef BITMAPHASHER_USES_TRUNCATED_MD5
SkMD5 out;
-#else
- size_t pixelBufferSize = bitmap.width() * bitmap.height() * 4;
- size_t totalBufferSize = pixelBufferSize + 2 * sizeof(uint32_t);
- SkAutoMalloc bufferManager(totalBufferSize);
- char *bufferStart = static_cast<char *>(bufferManager.get());
- SkMemoryWStream out(bufferStart, totalBufferSize);
-#endif
-
// start with the x/y dimensions
write_int32_to_buffer(SkToU32(bitmap.width()), &out);
write_int32_to_buffer(SkToU32(bitmap.height()), &out);
@@ -58,13 +44,9 @@
return false;
}
-#ifdef BITMAPHASHER_USES_TRUNCATED_MD5
SkMD5::Digest digest;
out.finish(digest);
*result = first_8_bytes_as_uint64(digest.data);
-#else
- *result = SkCityHash::Compute64(bufferStart, totalBufferSize);
-#endif
return true;
}
« no previous file with comments | « src/utils/SkBitmapHasher.h ('k') | src/utils/SkCityHash.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698