diff options
author | piotaixr <piotaixr@chromium.org> | 2014-09-03 12:34:57 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-03 12:34:57 -0700 |
commit | 91cab830c81025e0af800b528bed582ea6e4d3d7 (patch) | |
tree | a1defe37c0ed4dd583f237afba155031bdf0ae09 /src | |
parent | e5ea500d4714a7d84de2bf913e81be3b65d2de68 (diff) |
Remove SkBitmapCache::Find/Add(_,width,height,_)
in favor of the versions having a SkIRect as input parameter
BUG=skia:2909
R=reed@google.com, junov@chromium.org
Author: piotaixr@chromium.org
Review URL: https://codereview.chromium.org/539643002
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkBitmapCache.cpp | 8 | ||||
-rw-r--r-- | src/core/SkBitmapCache.h | 13 | ||||
-rw-r--r-- | src/lazy/SkCachingPixelRef.cpp | 9 |
3 files changed, 7 insertions, 23 deletions
diff --git a/src/core/SkBitmapCache.cpp b/src/core/SkBitmapCache.cpp index 280a18902c..c954a3099e 100644 --- a/src/core/SkBitmapCache.cpp +++ b/src/core/SkBitmapCache.cpp @@ -100,14 +100,6 @@ void SkBitmapCache::Add(const SkBitmap& src, SkScalar invScaleX, SkScalar invSca get_bounds_from_bitmap(src), result))); } -bool SkBitmapCache::Find(uint32_t genID, int width, int height, SkBitmap* result) { - return Find(genID, SkIRect::MakeWH(width, height), result); -} - -bool SkBitmapCache::Add(uint32_t genID, int width, int height, const SkBitmap& result) { - return Add(genID, SkIRect::MakeWH(width, height), result); -} - bool SkBitmapCache::Find(uint32_t genID, const SkIRect& subset, SkBitmap* result) { BitmapKey key(genID, SK_Scalar1, SK_Scalar1, subset); return find_and_return(key, result); diff --git a/src/core/SkBitmapCache.h b/src/core/SkBitmapCache.h index cd644fff03..aec7a7d41c 100644 --- a/src/core/SkBitmapCache.h +++ b/src/core/SkBitmapCache.h @@ -34,19 +34,6 @@ public: const SkBitmap& result); /** - * Search based on the bitmap's genID, width, height. If found, returns true and - * result will be set to the matching bitmap with its pixels already locked. - */ - static bool Find(uint32_t genID, int width, int height, SkBitmap* result); - - /** - * The width and the height provided for the key must be the same as the result bitmap ones. - * - * result must be marked isImmutable() - */ - static bool Add(uint32_t genID, int width, int height, const SkBitmap& result); - - /** * Search based on the bitmap's genID and subset. If found, returns true and * result will be set to the matching bitmap with its pixels already locked. */ diff --git a/src/lazy/SkCachingPixelRef.cpp b/src/lazy/SkCachingPixelRef.cpp index aeaa412508..1459567e0b 100644 --- a/src/lazy/SkCachingPixelRef.cpp +++ b/src/lazy/SkCachingPixelRef.cpp @@ -7,6 +7,7 @@ #include "SkCachingPixelRef.h" #include "SkBitmapCache.h" +#include "SkRect.h" bool SkCachingPixelRef::Install(SkImageGenerator* generator, SkBitmap* dst) { @@ -44,7 +45,9 @@ bool SkCachingPixelRef::onNewLockPixels(LockRec* rec) { } const SkImageInfo& info = this->info(); - if (!SkBitmapCache::Find(this->getGenerationID(), info.width(), info.height(), &fLockedBitmap)) { + if (!SkBitmapCache::Find(this->getGenerationID(), + SkIRect::MakeWH(info.width(), info.height()), + &fLockedBitmap)) { // Cache has been purged, must re-decode. if (!fLockedBitmap.tryAllocPixels(info, fRowBytes)) { fErrorInDecoding = true; @@ -55,7 +58,9 @@ bool SkCachingPixelRef::onNewLockPixels(LockRec* rec) { return false; } fLockedBitmap.setImmutable(); - SkBitmapCache::Add(this->getGenerationID(), info.width(), info.height(), fLockedBitmap); + SkBitmapCache::Add(this->getGenerationID(), + SkIRect::MakeWH(info.width(), info.height()), + fLockedBitmap); } // Now bitmap should contain a concrete PixelRef of the decoded image. |