Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Unified Diff: src/core/SkBitmapProcState.cpp

Issue 511283002: rename ScaledImageCache to ResourceCache (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkBitmapProcState.h ('k') | src/core/SkResourceCache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmapProcState.cpp
diff --git a/src/core/SkBitmapProcState.cpp b/src/core/SkBitmapProcState.cpp
index 7640573596c5d5bdfe2c4fdb6c541e22ffa8a092..52a2ecf25ce1e359107964d2752c87cf43b0f796 100644
--- a/src/core/SkBitmapProcState.cpp
+++ b/src/core/SkBitmapProcState.cpp
@@ -16,6 +16,7 @@
#include "SkMipMap.h"
#include "SkPixelRef.h"
#include "SkImageEncoder.h"
+#include "SkResourceCache.h"
#if !SK_ARM_NEON_IS_NONE
// These are defined in src/opts/SkBitmapProcState_arm_neon.cpp
@@ -107,31 +108,10 @@ static SkScalar effective_matrix_scale_sqrd(const SkMatrix& mat) {
return SkMaxScalar(v1.lengthSqd(), v2.lengthSqd());
}
-class AutoScaledCacheUnlocker {
-public:
- AutoScaledCacheUnlocker(SkScaledImageCache::ID* idPtr) : fIDPtr(idPtr) {}
- ~AutoScaledCacheUnlocker() {
- if (fIDPtr && *fIDPtr) {
- SkScaledImageCache::Unlock(*fIDPtr);
- *fIDPtr = NULL;
- }
- }
-
- // forgets the ID, so it won't call Unlock
- void release() {
- fIDPtr = NULL;
- }
-
-private:
- SkScaledImageCache::ID* fIDPtr;
-};
-#define AutoScaledCacheUnlocker(...) SK_REQUIRE_LOCAL_VAR(AutoScaledCacheUnlocker)
-
// Check to see that the size of the bitmap that would be produced by
// scaling by the given inverted matrix is less than the maximum allowed.
static inline bool cache_size_okay(const SkBitmap& bm, const SkMatrix& invMat) {
- size_t maximumAllocation
- = SkScaledImageCache::GetSingleAllocationByteLimit();
+ size_t maximumAllocation = SkResourceCache::GetSingleAllocationByteLimit();
if (0 == maximumAllocation) {
return true;
}
@@ -191,7 +171,7 @@ bool SkBitmapProcState::possiblyScaleImage() {
SkBitmapScaler::RESIZE_BEST,
dest_width,
dest_height,
- SkScaledImageCache::GetAllocator())) {
+ SkResourceCache::GetAllocator())) {
// we failed to create fScaledBitmap, so just return and let
// the scanline proc handle it.
return false;
« no previous file with comments | « src/core/SkBitmapProcState.h ('k') | src/core/SkResourceCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698