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

Side by Side Diff: src/utils/SkBitmapHasher.h

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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gyp/utils.gyp ('k') | src/utils/SkBitmapHasher.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #ifndef SkBitmapHasher_DEFINED 9 #ifndef SkBitmapHasher_DEFINED
10 #define SkBitmapHasher_DEFINED 10 #define SkBitmapHasher_DEFINED
11 11
12 #include "SkBitmap.h" 12 #include "SkBitmap.h"
13 13
14 #define BITMAPHASHER_USES_TRUNCATED_MD5
15
16 // TODO(epoger): Soon, SkHashDigest will become a real class of its own, 14 // TODO(epoger): Soon, SkHashDigest will become a real class of its own,
17 // and callers won't be able to assume it converts to/from a uint64_t. 15 // and callers won't be able to assume it converts to/from a uint64_t.
18 typedef uint64_t SkHashDigest; 16 typedef uint64_t SkHashDigest;
19 17
20 /** 18 /**
21 * Static class that can generate an SkHashDigest from an SkBitmap. 19 * Static class that can generate an SkHashDigest from an SkBitmap.
22 */ 20 */
23 class SkBitmapHasher { 21 class SkBitmapHasher {
24 public: 22 public:
25 /** 23 /**
26 * Fills in "result" with a hash of the pixels in this bitmap. 24 * Fills in "result" with a hash of the pixels in this bitmap.
27 * 25 *
28 * If this is unable to compute the hash for some reason, 26 * If this is unable to compute the hash for some reason,
29 * it returns false. 27 * it returns false.
30 * 28 *
31 * Note: depending on the bitmap config, we may need to create an 29 * Note: depending on the bitmap config, we may need to create an
32 * intermediate SkBitmap and copy the pixels over to it... so in some 30 * intermediate SkBitmap and copy the pixels over to it... so in some
33 * cases, performance and memory usage can suffer. 31 * cases, performance and memory usage can suffer.
34 */ 32 */
35 static bool ComputeDigest(const SkBitmap& bitmap, SkHashDigest *result); 33 static bool ComputeDigest(const SkBitmap& bitmap, SkHashDigest *result);
36 34
37 private: 35 private:
38 static bool ComputeDigestInternal(const SkBitmap& bitmap, SkHashDigest *resu lt); 36 static bool ComputeDigestInternal(const SkBitmap& bitmap, SkHashDigest *resu lt);
39 }; 37 };
40 38
41 #endif 39 #endif
OLDNEW
« no previous file with comments | « gyp/utils.gyp ('k') | src/utils/SkBitmapHasher.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698