aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/lazy
diff options
context:
space:
mode:
authorGravatar vmiura <vmiura@chromium.org>2015-02-23 10:59:44 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-02-23 10:59:44 -0800
commit278f86e4df6b835d0bcdb4ca14fa4dbbd4271cac (patch)
treea66febbbba2ec73fa19bc410aa3a0a340ae08028 /src/lazy
parent93276c683d383142dfad31a01c6fdb1c810b6c1f (diff)
SkDiscardablePixelRef should favor not decoding to YUV if they already decoded to RGB.
BUG=skia: BUG=459760 Review URL: https://codereview.chromium.org/944823004
Diffstat (limited to 'src/lazy')
-rw-r--r--src/lazy/SkDiscardablePixelRef.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lazy/SkDiscardablePixelRef.h b/src/lazy/SkDiscardablePixelRef.h
index 38ff2c4703..9fef0559d0 100644
--- a/src/lazy/SkDiscardablePixelRef.h
+++ b/src/lazy/SkDiscardablePixelRef.h
@@ -53,6 +53,11 @@ private:
void* planes[3],
size_t rowBytes[3],
SkYUVColorSpace* colorSpace) SK_OVERRIDE {
+ // If the image was already decoded with lockPixels(), favor not
+ // re-decoding to YUV8 planes.
+ if (fDiscardableMemory) {
+ return false;
+ }
return fGenerator->getYUV8Planes(sizes, planes, rowBytes, colorSpace);
}