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

Unified Diff: src/lazy/SkDiscardablePixelRef.h

Issue 944823004: SkDiscardablePixelRef should favor not decoding to YUV if they already decoded to RGB. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Fixed nits. Created 5 years, 10 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/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);
}
« 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