Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(206)

Side by Side Diff: include/core/SkPixelRef.h

Issue 1576983002: Make SkBitmap::CopyTo respect requested dst color type when bitmap is texture backed. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix size_t warnings Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | include/gpu/SkGrPixelRef.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « no previous file | include/gpu/SkGrPixelRef.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698