OLD | NEW |
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 #ifndef SkPixelRef_DEFINED | 8 #ifndef SkPixelRef_DEFINED |
9 #define SkPixelRef_DEFINED | 9 #define SkPixelRef_DEFINED |
10 | 10 |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 * recommendation (but not smaller). | 231 * recommendation (but not smaller). |
232 * @param planes Memory for each of the Y, U, and V planes. | 232 * @param planes Memory for each of the Y, U, and V planes. |
233 */ | 233 */ |
234 bool getYUV8Planes(const SkYUVSizeInfo& sizeInfo, void* planes[3]) { | 234 bool getYUV8Planes(const SkYUVSizeInfo& sizeInfo, void* planes[3]) { |
235 return this->onGetYUV8Planes(sizeInfo, planes); | 235 return this->onGetYUV8Planes(sizeInfo, planes); |
236 } | 236 } |
237 | 237 |
238 /** Populates dst with the pixels of this pixelRef, converting them to color
Type. */ | 238 /** Populates dst with the pixels of this pixelRef, converting them to color
Type. */ |
239 bool readPixels(SkBitmap* dst, SkColorType colorType, const SkIRect* subset
= NULL); | 239 bool readPixels(SkBitmap* dst, SkColorType colorType, const SkIRect* subset
= NULL); |
240 | 240 |
241 /** | |
242 * Makes a deep copy of this PixelRef, respecting the requested config. | |
243 * @param colorType Desired colortype. | |
244 * @param profileType Desired colorprofiletype. | |
245 * @param subset Subset of this PixelRef to copy. Must be fully contained w
ithin the bounds of | |
246 * of this PixelRef. | |
247 * @return A new SkPixelRef, or NULL if either there is an error (e.g. the
destination could | |
248 * not be created with the given config), or this PixelRef does not
support deep | |
249 * copies. | |
250 */ | |
251 virtual SkPixelRef* deepCopy(SkColorType, SkColorSpace*, const SkIRect* /*su
bset*/) { | |
252 return NULL; | |
253 } | |
254 | |
255 // Register a listener that may be called the next time our generation ID ch
anges. | 241 // Register a listener that may be called the next time our generation ID ch
anges. |
256 // | 242 // |
257 // We'll only call the listener if we're confident that we are the only SkPi
xelRef with this | 243 // We'll only call the listener if we're confident that we are the only SkPi
xelRef with this |
258 // generation ID. If our generation ID changes and we decide not to call th
e listener, we'll | 244 // generation ID. If our generation ID changes and we decide not to call th
e listener, we'll |
259 // never call it: you must add a new listener for each generation ID change.
We also won't call | 245 // never call it: you must add a new listener for each generation ID change.
We also won't call |
260 // the listener when we're certain no one knows what our generation ID is. | 246 // the listener when we're certain no one knows what our generation ID is. |
261 // | 247 // |
262 // This can be used to invalidate caches keyed by SkPixelRef generation ID. | 248 // This can be used to invalidate caches keyed by SkPixelRef generation ID. |
263 struct GenIDChangeListener { | 249 struct GenIDChangeListener { |
264 virtual ~GenIDChangeListener() {} | 250 virtual ~GenIDChangeListener() {} |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 /** | 400 /** |
415 * Allocate a new pixelref matching the specified ImageInfo, allocating | 401 * Allocate a new pixelref matching the specified ImageInfo, allocating |
416 * the memory for the pixels. If the ImageInfo requires a ColorTable, | 402 * the memory for the pixels. If the ImageInfo requires a ColorTable, |
417 * the pixelref will ref() the colortable. | 403 * the pixelref will ref() the colortable. |
418 * On failure return NULL. | 404 * On failure return NULL. |
419 */ | 405 */ |
420 virtual SkPixelRef* create(const SkImageInfo&, size_t rowBytes, SkColorTable
*) = 0; | 406 virtual SkPixelRef* create(const SkImageInfo&, size_t rowBytes, SkColorTable
*) = 0; |
421 }; | 407 }; |
422 | 408 |
423 #endif | 409 #endif |
OLD | NEW |