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

Unified Diff: src/gpu/SkGr.cpp

Issue 2071393002: More removal of SkColorProfileType... (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Restore API used in Chrome Created 4 years, 6 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 | « src/gpu/GrSurface.cpp ('k') | src/gpu/SkGrPriv.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGr.cpp
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index 60fcdd513965a3a678b509036f0f1ea916af4de8..f937b16d55e166f0d1481186752e4507a2ed4816 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -453,10 +453,10 @@ GrPixelConfig SkImageInfo2GrPixelConfig(SkColorType ct, SkAlphaType, const SkCol
return kUnknown_GrPixelConfig;
}
-bool GrPixelConfig2ColorAndProfileType(GrPixelConfig config, SkColorType* ctOut,
- SkColorProfileType* ptOut) {
+bool GrPixelConfigToColorAndColorSpace(GrPixelConfig config, SkColorType* ctOut,
+ sk_sp<SkColorSpace>* csOut) {
SkColorType ct;
- SkColorProfileType pt = kLinear_SkColorProfileType;
+ sk_sp<SkColorSpace> cs = nullptr;
switch (config) {
case kAlpha_8_GrPixelConfig:
ct = kAlpha_8_SkColorType;
@@ -478,11 +478,11 @@ bool GrPixelConfig2ColorAndProfileType(GrPixelConfig config, SkColorType* ctOut,
break;
case kSRGBA_8888_GrPixelConfig:
ct = kRGBA_8888_SkColorType;
- pt = kSRGB_SkColorProfileType;
+ cs = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
break;
case kSBGRA_8888_GrPixelConfig:
ct = kBGRA_8888_SkColorType;
- pt = kSRGB_SkColorProfileType;
+ cs = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
break;
case kRGBA_half_GrPixelConfig:
ct = kRGBA_F16_SkColorType;
@@ -493,8 +493,8 @@ bool GrPixelConfig2ColorAndProfileType(GrPixelConfig config, SkColorType* ctOut,
if (ctOut) {
*ctOut = ct;
}
- if (ptOut) {
- *ptOut = pt;
+ if (csOut) {
+ *csOut = cs;
}
return true;
}
@@ -724,9 +724,9 @@ SkImageInfo GrMakeInfoFromTexture(GrTexture* tex, int w, int h, bool isOpaque) {
SkASSERT(h <= desc.fHeight);
#endif
const GrPixelConfig config = tex->config();
- SkColorType ct;
+ SkColorType ct = kUnknown_SkColorType;
SkAlphaType at = isOpaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType;
- if (!GrPixelConfig2ColorAndProfileType(config, &ct, nullptr)) {
+ if (!GrPixelConfigToColorAndColorSpace(config, &ct, nullptr)) {
ct = kUnknown_SkColorType;
}
return SkImageInfo::Make(w, h, ct, at);
« no previous file with comments | « src/gpu/GrSurface.cpp ('k') | src/gpu/SkGrPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698