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 "SkOnce.h" | 10 #include "SkOnce.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 | 185 |
186 // One of these should be explicit set by the caller after we return. | 186 // One of these should be explicit set by the caller after we return. |
187 fByteLimit = 0; | 187 fByteLimit = 0; |
188 fDiscardableFactory = NULL; | 188 fDiscardableFactory = NULL; |
189 } | 189 } |
190 | 190 |
191 #include "SkDiscardableMemory.h" | 191 #include "SkDiscardableMemory.h" |
192 | 192 |
193 class SkOneShotDiscardablePixelRef : public SkPixelRef { | 193 class SkOneShotDiscardablePixelRef : public SkPixelRef { |
194 public: | 194 public: |
| 195 SK_DECLARE_INST_COUNT(SkOneShotDiscardablePixelRef) |
195 // Ownership of the discardablememory is transfered to the pixelref | 196 // Ownership of the discardablememory is transfered to the pixelref |
196 SkOneShotDiscardablePixelRef(const SkImageInfo&, SkDiscardableMemory*, size_
t rowBytes); | 197 SkOneShotDiscardablePixelRef(const SkImageInfo&, SkDiscardableMemory*, size_
t rowBytes); |
197 ~SkOneShotDiscardablePixelRef(); | 198 ~SkOneShotDiscardablePixelRef(); |
198 | 199 |
199 SK_DECLARE_UNFLATTENABLE_OBJECT() | 200 SK_DECLARE_UNFLATTENABLE_OBJECT() |
200 | 201 |
201 protected: | 202 protected: |
202 virtual bool onNewLockPixels(LockRec*) SK_OVERRIDE; | 203 virtual bool onNewLockPixels(LockRec*) SK_OVERRIDE; |
203 virtual void onUnlockPixels() SK_OVERRIDE; | 204 virtual void onUnlockPixels() SK_OVERRIDE; |
204 virtual size_t getAllocatedSizeInBytes() const SK_OVERRIDE; | 205 virtual size_t getAllocatedSizeInBytes() const SK_OVERRIDE; |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 return SkScaledImageCache::GetBytesUsed(); | 788 return SkScaledImageCache::GetBytesUsed(); |
788 } | 789 } |
789 | 790 |
790 size_t SkGraphics::GetImageCacheByteLimit() { | 791 size_t SkGraphics::GetImageCacheByteLimit() { |
791 return SkScaledImageCache::GetByteLimit(); | 792 return SkScaledImageCache::GetByteLimit(); |
792 } | 793 } |
793 | 794 |
794 size_t SkGraphics::SetImageCacheByteLimit(size_t newLimit) { | 795 size_t SkGraphics::SetImageCacheByteLimit(size_t newLimit) { |
795 return SkScaledImageCache::SetByteLimit(newLimit); | 796 return SkScaledImageCache::SetByteLimit(newLimit); |
796 } | 797 } |
OLD | NEW |