aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar sugoi <sugoi@chromium.org>2014-10-16 05:19:31 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-10-16 05:19:31 -0700
commitff58e4679b9473ce19abb81a3e50fc6a18f0981d (patch)
tree4b8b22be9babf67be2520eb199cc7bdb5ef40020
parent30bc88ccd524c0372fd2f8f79190ea4b81685beb (diff)
Disabled YUV decoding for subsets
Image subsets were always showing the same tile and were causing an image to be fully YUV decoded once per tile, which was both slow and wrong. BUG=413001, 419718 Review URL: https://codereview.chromium.org/661483002
-rw-r--r--src/gpu/SkGr.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index fdd4a79e48..e7d4ea121f 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -220,6 +220,12 @@ 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)) {