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

Unified Diff: include/codec/SkEncodedInfo.h

Issue 1893203006: Make all the codecs default profiles based on gDefaultProfileIsSRGB. (Closed) Base URL: https://skia.googlesource.com/skia.git@add-imageinfo-to-SkImage_Base
Patch Set: Make private work. Created 4 years, 8 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
Index: include/codec/SkEncodedInfo.h
diff --git a/include/codec/SkEncodedInfo.h b/include/codec/SkEncodedInfo.h
index f91660529e05a26194fdf8b5084f211133298ab5..807eeeea13d164ee51a75d0144ce29139b9408be 100644
--- a/include/codec/SkEncodedInfo.h
+++ b/include/codec/SkEncodedInfo.h
@@ -9,6 +9,7 @@
#define SkEncodedInfo_DEFINED
#include "SkImageInfo.h"
+#include "../private/SkImageInfoPriv.h"
struct SkEncodedInfo {
public:
@@ -124,18 +125,21 @@ public:
* closest possible match to the encoded info.
*/
SkImageInfo makeImageInfo(int width, int height) const {
+ SkColorProfileType profileType = SkDefaultColorProfile();
switch (fColor) {
case kGray_Color:
SkASSERT(kOpaque_Alpha == fAlpha);
- return SkImageInfo::Make(width, height, kGray_8_SkColorType, kOpaque_SkAlphaType);
+ return SkImageInfo::Make(width, height, kGray_8_SkColorType,
+ kOpaque_SkAlphaType, profileType);
case kGrayAlpha_Color:
SkASSERT(kOpaque_Alpha != fAlpha);
return SkImageInfo::Make(width, height, kN32_SkColorType,
- kUnpremul_SkAlphaType);
+ kUnpremul_SkAlphaType, profileType);
case kPalette_Color: {
SkAlphaType alphaType = (kOpaque_Alpha == fAlpha) ? kOpaque_SkAlphaType :
kUnpremul_SkAlphaType;
- return SkImageInfo::Make(width, height, kIndex_8_SkColorType, alphaType);
+ return SkImageInfo::Make(width, height, kIndex_8_SkColorType,
+ alphaType, profileType);
}
case kRGB_Color:
case kBGR_Color:
@@ -144,12 +148,14 @@ public:
case kInvertedCMYK_Color:
case kYCCK_Color:
SkASSERT(kOpaque_Alpha == fAlpha);
- return SkImageInfo::Make(width, height, kN32_SkColorType, kOpaque_SkAlphaType);
+ return SkImageInfo::Make(width, height, kN32_SkColorType,
+ kOpaque_SkAlphaType, profileType);
case kRGBA_Color:
case kBGRA_Color:
case kYUVA_Color:
SkASSERT(kOpaque_Alpha != fAlpha);
- return SkImageInfo::Make(width, height, kN32_SkColorType, kUnpremul_SkAlphaType);
+ return SkImageInfo::Make(width, height, kN32_SkColorType,
+ kUnpremul_SkAlphaType, profileType);
default:
SkASSERT(false);
return SkImageInfo::MakeUnknown();
« no previous file with comments | « gyp/core.gypi ('k') | include/private/SkImageInfoPriv.h » ('j') | src/core/SkBitmap.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698