diff options
author | skia.committer@gmail.com <skia.committer@gmail.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-07-24 07:01:12 +0000 |
---|---|---|
committer | skia.committer@gmail.com <skia.committer@gmail.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-07-24 07:01:12 +0000 |
commit | 7f1af501f206da48a7ff791af53432c9c1c89d08 (patch) | |
tree | c9e509777ae10df81df94787f2347ed3cbe8e75e /src | |
parent | a7aa810894ae85306541ed949848a4dd7f907a0b (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')
-rw-r--r-- | src/core/SkBitmapProcState.cpp | 4 | ||||
-rw-r--r-- | src/core/SkScaledImageCache.cpp | 23 | ||||
-rw-r--r-- | src/core/SkScaledImageCache.h | 4 | ||||
-rw-r--r-- | src/image/SkImagePriv.cpp | 6 | ||||
-rw-r--r-- | src/image/SkImage_Base.h | 2 | ||||
-rw-r--r-- | src/image/SkImage_Codec.cpp | 2 |
6 files changed, 20 insertions, 21 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 diff --git a/src/image/SkImagePriv.cpp b/src/image/SkImagePriv.cpp index 4ff1c92bff..ca4a12cdcf 100644 --- a/src/image/SkImagePriv.cpp +++ b/src/image/SkImagePriv.cpp @@ -143,8 +143,8 @@ void SkImagePrivDrawPicture(SkCanvas* canvas, SkPicture* picture, } void SkImagePrivDrawPicture(SkCanvas* canvas, SkPicture* picture, - const SkRect* src, const SkRect& dst, const SkPaint* paint) { - int saveCount = canvas->getSaveCount(); + const SkRect* src, const SkRect& dst, const SkPaint* paint) { + int saveCount = canvas->getSaveCount(); SkMatrix matrix; SkRect tmpSrc; @@ -167,7 +167,7 @@ void SkImagePrivDrawPicture(SkCanvas* canvas, SkPicture* picture, if (!paint || !needs_layer(*paint)) { canvas->clipRect(tmpSrc); } - + canvas->drawPicture(*picture); canvas->restoreToCount(saveCount); } diff --git a/src/image/SkImage_Base.h b/src/image/SkImage_Base.h index 431444dadb..7bd1f7e6c9 100644 --- a/src/image/SkImage_Base.h +++ b/src/image/SkImage_Base.h @@ -15,7 +15,7 @@ public: SkImage_Base(int width, int height) : INHERITED(width, height) {} virtual void onDraw(SkCanvas*, SkScalar x, SkScalar y, const SkPaint*) = 0; - virtual void onDrawRectToRect(SkCanvas*, const SkRect* src, + virtual void onDrawRectToRect(SkCanvas*, const SkRect* src, const SkRect& dst, const SkPaint*) = 0; virtual GrTexture* onGetTexture() { return NULL; } diff --git a/src/image/SkImage_Codec.cpp b/src/image/SkImage_Codec.cpp index b9a8990838..64f58a6aef 100644 --- a/src/image/SkImage_Codec.cpp +++ b/src/image/SkImage_Codec.cpp @@ -49,7 +49,7 @@ void SkImage_Codec::onDraw(SkCanvas* canvas, SkScalar x, SkScalar y, const SkPai canvas->drawBitmap(fBitmap, x, y, paint); } -void SkImage_Codec::onDrawRectToRect(SkCanvas* canvas, const SkRect* src, +void SkImage_Codec::onDrawRectToRect(SkCanvas* canvas, const SkRect* src, const SkRect& dst, const SkPaint* paint) { if (!fBitmap.pixelRef()) { if (!SkImageDecoder::DecodeMemory(fEncodedData->bytes(), fEncodedData->size(), |