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

Unified Diff: src/android/SkBitmapRegionCodec.cpp

Issue 2302953002: Request legacy mode behavior from SkCodec in BitmapRegionDecoder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 3 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/android/SkBitmapRegionCodec.cpp
diff --git a/src/android/SkBitmapRegionCodec.cpp b/src/android/SkBitmapRegionCodec.cpp
index a335432b31a0d03d473b7647168aac123c42228c..9c21484ec55294626913aa34183a3d1fa25ae588 100644
--- a/src/android/SkBitmapRegionCodec.cpp
+++ b/src/android/SkBitmapRegionCodec.cpp
@@ -52,9 +52,12 @@ bool SkBitmapRegionCodec::decodeRegion(SkBitmap* bitmap, SkBRDAllocator* allocat
// Create the image info for the decode
SkColorType dstColorType = fCodec->computeOutputColorType(prefColorType);
SkAlphaType dstAlphaType = fCodec->computeOutputAlphaType(requireUnpremul);
- SkImageInfo decodeInfo = fCodec->getInfo().makeWH(scaledSize.width(), scaledSize.height())
- .makeColorType(dstColorType)
- .makeAlphaType(dstAlphaType);
+
+ // Enable legacy behavior to avoid any gamma correction. Android's assets are
+ // adjusted to expect a non-gamma correct premultiply.
+ sk_sp<SkColorSpace> colorSpace = nullptr;
+ SkImageInfo decodeInfo = SkImageInfo::Make(scaledSize.width(), scaledSize.height(),
+ dstColorType, dstAlphaType, colorSpace);
// Construct a color table for the decode if necessary
SkAutoTUnref<SkColorTable> colorTable(nullptr);
« 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