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

Unified Diff: include/codec/SkEncodedInfo.h

Issue 2000713003: Add SkColorSpace to SkImageInfo (Closed) Base URL: https://skia.googlesource.com/skia.git@public
Patch Set: Created 4 years, 7 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 | include/core/SkImageInfo.h » ('j') | include/core/SkImageInfo.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/codec/SkEncodedInfo.h
diff --git a/include/codec/SkEncodedInfo.h b/include/codec/SkEncodedInfo.h
index 0c5bd0b4212a24fef4db6853ed83105a32692d5d..d35aa2bab4c2fbb928e67a791cd24805cb2dc88e 100644
--- a/include/codec/SkEncodedInfo.h
+++ b/include/codec/SkEncodedInfo.h
@@ -9,7 +9,8 @@
#define SkEncodedInfo_DEFINED
#include "SkImageInfo.h"
-#include "../private/SkImageInfoPriv.h"
+
+class SkColorSpace;
struct SkEncodedInfo {
public:
@@ -116,22 +117,21 @@ public:
* Returns an SkImageInfo with Skia color and alpha types that are the
* closest possible match to the encoded info.
*/
- SkImageInfo makeImageInfo(int width, int height) const {
- SkColorProfileType profileType = SkDefaultColorProfile();
+ SkImageInfo makeImageInfo(int width, int height, const sk_sp<SkColorSpace>& colorSpace) const {
switch (fColor) {
case kGray_Color:
SkASSERT(kOpaque_Alpha == fAlpha);
return SkImageInfo::Make(width, height, kGray_8_SkColorType,
- kOpaque_SkAlphaType, profileType);
+ kOpaque_SkAlphaType, colorSpace);
case kGrayAlpha_Color:
SkASSERT(kOpaque_Alpha != fAlpha);
return SkImageInfo::Make(width, height, kN32_SkColorType,
- kUnpremul_SkAlphaType, profileType);
+ kUnpremul_SkAlphaType, colorSpace);
case kPalette_Color: {
SkAlphaType alphaType = (kOpaque_Alpha == fAlpha) ? kOpaque_SkAlphaType :
kUnpremul_SkAlphaType;
return SkImageInfo::Make(width, height, kIndex_8_SkColorType,
- alphaType, profileType);
+ alphaType, colorSpace);
}
case kRGB_Color:
case kBGR_Color:
@@ -141,13 +141,13 @@ public:
case kYCCK_Color:
SkASSERT(kOpaque_Alpha == fAlpha);
return SkImageInfo::Make(width, height, kN32_SkColorType,
- kOpaque_SkAlphaType, profileType);
+ kOpaque_SkAlphaType, colorSpace);
case kRGBA_Color:
case kBGRA_Color:
case kYUVA_Color:
SkASSERT(kOpaque_Alpha != fAlpha);
return SkImageInfo::Make(width, height, kN32_SkColorType,
- kUnpremul_SkAlphaType, profileType);
+ kUnpremul_SkAlphaType, colorSpace);
default:
SkASSERT(false);
return SkImageInfo::MakeUnknown();
« no previous file with comments | « no previous file | include/core/SkImageInfo.h » ('j') | include/core/SkImageInfo.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698