| 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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 * match what it expected. If the sizes do not match, it should return fals
e. | 218 * match what it expected. If the sizes do not match, it should return fals
e. |
| 219 * | 219 * |
| 220 * If colorSpace is not NULL, the YUV color space of the data should be sto
red in the address | 220 * If colorSpace is not NULL, the YUV color space of the data should be sto
red in the address |
| 221 * it points at. | 221 * it points at. |
| 222 */ | 222 */ |
| 223 bool getYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3], | 223 bool getYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3], |
| 224 SkYUVColorSpace* colorSpace) { | 224 SkYUVColorSpace* colorSpace) { |
| 225 return this->onGetYUV8Planes(sizes, planes, rowBytes, colorSpace); | 225 return this->onGetYUV8Planes(sizes, planes, rowBytes, colorSpace); |
| 226 } | 226 } |
| 227 | 227 |
| 228 bool readPixels(SkBitmap* dst, const SkIRect* subset = NULL); | 228 /** Populates dst with the pixels of this pixelRef, converting them to color
Type. */ |
| 229 bool readPixels(SkBitmap* dst, SkColorType colorType, const SkIRect* subset
= NULL); |
| 229 | 230 |
| 230 /** | 231 /** |
| 231 * Makes a deep copy of this PixelRef, respecting the requested config. | 232 * Makes a deep copy of this PixelRef, respecting the requested config. |
| 232 * @param colorType Desired colortype. | 233 * @param colorType Desired colortype. |
| 233 * @param profileType Desired colorprofiletype. | 234 * @param profileType Desired colorprofiletype. |
| 234 * @param subset Subset of this PixelRef to copy. Must be fully contained w
ithin the bounds of | 235 * @param subset Subset of this PixelRef to copy. Must be fully contained w
ithin the bounds of |
| 235 * of this PixelRef. | 236 * of this PixelRef. |
| 236 * @return A new SkPixelRef, or NULL if either there is an error (e.g. the
destination could | 237 * @return A new SkPixelRef, or NULL if either there is an error (e.g. the
destination could |
| 237 * not be created with the given config), or this PixelRef does not
support deep | 238 * not be created with the given config), or this PixelRef does not
support deep |
| 238 * copies. | 239 * copies. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 | 293 |
| 293 /** Default impl returns true */ | 294 /** Default impl returns true */ |
| 294 virtual bool onLockPixelsAreWritable() const; | 295 virtual bool onLockPixelsAreWritable() const; |
| 295 | 296 |
| 296 /** | 297 /** |
| 297 * For pixelrefs that don't have access to their raw pixels, they may be | 298 * For pixelrefs that don't have access to their raw pixels, they may be |
| 298 * able to make a copy of them (e.g. if the pixels are on the GPU). | 299 * able to make a copy of them (e.g. if the pixels are on the GPU). |
| 299 * | 300 * |
| 300 * The base class implementation returns false; | 301 * The base class implementation returns false; |
| 301 */ | 302 */ |
| 302 virtual bool onReadPixels(SkBitmap* dst, const SkIRect* subsetOrNull); | 303 virtual bool onReadPixels(SkBitmap* dst, SkColorType colorType, const SkIRec
t* subsetOrNull); |
| 303 | 304 |
| 304 // default impl returns NULL. | 305 // default impl returns NULL. |
| 305 virtual SkData* onRefEncodedData(); | 306 virtual SkData* onRefEncodedData(); |
| 306 | 307 |
| 307 // default impl does nothing. | 308 // default impl does nothing. |
| 308 virtual void onNotifyPixelsChanged(); | 309 virtual void onNotifyPixelsChanged(); |
| 309 | 310 |
| 310 // default impl returns false. | 311 // default impl returns false. |
| 311 virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBy
tes[3], | 312 virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBy
tes[3], |
| 312 SkYUVColorSpace* colorSpace); | 313 SkYUVColorSpace* colorSpace); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 /** | 399 /** |
| 399 * Allocate a new pixelref matching the specified ImageInfo, allocating | 400 * Allocate a new pixelref matching the specified ImageInfo, allocating |
| 400 * the memory for the pixels. If the ImageInfo requires a ColorTable, | 401 * the memory for the pixels. If the ImageInfo requires a ColorTable, |
| 401 * the pixelref will ref() the colortable. | 402 * the pixelref will ref() the colortable. |
| 402 * On failure return NULL. | 403 * On failure return NULL. |
| 403 */ | 404 */ |
| 404 virtual SkPixelRef* create(const SkImageInfo&, size_t rowBytes, SkColorTable
*) = 0; | 405 virtual SkPixelRef* create(const SkImageInfo&, size_t rowBytes, SkColorTable
*) = 0; |
| 405 }; | 406 }; |
| 406 | 407 |
| 407 #endif | 408 #endif |
| OLD | NEW |