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

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

Issue 374743003: Skia side RGB to YUV gpu conversion (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 5 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
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 22 matching lines...) Expand all
33 33
34 #ifdef SK_SUPPORT_LEGACY_PIXELREF_UNFLATTENABLE 34 #ifdef SK_SUPPORT_LEGACY_PIXELREF_UNFLATTENABLE
35 // we only support unflattening, not flattening 35 // we only support unflattening, not flattening
36 #define SK_PIXELREF_BASECLASS SkFlattenable 36 #define SK_PIXELREF_BASECLASS SkFlattenable
37 #else 37 #else
38 #define SK_PIXELREF_BASECLASS SkRefCnt 38 #define SK_PIXELREF_BASECLASS SkRefCnt
39 #endif 39 #endif
40 40
41 class SkColorTable; 41 class SkColorTable;
42 class SkData; 42 class SkData;
43 class SkImageGenerator;
43 struct SkIRect; 44 struct SkIRect;
44 class SkMutex; 45 class SkMutex;
45 46
46 class GrTexture; 47 class GrTexture;
47 48
48 /** \class SkPixelRef 49 /** \class SkPixelRef
49 50
50 This class is the smart container for pixel memory, and is used with 51 This class is the smart container for pixel memory, and is used with
51 SkBitmap. A pixelref is installed into a bitmap, and then the bitmap can 52 SkBitmap. A pixelref is installed into a bitmap, and then the bitmap can
52 access the actual pixel memory by calling lockPixels/unlockPixels. 53 access the actual pixel memory by calling lockPixels/unlockPixels.
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 */ 220 */
220 bool decodeInto(int pow2, SkBitmap* bitmap) { 221 bool decodeInto(int pow2, SkBitmap* bitmap) {
221 SkASSERT(pow2 >= 0); 222 SkASSERT(pow2 >= 0);
222 return this->onDecodeInto(pow2, bitmap); 223 return this->onDecodeInto(pow2, bitmap);
223 } 224 }
224 225
225 /** Are we really wrapping a texture instead of a bitmap? 226 /** Are we really wrapping a texture instead of a bitmap?
226 */ 227 */
227 virtual GrTexture* getTexture() { return NULL; } 228 virtual GrTexture* getTexture() { return NULL; }
228 229
230 /** Do we have data that requires decoding from an image generator?
231 */
232 virtual SkImageGenerator* getImageGenerator() const { return NULL; }
sugoi1 2014/07/08 14:42:02 Since the new API was in SkImageGenerator, I assum
reed1 2014/07/08 15:08:52 Hmm, I wonder if its safer to just expose getYUVPl
sugoi1 2014/07/09 19:57:43 Done.
233
229 bool readPixels(SkBitmap* dst, const SkIRect* subset = NULL); 234 bool readPixels(SkBitmap* dst, const SkIRect* subset = NULL);
230 235
231 /** 236 /**
232 * Makes a deep copy of this PixelRef, respecting the requested config. 237 * Makes a deep copy of this PixelRef, respecting the requested config.
233 * @param colorType Desired colortype. 238 * @param colorType Desired colortype.
234 * @param subset Subset of this PixelRef to copy. Must be fully contained w ithin the bounds of 239 * @param subset Subset of this PixelRef to copy. Must be fully contained w ithin the bounds of
235 * of this PixelRef. 240 * of this PixelRef.
236 * @return A new SkPixelRef, or NULL if either there is an error (e.g. the destination could 241 * @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 242 * not be created with the given config), or this PixelRef does not support deep
238 * copies. 243 * copies.
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 /** 388 /**
384 * Allocate a new pixelref matching the specified ImageInfo, allocating 389 * Allocate a new pixelref matching the specified ImageInfo, allocating
385 * the memory for the pixels. If the ImageInfo requires a ColorTable, 390 * the memory for the pixels. If the ImageInfo requires a ColorTable,
386 * the pixelref will ref() the colortable. 391 * the pixelref will ref() the colortable.
387 * On failure return NULL. 392 * On failure return NULL.
388 */ 393 */
389 virtual SkPixelRef* create(const SkImageInfo&, size_t rowBytes, SkColorTable *) = 0; 394 virtual SkPixelRef* create(const SkImageInfo&, size_t rowBytes, SkColorTable *) = 0;
390 }; 395 };
391 396
392 #endif 397 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698