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

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

Issue 105523008: Revert "Revert "Revert of https://codereview.chromium.org/110593003/"" (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: 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/SkBitmapDevice.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 /* 2 /*
3 * Copyright 2008 The Android Open Source Project 3 * Copyright 2008 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef SkMallocPixelRef_DEFINED 10 #ifndef SkMallocPixelRef_DEFINED
(...skipping 14 matching lines...) Expand all
25 * 25 *
26 * The pixelref will ref() the colortable (if not NULL). 26 * The pixelref will ref() the colortable (if not NULL).
27 * 27 *
28 * Returns NULL on failure. 28 * Returns NULL on failure.
29 */ 29 */
30 static SkMallocPixelRef* NewDirect(const SkImageInfo&, void* addr, 30 static SkMallocPixelRef* NewDirect(const SkImageInfo&, void* addr,
31 size_t rowBytes, SkColorTable*); 31 size_t rowBytes, SkColorTable*);
32 32
33 /** 33 /**
34 * Return a new SkMallocPixelRef, automatically allocating storage for the 34 * Return a new SkMallocPixelRef, automatically allocating storage for the
35 * pixels. If rowBytes are 0, an optimal value will be chosen automatically . 35 * pixels.
36 * If rowBytes is > 0, then it will be respected, or NULL will be returned 36 *
37 * if rowBytes is invalid for the specified info. 37 * If rowBytes is 0, an optimal value will be chosen automatically.
38 * If rowBytes is > 0, then it will be used, unless it is invald for the
39 * specified info, in which case NULL will be returned (failure).
38 * 40 *
39 * This pixelref will ref() the specified colortable (if not NULL). 41 * This pixelref will ref() the specified colortable (if not NULL).
40 * 42 *
41 * Returns NULL on failure. 43 * Returns NULL on failure.
42 */ 44 */
43 static SkMallocPixelRef* NewAllocate(const SkImageInfo& info, 45 static SkMallocPixelRef* NewAllocate(const SkImageInfo& info,
44 size_t rowBytes, SkColorTable*); 46 size_t rowBytes, SkColorTable*);
45 47
46 /** 48 /**
47 * Return a new SkMallocPixelRef with the provided pixel storage, 49 * Return a new SkMallocPixelRef with the provided pixel storage,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 83
82 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMallocPixelRef) 84 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMallocPixelRef)
83 85
84 protected: 86 protected:
85 // The ownPixels version of this constructor is deprecated. 87 // The ownPixels version of this constructor is deprecated.
86 SkMallocPixelRef(const SkImageInfo&, void* addr, size_t rb, SkColorTable*, 88 SkMallocPixelRef(const SkImageInfo&, void* addr, size_t rb, SkColorTable*,
87 bool ownPixels); 89 bool ownPixels);
88 SkMallocPixelRef(SkFlattenableReadBuffer& buffer); 90 SkMallocPixelRef(SkFlattenableReadBuffer& buffer);
89 virtual ~SkMallocPixelRef(); 91 virtual ~SkMallocPixelRef();
90 92
91 virtual bool onNewLockPixels(LockRec*) SK_OVERRIDE; 93 virtual void* onLockPixels(SkColorTable**) SK_OVERRIDE;
92 virtual void onUnlockPixels() SK_OVERRIDE; 94 virtual void onUnlockPixels() SK_OVERRIDE;
93 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; 95 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE;
94 virtual size_t getAllocatedSizeInBytes() const SK_OVERRIDE; 96 virtual size_t getAllocatedSizeInBytes() const SK_OVERRIDE;
95 97
96 private: 98 private:
97 void* fStorage; 99 void* fStorage;
98 SkColorTable* fCTable; 100 SkColorTable* fCTable;
99 size_t fRB; 101 size_t fRB;
100 ReleaseProc fReleaseProc; 102 ReleaseProc fReleaseProc;
101 void* fReleaseProcContext; 103 void* fReleaseProcContext;
102 104
103 SkMallocPixelRef(const SkImageInfo&, void* addr, size_t rb, SkColorTable*, 105 SkMallocPixelRef(const SkImageInfo&, void* addr, size_t rb, SkColorTable*,
104 ReleaseProc proc, void* context); 106 ReleaseProc proc, void* context);
105 107
106 typedef SkPixelRef INHERITED; 108 typedef SkPixelRef INHERITED;
107 }; 109 };
108 110
109 111
110 #endif 112 #endif
OLDNEW
« no previous file with comments | « include/core/SkBitmapDevice.h ('k') | include/core/SkPixelRef.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698