OLD | NEW |
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 SkPixelRef_DEFINED | 10 #ifndef SkPixelRef_DEFINED |
(...skipping 16 matching lines...) Expand all Loading... |
27 * lock and unlock. | 27 * lock and unlock. |
28 */ | 28 */ |
29 // #define SK_IGNORE_PIXELREF_SETPRELOCKED | 29 // #define SK_IGNORE_PIXELREF_SETPRELOCKED |
30 #endif | 30 #endif |
31 | 31 |
32 class SkColorTable; | 32 class SkColorTable; |
33 class SkData; | 33 class SkData; |
34 struct SkIRect; | 34 struct SkIRect; |
35 class SkMutex; | 35 class SkMutex; |
36 | 36 |
37 // this is an opaque class, not interpreted by skia | 37 class GrTexture; |
38 class SkGpuTexture; | |
39 | 38 |
40 /** \class SkPixelRef | 39 /** \class SkPixelRef |
41 | 40 |
42 This class is the smart container for pixel memory, and is used with | 41 This class is the smart container for pixel memory, and is used with |
43 SkBitmap. A pixelref is installed into a bitmap, and then the bitmap can | 42 SkBitmap. A pixelref is installed into a bitmap, and then the bitmap can |
44 access the actual pixel memory by calling lockPixels/unlockPixels. | 43 access the actual pixel memory by calling lockPixels/unlockPixels. |
45 | 44 |
46 This class can be shared/accessed between multiple threads. | 45 This class can be shared/accessed between multiple threads. |
47 */ | 46 */ |
48 class SK_API SkPixelRef : public SkFlattenable { | 47 class SK_API SkPixelRef : public SkFlattenable { |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 * | 136 * |
138 * If non-null is returned, the caller is responsible for calling unref() | 137 * If non-null is returned, the caller is responsible for calling unref() |
139 * on the data when it is finished. | 138 * on the data when it is finished. |
140 */ | 139 */ |
141 SkData* refEncodedData() { | 140 SkData* refEncodedData() { |
142 return this->onRefEncodedData(); | 141 return this->onRefEncodedData(); |
143 } | 142 } |
144 | 143 |
145 /** Are we really wrapping a texture instead of a bitmap? | 144 /** Are we really wrapping a texture instead of a bitmap? |
146 */ | 145 */ |
147 virtual SkGpuTexture* getTexture() { return NULL; } | 146 virtual GrTexture* getTexture() { return NULL; } |
148 | 147 |
149 bool readPixels(SkBitmap* dst, const SkIRect* subset = NULL); | 148 bool readPixels(SkBitmap* dst, const SkIRect* subset = NULL); |
150 | 149 |
151 /** | 150 /** |
152 * Makes a deep copy of this PixelRef, respecting the requested config. | 151 * Makes a deep copy of this PixelRef, respecting the requested config. |
153 * @param config Desired config. | 152 * @param config Desired config. |
154 * @param subset Subset of this PixelRef to copy. Must be fully contained w
ithin the bounds of | 153 * @param subset Subset of this PixelRef to copy. Must be fully contained w
ithin the bounds of |
155 * of this PixelRef. | 154 * of this PixelRef. |
156 * @return A new SkPixelRef, or NULL if either there is an error (e.g. the
destination could | 155 * @return A new SkPixelRef, or NULL if either there is an error (e.g. the
destination could |
157 * not be created with the given config), or this PixelRef does not
support deep | 156 * not be created with the given config), or this PixelRef does not
support deep |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 bool fIsImmutable; | 234 bool fIsImmutable; |
236 // only ever set in constructor, const after that | 235 // only ever set in constructor, const after that |
237 bool fPreLocked; | 236 bool fPreLocked; |
238 | 237 |
239 void setMutex(SkBaseMutex* mutex); | 238 void setMutex(SkBaseMutex* mutex); |
240 | 239 |
241 typedef SkFlattenable INHERITED; | 240 typedef SkFlattenable INHERITED; |
242 }; | 241 }; |
243 | 242 |
244 #endif | 243 #endif |
OLD | NEW |