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

Unified Diff: src/utils/SkBitmapHasher.h

Issue 14170010: rename SkBitmapChecksummer as SkBitmapHasher, and prepare for it to possibly use (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: sync_to_r8638 Created 7 years, 8 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/SkBitmapChecksummer.cpp ('k') | src/utils/SkBitmapHasher.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkBitmapHasher.h
===================================================================
--- src/utils/SkBitmapHasher.h (revision 8614)
+++ src/utils/SkBitmapHasher.h (working copy)
@@ -6,32 +6,37 @@
* found in the LICENSE file.
*/
-#ifndef SkBitmapChecksummer_DEFINED
-#define SkBitmapChecksummer_DEFINED
+#ifndef SkBitmapHasher_DEFINED
+#define SkBitmapHasher_DEFINED
#include "SkBitmap.h"
#include "SkBitmapTransformer.h"
+// TODO(epoger): Soon, SkHashDigest will become a real class of its own,
+// and callers won't be able to assume it converts to/from a uint64_t.
+typedef uint64_t SkHashDigest;
+
/**
- * Static class that can generate checksums from SkBitmaps.
+ * Static class that can generate an SkHashDigest from an SkBitmap.
*/
-class SkBitmapChecksummer {
+class SkBitmapHasher {
public:
/**
- * Returns a 64-bit checksum of the pixels in this bitmap.
+ * Fills in "result" with a hash of the pixels in this bitmap.
*
- * If this is unable to compute the checksum for some reason,
- * it returns 0.
+ * If this is unable to compute the hash for some reason,
+ * it returns false.
*
* Note: depending on the bitmap config, we may need to create an
* intermediate SkBitmap and copy the pixels over to it... so in some
* cases, performance and memory usage can suffer.
*/
- static uint64_t Compute64(const SkBitmap& bitmap);
+ static bool ComputeDigest(const SkBitmap& bitmap, SkHashDigest *result);
private:
- static uint64_t Compute64Internal(const SkBitmap& bitmap,
- const SkBitmapTransformer& transformer);
+ static bool ComputeDigestInternal(const SkBitmap& bitmap,
+ const SkBitmapTransformer& transformer,
+ SkHashDigest *result);
};
#endif
« no previous file with comments | « src/utils/SkBitmapChecksummer.cpp ('k') | src/utils/SkBitmapHasher.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698