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

Side by Side Diff: include/core/SkMallocPixelRef.h

Issue 143073008: add installPixels (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « include/core/SkBitmap.h ('k') | 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 * Returns NULL on failure. 72 * Returns NULL on failure.
73 */ 73 */
74 static SkMallocPixelRef* NewWithData(const SkImageInfo& info, 74 static SkMallocPixelRef* NewWithData(const SkImageInfo& info,
75 size_t rowBytes, 75 size_t rowBytes,
76 SkColorTable* ctable, 76 SkColorTable* ctable,
77 SkData* data, 77 SkData* data,
78 size_t offset = 0); 78 size_t offset = 0);
79 79
80 void* getAddr() const { return fStorage; } 80 void* getAddr() const { return fStorage; }
81 81
82 class PRFactory : public SkPixelRefFactory {
83 public:
84 virtual SkPixelRef* create(const SkImageInfo&,
85 SkColorTable*) SK_OVERRIDE;
86 };
87
82 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMallocPixelRef) 88 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMallocPixelRef)
83 89
84 protected: 90 protected:
85 // The ownPixels version of this constructor is deprecated. 91 // The ownPixels version of this constructor is deprecated.
86 SkMallocPixelRef(const SkImageInfo&, void* addr, size_t rb, SkColorTable*, 92 SkMallocPixelRef(const SkImageInfo&, void* addr, size_t rb, SkColorTable*,
87 bool ownPixels); 93 bool ownPixels);
88 SkMallocPixelRef(SkFlattenableReadBuffer& buffer); 94 SkMallocPixelRef(SkFlattenableReadBuffer& buffer);
89 virtual ~SkMallocPixelRef(); 95 virtual ~SkMallocPixelRef();
90 96
91 virtual bool onNewLockPixels(LockRec*) SK_OVERRIDE; 97 virtual bool onNewLockPixels(LockRec*) SK_OVERRIDE;
92 virtual void onUnlockPixels() SK_OVERRIDE; 98 virtual void onUnlockPixels() SK_OVERRIDE;
93 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; 99 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE;
94 virtual size_t getAllocatedSizeInBytes() const SK_OVERRIDE; 100 virtual size_t getAllocatedSizeInBytes() const SK_OVERRIDE;
95 101
96 private: 102 private:
97 void* fStorage; 103 void* fStorage;
98 SkColorTable* fCTable; 104 SkColorTable* fCTable;
99 size_t fRB; 105 size_t fRB;
100 ReleaseProc fReleaseProc; 106 ReleaseProc fReleaseProc;
101 void* fReleaseProcContext; 107 void* fReleaseProcContext;
102 108
103 SkMallocPixelRef(const SkImageInfo&, void* addr, size_t rb, SkColorTable*, 109 SkMallocPixelRef(const SkImageInfo&, void* addr, size_t rb, SkColorTable*,
104 ReleaseProc proc, void* context); 110 ReleaseProc proc, void* context);
105 111
106 typedef SkPixelRef INHERITED; 112 typedef SkPixelRef INHERITED;
107 }; 113 };
108 114
109 115
110 #endif 116 #endif
OLDNEW
« no previous file with comments | « include/core/SkBitmap.h ('k') | include/core/SkPixelRef.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698