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

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

Issue 1305453007: SkImage method for detecting lazy decoding (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: review comments 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
« no previous file with comments | « src/lazy/SkCachingPixelRef.h ('k') | tests/CachedDecodingPixelRefTest.cpp » ('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 #ifndef SkDiscardablePixelRef_DEFINED 8 #ifndef SkDiscardablePixelRef_DEFINED
9 #define SkDiscardablePixelRef_DEFINED 9 #define SkDiscardablePixelRef_DEFINED
10 10
(...skipping 18 matching lines...) Expand all
29 ~SkDiscardablePixelRef(); 29 ~SkDiscardablePixelRef();
30 30
31 bool onNewLockPixels(LockRec*) override; 31 bool onNewLockPixels(LockRec*) override;
32 void onUnlockPixels() override; 32 void onUnlockPixels() override;
33 bool onLockPixelsAreWritable() const override { return false; } 33 bool onLockPixelsAreWritable() const override { return false; }
34 34
35 SkData* onRefEncodedData() override { 35 SkData* onRefEncodedData() override {
36 return fGenerator->refEncodedData(); 36 return fGenerator->refEncodedData();
37 } 37 }
38 38
39 bool onIsLazyGenerated() const override { return true; }
40
39 private: 41 private:
40 SkImageGenerator* const fGenerator; 42 SkImageGenerator* const fGenerator;
41 SkDiscardableMemory::Factory* const fDMFactory; 43 SkDiscardableMemory::Factory* const fDMFactory;
42 const size_t fRowBytes; 44 const size_t fRowBytes;
43 // These const members should not change over the life of the 45 // These const members should not change over the life of the
44 // PixelRef, since the SkBitmap doesn't expect them to change. 46 // PixelRef, since the SkBitmap doesn't expect them to change.
45 47
46 SkDiscardableMemory* fDiscardableMemory; 48 SkDiscardableMemory* fDiscardableMemory;
47 bool fDiscardableMemoryIsLocked; 49 bool fDiscardableMemoryIsLocked;
48 SkAutoTUnref<SkColorTable> fCTable; 50 SkAutoTUnref<SkColorTable> fCTable;
(...skipping 15 matching lines...) Expand all
64 return fGenerator->getYUV8Planes(sizes, planes, rowBytes, colorSpace); 66 return fGenerator->getYUV8Planes(sizes, planes, rowBytes, colorSpace);
65 } 67 }
66 68
67 friend bool SkInstallDiscardablePixelRef(SkImageGenerator*, const SkIRect*, SkBitmap*, 69 friend bool SkInstallDiscardablePixelRef(SkImageGenerator*, const SkIRect*, SkBitmap*,
68 SkDiscardableMemory::Factory*); 70 SkDiscardableMemory::Factory*);
69 71
70 typedef SkPixelRef INHERITED; 72 typedef SkPixelRef INHERITED;
71 }; 73 };
72 74
73 #endif // SkDiscardablePixelRef_DEFINED 75 #endif // SkDiscardablePixelRef_DEFINED
OLDNEW
« no previous file with comments | « src/lazy/SkCachingPixelRef.h ('k') | tests/CachedDecodingPixelRefTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698