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