| 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 "SkChecksum.h" | 8 #include "SkChecksum.h" |
| 9 #include "SkScaledImageCache.h" | 9 #include "SkScaledImageCache.h" |
| 10 #include "SkMipMap.h" | 10 #include "SkMipMap.h" |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 151 |
| 152 #include "SkDiscardableMemory.h" | 152 #include "SkDiscardableMemory.h" |
| 153 | 153 |
| 154 class SkOneShotDiscardablePixelRef : public SkPixelRef { | 154 class SkOneShotDiscardablePixelRef : public SkPixelRef { |
| 155 public: | 155 public: |
| 156 SK_DECLARE_INST_COUNT(SkOneShotDiscardablePixelRef) | 156 SK_DECLARE_INST_COUNT(SkOneShotDiscardablePixelRef) |
| 157 // Ownership of the discardablememory is transfered to the pixelref | 157 // Ownership of the discardablememory is transfered to the pixelref |
| 158 SkOneShotDiscardablePixelRef(const SkImageInfo&, SkDiscardableMemory*, size_
t rowBytes); | 158 SkOneShotDiscardablePixelRef(const SkImageInfo&, SkDiscardableMemory*, size_
t rowBytes); |
| 159 ~SkOneShotDiscardablePixelRef(); | 159 ~SkOneShotDiscardablePixelRef(); |
| 160 | 160 |
| 161 #ifdef SK_SUPPORT_LEGACY_PIXELREF_UNFLATTENABLE | |
| 162 SK_DECLARE_UNFLATTENABLE_OBJECT() | |
| 163 #endif | |
| 164 | |
| 165 protected: | 161 protected: |
| 166 virtual bool onNewLockPixels(LockRec*) SK_OVERRIDE; | 162 virtual bool onNewLockPixels(LockRec*) SK_OVERRIDE; |
| 167 virtual void onUnlockPixels() SK_OVERRIDE; | 163 virtual void onUnlockPixels() SK_OVERRIDE; |
| 168 virtual size_t getAllocatedSizeInBytes() const SK_OVERRIDE; | 164 virtual size_t getAllocatedSizeInBytes() const SK_OVERRIDE; |
| 169 | 165 |
| 170 private: | 166 private: |
| 171 SkDiscardableMemory* fDM; | 167 SkDiscardableMemory* fDM; |
| 172 size_t fRB; | 168 size_t fRB; |
| 173 bool fFirstTime; | 169 bool fFirstTime; |
| 174 | 170 |
| (...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 761 return SkScaledImageCache::GetBytesUsed(); | 757 return SkScaledImageCache::GetBytesUsed(); |
| 762 } | 758 } |
| 763 | 759 |
| 764 size_t SkGraphics::GetImageCacheByteLimit() { | 760 size_t SkGraphics::GetImageCacheByteLimit() { |
| 765 return SkScaledImageCache::GetByteLimit(); | 761 return SkScaledImageCache::GetByteLimit(); |
| 766 } | 762 } |
| 767 | 763 |
| 768 size_t SkGraphics::SetImageCacheByteLimit(size_t newLimit) { | 764 size_t SkGraphics::SetImageCacheByteLimit(size_t newLimit) { |
| 769 return SkScaledImageCache::SetByteLimit(newLimit); | 765 return SkScaledImageCache::SetByteLimit(newLimit); |
| 770 } | 766 } |
| OLD | NEW |