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

Side by Side Diff: src/lazy/SkCachingPixelRef.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/image/SkImage_Raster.cpp ('k') | src/lazy/SkDiscardablePixelRef.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 #ifndef SkCachingPixelRef_DEFINED 8 #ifndef SkCachingPixelRef_DEFINED
9 #define SkCachingPixelRef_DEFINED 9 #define SkCachingPixelRef_DEFINED
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 protected: 43 protected:
44 virtual ~SkCachingPixelRef(); 44 virtual ~SkCachingPixelRef();
45 bool onNewLockPixels(LockRec*) override; 45 bool onNewLockPixels(LockRec*) override;
46 void onUnlockPixels() override; 46 void onUnlockPixels() override;
47 bool onLockPixelsAreWritable() const override { return false; } 47 bool onLockPixelsAreWritable() const override { return false; }
48 48
49 SkData* onRefEncodedData() override { 49 SkData* onRefEncodedData() override {
50 return fImageGenerator->refEncodedData(); 50 return fImageGenerator->refEncodedData();
51 } 51 }
52 52
53 bool onIsLazyGenerated() const override { return true; }
54
53 private: 55 private:
54 SkImageGenerator* const fImageGenerator; 56 SkImageGenerator* const fImageGenerator;
55 bool fErrorInDecoding; 57 bool fErrorInDecoding;
56 const size_t fRowBytes; 58 const size_t fRowBytes;
57 59
58 SkBitmap fLockedBitmap; 60 SkBitmap fLockedBitmap;
59 61
60 SkCachingPixelRef(const SkImageInfo&, SkImageGenerator*, size_t rowBytes); 62 SkCachingPixelRef(const SkImageInfo&, SkImageGenerator*, size_t rowBytes);
61 63
62 typedef SkPixelRef INHERITED; 64 typedef SkPixelRef INHERITED;
63 }; 65 };
64 66
65 #endif // SkCachingPixelRef_DEFINED 67 #endif // SkCachingPixelRef_DEFINED
OLDNEW
« no previous file with comments | « src/image/SkImage_Raster.cpp ('k') | src/lazy/SkDiscardablePixelRef.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698