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

Unified Diff: src/gpu/SkGr.cpp

Issue 661483002: Disabled YUV decoding for subsets (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGr.cpp
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index fdd4a79e48b22a8dffc74198bf764315f1059666..8d80c6ea507dd2bde11fa54feaa042e35ba972fa 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -220,9 +220,19 @@ static GrTexture *load_etc1_texture(GrContext* ctx, bool cache,
static GrTexture *load_yuv_texture(GrContext* ctx, bool cache, const GrTextureParams* params,
const SkBitmap& bm, const GrTextureDesc& desc) {
+ // Subsets are not supported, the whole pixelRef is loaded when using YUV decoding
+ if ((bm.pixelRef()->info().width() != bm.info().width()) ||
+ (bm.pixelRef()->info().height() != bm.info().height())) {
+ return NULL;
+ }
+
SkPixelRef* pixelRef = bm.pixelRef();
SkISize yuvSizes[3];
- if ((NULL == pixelRef) || !pixelRef->getYUV8Planes(yuvSizes, NULL, NULL, NULL)) {
+ const int maxTextureSize = ctx->getMaxTextureSize();
+ if ((NULL == pixelRef) || !pixelRef->getYUV8Planes(yuvSizes, NULL, NULL, NULL) ||
bsalomon 2014/10/15 15:34:42 Should the failure happen in getYUV8Planes rather
sugoi1 2014/10/15 18:13:28 getYUV8Planes() doesn't know anything about the bi
bsalomon 2014/10/15 18:31:54 Acknowledged.
+ (yuvSizes[0].fWidth > maxTextureSize) || (yuvSizes[0].fHeight > maxTextureSize) ||
+ (yuvSizes[1].fWidth > maxTextureSize) || (yuvSizes[1].fHeight > maxTextureSize) ||
bsalomon 2014/10/15 15:34:42 Are these checks needed?
sugoi1 2014/10/15 18:13:28 Well, it's not impossible that these would be requ
bsalomon 2014/10/15 18:31:54 In any case, wouldn't we just fail down below in r
sugoi1 2014/10/15 19:08:56 Ah, well, if that's the case I'll just remove thes
+ (yuvSizes[2].fWidth > maxTextureSize) || (yuvSizes[2].fHeight > maxTextureSize)) {
return NULL;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698