| 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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 * For pixelrefs that don't have access to their raw pixels, they may be | 306 * For pixelrefs that don't have access to their raw pixels, they may be |
| 307 * able to make a copy of them (e.g. if the pixels are on the GPU). | 307 * able to make a copy of them (e.g. if the pixels are on the GPU). |
| 308 * | 308 * |
| 309 * The base class implementation returns false; | 309 * The base class implementation returns false; |
| 310 */ | 310 */ |
| 311 virtual bool onReadPixels(SkBitmap* dst, const SkIRect* subsetOrNull); | 311 virtual bool onReadPixels(SkBitmap* dst, const SkIRect* subsetOrNull); |
| 312 | 312 |
| 313 // default impl returns NULL. | 313 // default impl returns NULL. |
| 314 virtual SkData* onRefEncodedData(); | 314 virtual SkData* onRefEncodedData(); |
| 315 | 315 |
| 316 // default impl does nothing. |
| 317 virtual void onNotifyPixelsChanged(); |
| 318 |
| 316 // default impl returns false. | 319 // default impl returns false. |
| 317 virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBy
tes[3], | 320 virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBy
tes[3], |
| 318 SkYUVColorSpace* colorSpace); | 321 SkYUVColorSpace* colorSpace); |
| 319 | 322 |
| 320 /** | 323 /** |
| 321 * Returns the size (in bytes) of the internally allocated memory. | 324 * Returns the size (in bytes) of the internally allocated memory. |
| 322 * This should be implemented in all serializable SkPixelRef derived classe
s. | 325 * This should be implemented in all serializable SkPixelRef derived classe
s. |
| 323 * SkBitmap::fPixelRefOffset + SkBitmap::getSafeSize() should never overflo
w this value, | 326 * SkBitmap::fPixelRefOffset + SkBitmap::getSafeSize() should never overflo
w this value, |
| 324 * otherwise the rendering code may attempt to read memory out of bounds. | 327 * otherwise the rendering code may attempt to read memory out of bounds. |
| 325 * | 328 * |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 /** | 391 /** |
| 389 * Allocate a new pixelref matching the specified ImageInfo, allocating | 392 * Allocate a new pixelref matching the specified ImageInfo, allocating |
| 390 * the memory for the pixels. If the ImageInfo requires a ColorTable, | 393 * the memory for the pixels. If the ImageInfo requires a ColorTable, |
| 391 * the pixelref will ref() the colortable. | 394 * the pixelref will ref() the colortable. |
| 392 * On failure return NULL. | 395 * On failure return NULL. |
| 393 */ | 396 */ |
| 394 virtual SkPixelRef* create(const SkImageInfo&, size_t rowBytes, SkColorTable
*) = 0; | 397 virtual SkPixelRef* create(const SkImageInfo&, size_t rowBytes, SkColorTable
*) = 0; |
| 395 }; | 398 }; |
| 396 | 399 |
| 397 #endif | 400 #endif |
| OLD | NEW |