| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkScaledImageCache.h" | 8 #include "SkScaledImageCache.h" |
| 9 #include "SkMipMap.h" | 9 #include "SkMipMap.h" |
| 10 #include "SkPixelRef.h" | 10 #include "SkPixelRef.h" |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 | 176 |
| 177 #include "SkDiscardableMemory.h" | 177 #include "SkDiscardableMemory.h" |
| 178 | 178 |
| 179 class SkOneShotDiscardablePixelRef : public SkPixelRef { | 179 class SkOneShotDiscardablePixelRef : public SkPixelRef { |
| 180 public: | 180 public: |
| 181 SK_DECLARE_INST_COUNT(SkOneShotDiscardablePixelRef) | 181 SK_DECLARE_INST_COUNT(SkOneShotDiscardablePixelRef) |
| 182 // Ownership of the discardablememory is transfered to the pixelref | 182 // Ownership of the discardablememory is transfered to the pixelref |
| 183 SkOneShotDiscardablePixelRef(const SkImageInfo&, SkDiscardableMemory*, size_
t rowBytes); | 183 SkOneShotDiscardablePixelRef(const SkImageInfo&, SkDiscardableMemory*, size_
t rowBytes); |
| 184 ~SkOneShotDiscardablePixelRef(); | 184 ~SkOneShotDiscardablePixelRef(); |
| 185 | 185 |
| 186 #ifdef SK_SUPPORT_LEGACY_PIXELREF_UNFLATTENABLE |
| 186 SK_DECLARE_UNFLATTENABLE_OBJECT() | 187 SK_DECLARE_UNFLATTENABLE_OBJECT() |
| 188 #endif |
| 187 | 189 |
| 188 protected: | 190 protected: |
| 189 virtual bool onNewLockPixels(LockRec*) SK_OVERRIDE; | 191 virtual bool onNewLockPixels(LockRec*) SK_OVERRIDE; |
| 190 virtual void onUnlockPixels() SK_OVERRIDE; | 192 virtual void onUnlockPixels() SK_OVERRIDE; |
| 191 virtual size_t getAllocatedSizeInBytes() const SK_OVERRIDE; | 193 virtual size_t getAllocatedSizeInBytes() const SK_OVERRIDE; |
| 192 | 194 |
| 193 private: | 195 private: |
| 194 SkDiscardableMemory* fDM; | 196 SkDiscardableMemory* fDM; |
| 195 size_t fRB; | 197 size_t fRB; |
| 196 bool fFirstTime; | 198 bool fFirstTime; |
| (...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 784 return SkScaledImageCache::GetBytesUsed(); | 786 return SkScaledImageCache::GetBytesUsed(); |
| 785 } | 787 } |
| 786 | 788 |
| 787 size_t SkGraphics::GetImageCacheByteLimit() { | 789 size_t SkGraphics::GetImageCacheByteLimit() { |
| 788 return SkScaledImageCache::GetByteLimit(); | 790 return SkScaledImageCache::GetByteLimit(); |
| 789 } | 791 } |
| 790 | 792 |
| 791 size_t SkGraphics::SetImageCacheByteLimit(size_t newLimit) { | 793 size_t SkGraphics::SetImageCacheByteLimit(size_t newLimit) { |
| 792 return SkScaledImageCache::SetByteLimit(newLimit); | 794 return SkScaledImageCache::SetByteLimit(newLimit); |
| 793 } | 795 } |
| OLD | NEW |