Index: src/lazy/SkDiscardablePixelRef.h |
diff --git a/src/lazy/SkDiscardablePixelRef.h b/src/lazy/SkDiscardablePixelRef.h |
index 448f0ab24b907c1fe7b3ce1e49146905e30f0cd3..54991ea4d1088cc9a839082c18a4fa3dc0cc1f48 100644 |
--- a/src/lazy/SkDiscardablePixelRef.h |
+++ b/src/lazy/SkDiscardablePixelRef.h |
@@ -52,6 +52,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); |
} |