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

Side by Side Diff: src/core/SkScaledImageCache.cpp

Issue 145443004: Resolve a few memory leaks in tests. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 11 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 unified diff | Download patch
« no previous file with comments | « include/gpu/SkGrPixelRef.h ('k') | src/lazy/SkCachingPixelRef.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « include/gpu/SkGrPixelRef.h ('k') | src/lazy/SkCachingPixelRef.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698