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

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: Ported a minimal set of blink side changes for YUV decoding tests 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
11 #include "SkBitmap.h" 11 #include "SkBitmap.h"
12 #include "SkDynamicAnnotations.h" 12 #include "SkDynamicAnnotations.h"
13 #include "SkRefCnt.h" 13 #include "SkRefCnt.h"
14 #include "SkString.h" 14 #include "SkString.h"
15 #include "SkImageInfo.h" 15 #include "SkImageInfo.h"
16 #include "SkSize.h"
16 #include "SkTDArray.h" 17 #include "SkTDArray.h"
17 18
18 //#define xed 19 //#define xed
19 20
20 #ifdef SK_DEBUG 21 #ifdef SK_DEBUG
21 /** 22 /**
22 * Defining SK_IGNORE_PIXELREF_SETPRELOCKED will force all pixelref 23 * Defining SK_IGNORE_PIXELREF_SETPRELOCKED will force all pixelref
23 * subclasses to correctly handle lock/unlock pixels. For performance 24 * subclasses to correctly handle lock/unlock pixels. For performance
24 * reasons, simple malloc-based subclasses call setPreLocked() to skip 25 * reasons, simple malloc-based subclasses call setPreLocked() to skip
25 * the overhead of implementing these calls. 26 * the overhead of implementing these calls.
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 */ 213 */
213 bool decodeInto(int pow2, SkBitmap* bitmap) { 214 bool decodeInto(int pow2, SkBitmap* bitmap) {
214 SkASSERT(pow2 >= 0); 215 SkASSERT(pow2 >= 0);
215 return this->onDecodeInto(pow2, bitmap); 216 return this->onDecodeInto(pow2, bitmap);
216 } 217 }
217 218
218 /** Are we really wrapping a texture instead of a bitmap? 219 /** Are we really wrapping a texture instead of a bitmap?
219 */ 220 */
220 virtual GrTexture* getTexture() { return NULL; } 221 virtual GrTexture* getTexture() { return NULL; }
221 222
223 /**
224 * If any planes or rowBytes is NULL, this should output the sizes and retu rn true
225 * if it can efficiently return YUV planar data. If it cannot, it should re turn false.
226 *
227 * If all planes and rowBytes are not NULL, then it should copy the associa ted Y,U,V data
228 * into those planes of memory supplied by the caller. It should validate t hat the sizes
229 * match what it expected. If the sizes do not match, it should return fals e.
230 */
231 virtual bool getYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowByte s[3]) {
232 return false;
233 }
234
222 bool readPixels(SkBitmap* dst, const SkIRect* subset = NULL); 235 bool readPixels(SkBitmap* dst, const SkIRect* subset = NULL);
223 236
224 /** 237 /**
225 * Makes a deep copy of this PixelRef, respecting the requested config. 238 * Makes a deep copy of this PixelRef, respecting the requested config.
226 * @param colorType Desired colortype. 239 * @param colorType Desired colortype.
227 * @param subset Subset of this PixelRef to copy. Must be fully contained w ithin the bounds of 240 * @param subset Subset of this PixelRef to copy. Must be fully contained w ithin the bounds of
228 * of this PixelRef. 241 * of this PixelRef.
229 * @return A new SkPixelRef, or NULL if either there is an error (e.g. the destination could 242 * @return A new SkPixelRef, or NULL if either there is an error (e.g. the destination could
230 * not be created with the given config), or this PixelRef does not support deep 243 * not be created with the given config), or this PixelRef does not support deep
231 * copies. 244 * copies.
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 /** 378 /**
366 * Allocate a new pixelref matching the specified ImageInfo, allocating 379 * Allocate a new pixelref matching the specified ImageInfo, allocating
367 * the memory for the pixels. If the ImageInfo requires a ColorTable, 380 * the memory for the pixels. If the ImageInfo requires a ColorTable,
368 * the pixelref will ref() the colortable. 381 * the pixelref will ref() the colortable.
369 * On failure return NULL. 382 * On failure return NULL.
370 */ 383 */
371 virtual SkPixelRef* create(const SkImageInfo&, size_t rowBytes, SkColorTable *) = 0; 384 virtual SkPixelRef* create(const SkImageInfo&, size_t rowBytes, SkColorTable *) = 0;
372 }; 385 };
373 386
374 #endif 387 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698