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

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

Issue 320873003: change pixelref to not inherit from SkFlattenable (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 5 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/core/SkScaledImageCache.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 30 matching lines...) Expand all
41 41
42 protected: 42 protected:
43 virtual ~SkCachingPixelRef(); 43 virtual ~SkCachingPixelRef();
44 virtual bool onNewLockPixels(LockRec*) SK_OVERRIDE; 44 virtual bool onNewLockPixels(LockRec*) SK_OVERRIDE;
45 virtual void onUnlockPixels() SK_OVERRIDE; 45 virtual void onUnlockPixels() SK_OVERRIDE;
46 virtual bool onLockPixelsAreWritable() const SK_OVERRIDE { return false; } 46 virtual bool onLockPixelsAreWritable() const SK_OVERRIDE { return false; }
47 47
48 virtual SkData* onRefEncodedData() SK_OVERRIDE { 48 virtual SkData* onRefEncodedData() SK_OVERRIDE {
49 return fImageGenerator->refEncodedData(); 49 return fImageGenerator->refEncodedData();
50 } 50 }
51
52 #ifdef SK_SUPPORT_LEGACY_PIXELREF_UNFLATTENABLE
51 // No need to flatten this object. When flattening an SkBitmap, 53 // No need to flatten this object. When flattening an SkBitmap,
52 // SkWriteBuffer will check the encoded data and write that 54 // SkWriteBuffer will check the encoded data and write that
53 // instead. 55 // instead.
54 // Future implementations of SkWriteBuffer will need to 56 // Future implementations of SkWriteBuffer will need to
55 // special case for onRefEncodedData as well. 57 // special case for onRefEncodedData as well.
56 SK_DECLARE_UNFLATTENABLE_OBJECT() 58 SK_DECLARE_UNFLATTENABLE_OBJECT()
59 #endif
57 60
58 private: 61 private:
59 SkImageGenerator* const fImageGenerator; 62 SkImageGenerator* const fImageGenerator;
60 bool fErrorInDecoding; 63 bool fErrorInDecoding;
61 void* fScaledCacheId; 64 void* fScaledCacheId;
62 const size_t fRowBytes; 65 const size_t fRowBytes;
63 66
64 SkCachingPixelRef(const SkImageInfo&, SkImageGenerator*, size_t rowBytes); 67 SkCachingPixelRef(const SkImageInfo&, SkImageGenerator*, size_t rowBytes);
65 68
66 typedef SkPixelRef INHERITED; 69 typedef SkPixelRef INHERITED;
67 }; 70 };
68 71
69 #endif // SkCachingPixelRef_DEFINED 72 #endif // SkCachingPixelRef_DEFINED
OLDNEW
« no previous file with comments | « src/core/SkScaledImageCache.cpp ('k') | src/lazy/SkDiscardablePixelRef.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698