aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar skia.committer@gmail.com <skia.committer@gmail.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-07-24 07:01:12 +0000
committerGravatar skia.committer@gmail.com <skia.committer@gmail.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-07-24 07:01:12 +0000
commit7f1af501f206da48a7ff791af53432c9c1c89d08 (patch)
treec9e509777ae10df81df94787f2347ed3cbe8e75e /src/core
parenta7aa810894ae85306541ed949848a4dd7f907a0b (diff)
Sanitizing source files in Housekeeper-Nightly
git-svn-id: http://skia.googlecode.com/svn/trunk@10299 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core')
-rw-r--r--src/core/SkBitmapProcState.cpp4
-rw-r--r--src/core/SkScaledImageCache.cpp23
-rw-r--r--src/core/SkScaledImageCache.h4
3 files changed, 15 insertions, 16 deletions
diff --git a/src/core/SkBitmapProcState.cpp b/src/core/SkBitmapProcState.cpp
index f880a86196..ab3babaad7 100644
--- a/src/core/SkBitmapProcState.cpp
+++ b/src/core/SkBitmapProcState.cpp
@@ -145,7 +145,7 @@ void SkBitmapProcState::possiblyScaleImage() {
SkScalar invScaleX = fInvMatrix.getScaleX();
SkScalar invScaleY = fInvMatrix.getScaleY();
-
+
SkASSERT(NULL == fScaledCacheID);
fScaledCacheID = SkScaledImageCache::FindAndLock(fOrigBitmap,
invScaleX, invScaleY,
@@ -250,7 +250,7 @@ void SkBitmapProcState::endContext() {
SkDELETE(fBitmapFilter);
fBitmapFilter = NULL;
fScaledBitmap.reset();
-
+
if (fScaledCacheID) {
SkScaledImageCache::Unlock(fScaledCacheID);
fScaledCacheID = NULL;
diff --git a/src/core/SkScaledImageCache.cpp b/src/core/SkScaledImageCache.cpp
index 993b81bbdf..8d7b81bf3e 100644
--- a/src/core/SkScaledImageCache.cpp
+++ b/src/core/SkScaledImageCache.cpp
@@ -17,26 +17,26 @@
// Implemented from en.wikipedia.org/wiki/MurmurHash.
static uint32_t compute_hash(const uint32_t data[], int count) {
uint32_t hash = 0;
-
+
for (int i = 0; i < count; ++i) {
uint32_t k = data[i];
k *= 0xcc9e2d51;
k = (k << 15) | (k >> 17);
k *= 0x1b873593;
-
+
hash ^= k;
hash = (hash << 13) | (hash >> 19);
hash *= 5;
hash += 0xe6546b64;
}
-
+
// hash ^= size;
hash ^= hash >> 16;
hash *= 0x85ebca6b;
hash ^= hash >> 13;
hash *= 0xc2b2ae35;
hash ^= hash >> 16;
-
+
return hash;
}
#else
@@ -46,7 +46,7 @@ static uint32_t mix(uint32_t a, uint32_t b) {
static uint32_t compute_hash(const uint32_t data[], int count) {
uint32_t hash = 0;
-
+
for (int i = 0; i < count; ++i) {
hash = mix(hash, data[i]);
}
@@ -219,7 +219,7 @@ void SkScaledImageCache::unlock(SkScaledImageCache::ID* id) {
void SkScaledImageCache::purgeAsNeeded() {
size_t byteLimit = fByteLimit;
size_t bytesUsed = fBytesUsed;
-
+
Rec* rec = fTail;
while (rec) {
if (bytesUsed < byteLimit) {
@@ -254,20 +254,20 @@ size_t SkScaledImageCache::setByteLimit(size_t newLimit) {
void SkScaledImageCache::detach(Rec* rec) {
Rec* prev = rec->fPrev;
Rec* next = rec->fNext;
-
+
if (!prev) {
SkASSERT(fHead == rec);
fHead = next;
} else {
prev->fNext = next;
}
-
+
if (!next) {
fTail = prev;
} else {
next->fPrev = prev;
}
-
+
rec->fNext = rec->fPrev = NULL;
}
@@ -286,7 +286,7 @@ void SkScaledImageCache::moveToHead(Rec* rec) {
fHead->fPrev = rec;
rec->fNext = fHead;
fHead = rec;
-
+
this->validate();
}
@@ -347,7 +347,7 @@ void SkScaledImageCache::validate() const {
used -= rec->bytesUsed();
rec = rec->fPrev;
}
-
+
SkASSERT(0 == count);
SkASSERT(0 == used);
}
@@ -418,4 +418,3 @@ size_t SkGraphics::GetImageCacheByteLimit() {
size_t SkGraphics::SetImageCacheByteLimit(size_t newLimit) {
return SkScaledImageCache::SetByteLimit(newLimit);
}
-
diff --git a/src/core/SkScaledImageCache.h b/src/core/SkScaledImageCache.h
index 6802043150..3d85ce37a2 100644
--- a/src/core/SkScaledImageCache.h
+++ b/src/core/SkScaledImageCache.h
@@ -45,7 +45,7 @@ public:
SkScaledImageCache(size_t byteLimit);
~SkScaledImageCache();
-
+
/**
* Search the cache for a scaled version of original. If found, return it
* in scaled, and return its ID pointer. Use the returned ptr to unlock
@@ -74,7 +74,7 @@ public:
size_t getBytesUsed() const { return fBytesUsed; }
size_t getByteLimit() const { return fByteLimit; }
-
+
/**
* Set the maximum number of bytes available to this cache. If the current
* cache exceeds this new value, it will be purged to try to fit within