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

Side by Side Diff: include/core/SkMallocPixelRef.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 | « no previous file | include/core/SkPixelRef.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 2008 The Android Open Source Project 2 * Copyright 2008 The Android Open Source Project
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 8
9 #ifndef SkMallocPixelRef_DEFINED 9 #ifndef SkMallocPixelRef_DEFINED
10 #define SkMallocPixelRef_DEFINED 10 #define SkMallocPixelRef_DEFINED
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 void* getAddr() const { return fStorage; } 76 void* getAddr() const { return fStorage; }
77 77
78 class PRFactory : public SkPixelRefFactory { 78 class PRFactory : public SkPixelRefFactory {
79 public: 79 public:
80 virtual SkPixelRef* create(const SkImageInfo&, 80 virtual SkPixelRef* create(const SkImageInfo&,
81 size_t rowBytes, 81 size_t rowBytes,
82 SkColorTable*) SK_OVERRIDE; 82 SkColorTable*) SK_OVERRIDE;
83 }; 83 };
84 84
85 #ifdef SK_SUPPORT_LEGACY_PIXELREF_UNFLATTENABLE
85 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMallocPixelRef) 86 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMallocPixelRef)
87 #endif
86 88
87 protected: 89 protected:
88 // The ownPixels version of this constructor is deprecated. 90 // The ownPixels version of this constructor is deprecated.
89 SkMallocPixelRef(const SkImageInfo&, void* addr, size_t rb, SkColorTable*, 91 SkMallocPixelRef(const SkImageInfo&, void* addr, size_t rb, SkColorTable*,
90 bool ownPixels); 92 bool ownPixels);
93 #ifdef SK_SUPPORT_LEGACY_PIXELREF_UNFLATTENABLE
91 SkMallocPixelRef(SkReadBuffer& buffer); 94 SkMallocPixelRef(SkReadBuffer& buffer);
95 #endif
92 virtual ~SkMallocPixelRef(); 96 virtual ~SkMallocPixelRef();
93 97
94 virtual bool onNewLockPixels(LockRec*) SK_OVERRIDE; 98 virtual bool onNewLockPixels(LockRec*) SK_OVERRIDE;
95 virtual void onUnlockPixels() SK_OVERRIDE; 99 virtual void onUnlockPixels() SK_OVERRIDE;
96 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
97 virtual size_t getAllocatedSizeInBytes() const SK_OVERRIDE; 100 virtual size_t getAllocatedSizeInBytes() const SK_OVERRIDE;
98 101
99 private: 102 private:
100 void* fStorage; 103 void* fStorage;
101 SkColorTable* fCTable; 104 SkColorTable* fCTable;
102 size_t fRB; 105 size_t fRB;
103 ReleaseProc fReleaseProc; 106 ReleaseProc fReleaseProc;
104 void* fReleaseProcContext; 107 void* fReleaseProcContext;
105 108
106 SkMallocPixelRef(const SkImageInfo&, void* addr, size_t rb, SkColorTable*, 109 SkMallocPixelRef(const SkImageInfo&, void* addr, size_t rb, SkColorTable*,
107 ReleaseProc proc, void* context); 110 ReleaseProc proc, void* context);
108 111
109 typedef SkPixelRef INHERITED; 112 typedef SkPixelRef INHERITED;
110 }; 113 };
111 114
112 115
113 #endif 116 #endif
OLDNEW
« no previous file with comments | « no previous file | include/core/SkPixelRef.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698