diff options
author | skia.committer@gmail.com <skia.committer@gmail.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-07-26 07:00:58 +0000 |
---|---|---|
committer | skia.committer@gmail.com <skia.committer@gmail.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-07-26 07:00:58 +0000 |
commit | 956b310f13c7412c035406c658ff16ca85eac656 (patch) | |
tree | 5c9e6381cab42b6fb3982aa7e96babac18e7a5d7 /src/core | |
parent | a260e2e4e7a7a5bbf45ec4dc5d3211be478ac4e2 (diff) |
Sanitizing source files in Housekeeper-Nightly
git-svn-id: http://skia.googlecode.com/svn/trunk@10385 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkBitmapProcShader.cpp | 2 | ||||
-rw-r--r-- | src/core/SkScaledImageCache.cpp | 2 | ||||
-rw-r--r-- | src/core/SkTDynamicHash.h | 24 |
3 files changed, 14 insertions, 14 deletions
diff --git a/src/core/SkBitmapProcShader.cpp b/src/core/SkBitmapProcShader.cpp index 9486d7a15a..0e7ac6a277 100644 --- a/src/core/SkBitmapProcShader.cpp +++ b/src/core/SkBitmapProcShader.cpp @@ -380,7 +380,7 @@ GrEffectRef* SkBitmapProcShader::asNewEffect(GrContext* context, const SkPaint& "MIPMaps."); textureFilterMode = GrTextureParams::kMipMap_FilterMode; break; - + } GrTextureParams params(tm, textureFilterMode); GrTexture* texture = GrLockAndRefCachedBitmapTexture(context, fRawBitmap, ¶ms); diff --git a/src/core/SkScaledImageCache.cpp b/src/core/SkScaledImageCache.cpp index 4afa98fc14..45c7344007 100644 --- a/src/core/SkScaledImageCache.cpp +++ b/src/core/SkScaledImageCache.cpp @@ -324,7 +324,7 @@ void SkScaledImageCache::purgeAsNeeded() { #ifdef USE_HASH fHash->remove(rec->fKey); #endif - + SkDELETE(rec); fCount -= 1; } diff --git a/src/core/SkTDynamicHash.h b/src/core/SkTDynamicHash.h index b4787fb89e..823fde8db1 100644 --- a/src/core/SkTDynamicHash.h +++ b/src/core/SkTDynamicHash.h @@ -19,7 +19,7 @@ private: int fCapacity; int fCountUsed; int fCountDeleted; - + const T* deletedValue() const { return reinterpret_cast<const T*>(-1); } uint32_t hashMask() const { return fCapacity - 1; } int hashToIndex(uint32_t hash) const { @@ -37,13 +37,13 @@ public: sk_free(fArray); } } - + T* find(const KEY& key) { const T* const deleted = this->deletedValue(); const unsigned mask = this->hashMask(); int index = this->hashToIndex(HASH_FROM_KEY(key)); int delta = 1; - + do { T* candidate = fArray[index]; if (NULL == candidate) { @@ -57,14 +57,14 @@ public: } while (delta <= fCapacity); return NULL; } - + bool add(const KEY& key, T* newElement, bool autoGrow = true) { const T* const deleted = this->deletedValue(); for (;;) { const unsigned mask = this->hashMask(); int index = this->hashToIndex(HASH_FROM_KEY(key)); int delta = 1; - + do { const T* candidate = fArray[index]; if (NULL == candidate || deleted == candidate) { @@ -88,13 +88,13 @@ public: SkASSERT(!"never get here"); return false; } - + void remove(const KEY& key) { const T* const deleted = this->deletedValue(); const unsigned mask = this->hashMask(); int index = this->hashToIndex(HASH_FROM_KEY(key)); int delta = 1; - + for (;;) { const T* candidate = fArray[index]; SkASSERT(candidate); @@ -110,7 +110,7 @@ public: } this->checkStrink(); } - + private: int countCollisions(const Key& key) const { const T* const deleted = this->deletedValue(); @@ -147,17 +147,17 @@ private: #endif int oldCapacity = fCapacity; T** oldArray = fArray; - + int newCapacity = oldCapacity << 1; T** newArray = (T**)sk_malloc_throw(sizeof(T*) * newCapacity); sk_bzero(newArray, sizeof(T*) * newCapacity); - + SkDEBUGCODE(int oldCountUsed = fCountUsed;) fArray = newArray; fCapacity = newCapacity; fCountUsed = 0; fCountDeleted = 0; - + for (int i = 0; i < oldCapacity; ++i) { T* elem = oldArray[i]; if (NULL == elem || deleted == elem) { @@ -172,7 +172,7 @@ private: sk_free(oldArray); } } - + void checkStrink() { // todo: based on density and deadspace (fCountDeleted), consider // shrinking fArray and repopulating it. |