| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
| 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 SkImage_DEFINED | 8 #ifndef SkImage_DEFINED |
| 9 #define SkImage_DEFINED | 9 #define SkImage_DEFINED |
| 10 | 10 |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 * planes and rowBytes arrays are ordered [y, u, v]. | 161 * planes and rowBytes arrays are ordered [y, u, v]. |
| 162 */ | 162 */ |
| 163 bool readYUV8Planes(const SkISize[3], void* const planes[3], const size_t ro
wBytes[3], | 163 bool readYUV8Planes(const SkISize[3], void* const planes[3], const size_t ro
wBytes[3], |
| 164 SkYUVColorSpace) const; | 164 SkYUVColorSpace) const; |
| 165 | 165 |
| 166 virtual SkShader* newShader(SkShader::TileMode, | 166 virtual SkShader* newShader(SkShader::TileMode, |
| 167 SkShader::TileMode, | 167 SkShader::TileMode, |
| 168 const SkMatrix* localMatrix = NULL) const; | 168 const SkMatrix* localMatrix = NULL) const; |
| 169 | 169 |
| 170 /** | 170 /** |
| 171 * If the image has direct access to its pixels (i.e. they are in local RAM
) |
| 172 * return true, and if not null, return in the pixmap parameter the info ab
out the |
| 173 * images pixels. |
| 174 * |
| 175 * On failure, return false and ignore the pixmap parameter. |
| 176 */ |
| 177 bool peekPixels(SkPixmap* pixmap) const; |
| 178 |
| 179 #ifdef SK_SUPPORT_LEGACY_PEEKPIXELS_PARMS |
| 180 /** |
| 171 * If the image has direct access to its pixels (i.e. they are in local | 181 * If the image has direct access to its pixels (i.e. they are in local |
| 172 * RAM) return the (const) address of those pixels, and if not null, return | 182 * RAM) return the (const) address of those pixels, and if not null, return |
| 173 * the ImageInfo and rowBytes. The returned address is only valid while | 183 * the ImageInfo and rowBytes. The returned address is only valid while |
| 174 * the image object is in scope. | 184 * the image object is in scope. |
| 175 * | 185 * |
| 176 * On failure, returns NULL and the info and rowBytes parameters are | 186 * On failure, returns NULL and the info and rowBytes parameters are |
| 177 * ignored. | 187 * ignored. |
| 188 * |
| 189 * DEPRECATED -- use the SkPixmap variant instead |
| 178 */ | 190 */ |
| 179 const void* peekPixels(SkImageInfo* info, size_t* rowBytes) const; | 191 const void* peekPixels(SkImageInfo* info, size_t* rowBytes) const; |
| 180 | 192 #endif |
| 181 /** | |
| 182 * If the image has direct access to its pixels (i.e. they are in local | |
| 183 * RAM) return the (const) address of those pixels, and if not null, return | |
| 184 * true, and if pixmap is not NULL, set it to point into the image. | |
| 185 * | |
| 186 * On failure, return false and ignore the pixmap parameter. | |
| 187 */ | |
| 188 bool peekPixels(SkPixmap* pixmap) const; | |
| 189 | 193 |
| 190 /** | 194 /** |
| 191 * Some images have to perform preliminary work in preparation for drawing.
This can be | 195 * Some images have to perform preliminary work in preparation for drawing.
This can be |
| 192 * decoding, uploading to a GPU, or other tasks. These happen automatically
when an image | 196 * decoding, uploading to a GPU, or other tasks. These happen automatically
when an image |
| 193 * is drawn, and often they are cached so that the cost is only paid the fi
rst time. | 197 * is drawn, and often they are cached so that the cost is only paid the fi
rst time. |
| 194 * | 198 * |
| 195 * Preroll() can be called before drawing to try to perform this prepatory
work ahead of time. | 199 * Preroll() can be called before drawing to try to perform this prepatory
work ahead of time. |
| 196 * For images that have no such work, this returns instantly. Others may do
some thing to | 200 * For images that have no such work, this returns instantly. Others may do
some thing to |
| 197 * prepare their cache and then return. | 201 * prepare their cache and then return. |
| 198 * | 202 * |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 | 349 |
| 346 private: | 350 private: |
| 347 const int fWidth; | 351 const int fWidth; |
| 348 const int fHeight; | 352 const int fHeight; |
| 349 const uint32_t fUniqueID; | 353 const uint32_t fUniqueID; |
| 350 | 354 |
| 351 typedef SkRefCnt INHERITED; | 355 typedef SkRefCnt INHERITED; |
| 352 }; | 356 }; |
| 353 | 357 |
| 354 #endif | 358 #endif |
| OLD | NEW |