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

Side by Side Diff: src/lazy/SkDiscardablePixelRef.h

Issue 1271033002: private iterator to visit all resource cache entries (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add iter for fontcache Created 5 years, 4 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
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 #ifndef SkDiscardablePixelRef_DEFINED 8 #ifndef SkDiscardablePixelRef_DEFINED
9 #define SkDiscardablePixelRef_DEFINED 9 #define SkDiscardablePixelRef_DEFINED
10 10
11 #include "SkDiscardableMemory.h" 11 #include "SkDiscardableMemory.h"
12 #include "SkImageGeneratorPriv.h" 12 #include "SkImageGeneratorPriv.h"
13 #include "SkImageInfo.h" 13 #include "SkImageInfo.h"
14 #include "SkPixelRef.h" 14 #include "SkPixelRef.h"
15 15
16 /** 16 /**
17 * A PixelRef backed by SkDiscardableMemory, with the ability to 17 * A PixelRef backed by SkDiscardableMemory, with the ability to
18 * re-generate the pixels (via a SkImageGenerator) if the DM is 18 * re-generate the pixels (via a SkImageGenerator) if the DM is
19 * purged. 19 * purged.
20 */ 20 */
21 class SkDiscardablePixelRef : public SkPixelRef { 21 class SkDiscardablePixelRef : public SkPixelRef {
22 public: 22 public:
23 23
24 SkDiscardableMemory* diagnostic_only_getDiscardable() const override {
25 return fDiscardableMemory;
26 }
24 27
25 protected: 28 protected:
26 ~SkDiscardablePixelRef(); 29 ~SkDiscardablePixelRef();
27 30
28 bool onNewLockPixels(LockRec*) override; 31 bool onNewLockPixels(LockRec*) override;
29 void onUnlockPixels() override; 32 void onUnlockPixels() override;
30 bool onLockPixelsAreWritable() const override { return false; } 33 bool onLockPixelsAreWritable() const override { return false; }
31 34
32 SkData* onRefEncodedData() override { 35 SkData* onRefEncodedData() override {
33 return fGenerator->refEncodedData(); 36 return fGenerator->refEncodedData();
(...skipping 27 matching lines...) Expand all
61 return fGenerator->getYUV8Planes(sizes, planes, rowBytes, colorSpace); 64 return fGenerator->getYUV8Planes(sizes, planes, rowBytes, colorSpace);
62 } 65 }
63 66
64 friend bool SkInstallDiscardablePixelRef(SkImageGenerator*, const SkIRect*, SkBitmap*, 67 friend bool SkInstallDiscardablePixelRef(SkImageGenerator*, const SkIRect*, SkBitmap*,
65 SkDiscardableMemory::Factory*); 68 SkDiscardableMemory::Factory*);
66 69
67 typedef SkPixelRef INHERITED; 70 typedef SkPixelRef INHERITED;
68 }; 71 };
69 72
70 #endif // SkDiscardablePixelRef_DEFINED 73 #endif // SkDiscardablePixelRef_DEFINED
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698