aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar epoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-05-08 14:49:50 +0000
committerGravatar epoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-05-08 14:49:50 +0000
commitaaf7343e16c4bf9f9c6f07968689669fe6ba71d7 (patch)
treeb1de9d98fbedfe025db75eeab526f31eb6a680c6 /src
parent0a01f5a2c44f3d6a7fa2d3c837f46894d9b29e5d (diff)
Remove third-party cityhash, unused since r8992
R=djsollen@google.com Review URL: https://codereview.chromium.org/15027013 git-svn-id: http://skia.googlecode.com/svn/trunk@9059 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r--src/utils/SkBitmapHasher.cpp18
-rw-r--r--src/utils/SkBitmapHasher.h2
-rw-r--r--src/utils/SkCityHash.cpp23
-rw-r--r--src/utils/SkCityHash.h47
-rw-r--r--src/utils/cityhash/README2
-rw-r--r--src/utils/cityhash/config.h17
6 files changed, 0 insertions, 109 deletions
diff --git a/src/utils/SkBitmapHasher.cpp b/src/utils/SkBitmapHasher.cpp
index 82cbe9fa7e..5342d18d10 100644
--- a/src/utils/SkBitmapHasher.cpp
+++ b/src/utils/SkBitmapHasher.cpp
@@ -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,16 +32,7 @@ static inline uint64_t first_8_bytes_as_uint64(const uint8_t *bytearray) {
/*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);
@@ -58,13 +44,9 @@ static inline uint64_t first_8_bytes_as_uint64(const uint8_t *bytearray) {
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;
}
diff --git a/src/utils/SkBitmapHasher.h b/src/utils/SkBitmapHasher.h
index c99421a8d6..165da3dcc8 100644
--- a/src/utils/SkBitmapHasher.h
+++ b/src/utils/SkBitmapHasher.h
@@ -11,8 +11,6 @@
#include "SkBitmap.h"
-#define BITMAPHASHER_USES_TRUNCATED_MD5
-
// 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;
diff --git a/src/utils/SkCityHash.cpp b/src/utils/SkCityHash.cpp
deleted file mode 100644
index a21aa89634..0000000000
--- a/src/utils/SkCityHash.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright 2012 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-/**
- * Pass any calls through to the CityHash library.
- * This is the only source file that accesses the CityHash code directly.
- */
-
-#include "SkCityHash.h"
-#include "SkTypes.h"
-#include "city.h"
-
-uint32_t SkCityHash::Compute32(const char *data, size_t size) {
- return CityHash32(data, size);
-}
-
-uint64_t SkCityHash::Compute64(const char *data, size_t size) {
- return CityHash64(data, size);
-}
diff --git a/src/utils/SkCityHash.h b/src/utils/SkCityHash.h
deleted file mode 100644
index c69e0fb37b..0000000000
--- a/src/utils/SkCityHash.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2012 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-/**
- * Hash functions, using the CityHash algorithm.
- *
- * Results are guaranteed to be:
- * 1. consistent across revisions of the library (for a given set
- * of bytes, the checksum generated at one revision of the Skia
- * library will match the one generated on any other revision of
- * the Skia library)
- * 2. consistent across platforms (for a given
- * set of bytes, the checksum generated on one platform will
- * match the one generated on any other platform)
- */
-
-#ifndef SkCityHash_DEFINED
-#define SkCityHash_DEFINED
-
-#include "SkTypes.h"
-
-class SkCityHash : SkNoncopyable {
-public:
- /**
- * Compute a 32-bit checksum for a given data block.
- *
- * @param data Memory address of the data block to be processed.
- * @param size Size of the data block in bytes.
- * @return checksum result
- */
- static uint32_t Compute32(const char *data, size_t size);
-
- /**
- * Compute a 64-bit checksum for a given data block.
- *
- * @param data Memory address of the data block to be processed.
- * @param size Size of the data block in bytes.
- * @return checksum result
- */
- static uint64_t Compute64(const char *data, size_t size);
-};
-
-#endif
diff --git a/src/utils/cityhash/README b/src/utils/cityhash/README
deleted file mode 100644
index d93928857f..0000000000
--- a/src/utils/cityhash/README
+++ /dev/null
@@ -1,2 +0,0 @@
-This directory contains files needed to build third_party/externals/cityhash
-(such as the config.h file that would normally be created by autoconf)
diff --git a/src/utils/cityhash/config.h b/src/utils/cityhash/config.h
deleted file mode 100644
index bd3641658e..0000000000
--- a/src/utils/cityhash/config.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright 2012 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-/**
- * Converts from Skia build flags to the macro definitions cityhash normally
- * gets from autoconf.
- */
-
-#include "SkTypes.h"
-
-#ifdef SK_CPU_BENDIAN
- #define WORDS_BIGENDIAN 1
-#endif