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 "SkMessageBus.h" | 9 #include "SkMessageBus.h" |
10 #include "SkMipMap.h" | 10 #include "SkMipMap.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 // One of these should be explicit set by the caller after we return. | 68 // One of these should be explicit set by the caller after we return. |
69 fTotalByteLimit = 0; | 69 fTotalByteLimit = 0; |
70 fDiscardableFactory = NULL; | 70 fDiscardableFactory = NULL; |
71 } | 71 } |
72 | 72 |
73 #include "SkDiscardableMemory.h" | 73 #include "SkDiscardableMemory.h" |
74 | 74 |
75 class SkOneShotDiscardablePixelRef : public SkPixelRef { | 75 class SkOneShotDiscardablePixelRef : public SkPixelRef { |
76 public: | 76 public: |
77 SK_DECLARE_INST_COUNT(SkOneShotDiscardablePixelRef) | 77 |
78 // Ownership of the discardablememory is transfered to the pixelref | 78 // Ownership of the discardablememory is transfered to the pixelref |
79 SkOneShotDiscardablePixelRef(const SkImageInfo&, SkDiscardableMemory*, size_
t rowBytes); | 79 SkOneShotDiscardablePixelRef(const SkImageInfo&, SkDiscardableMemory*, size_
t rowBytes); |
80 ~SkOneShotDiscardablePixelRef(); | 80 ~SkOneShotDiscardablePixelRef(); |
81 | 81 |
82 protected: | 82 protected: |
83 bool onNewLockPixels(LockRec*) override; | 83 bool onNewLockPixels(LockRec*) override; |
84 void onUnlockPixels() override; | 84 void onUnlockPixels() override; |
85 size_t getAllocatedSizeInBytes() const override; | 85 size_t getAllocatedSizeInBytes() const override; |
86 | 86 |
87 private: | 87 private: |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 | 638 |
639 size_t SkGraphics::SetResourceCacheSingleAllocationByteLimit(size_t newLimit) { | 639 size_t SkGraphics::SetResourceCacheSingleAllocationByteLimit(size_t newLimit) { |
640 return SkResourceCache::SetSingleAllocationByteLimit(newLimit); | 640 return SkResourceCache::SetSingleAllocationByteLimit(newLimit); |
641 } | 641 } |
642 | 642 |
643 void SkGraphics::PurgeResourceCache() { | 643 void SkGraphics::PurgeResourceCache() { |
644 SkImageFilter::PurgeCache(); | 644 SkImageFilter::PurgeCache(); |
645 return SkResourceCache::PurgeAll(); | 645 return SkResourceCache::PurgeAll(); |
646 } | 646 } |
647 | 647 |
OLD | NEW |