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

Unified Diff: src/gpu/SkGr.cpp

Issue 2173513002: Cleanup of code that converts from GPU-backed resources to SkImageInfo (Closed) Base URL: https://skia.googlesource.com/skia.git@fix-sync
Patch Set: Created 4 years, 5 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: src/gpu/SkGr.cpp
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index ef3a39bc61f27cd905aff9b93e44fec74c80f345..452218f517b97d5440c6eb967d2f9a22aeda9782 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -462,10 +462,8 @@ GrPixelConfig SkImageInfo2GrPixelConfig(SkColorType ct, SkAlphaType, const SkCol
return kUnknown_GrPixelConfig;
}
-bool GrPixelConfigToColorAndColorSpace(GrPixelConfig config, SkColorType* ctOut,
- sk_sp<SkColorSpace>* csOut) {
+bool GrPixelConfigToColorType(GrPixelConfig config, SkColorType* ctOut) {
SkColorType ct;
- sk_sp<SkColorSpace> cs = nullptr;
switch (config) {
case kAlpha_8_GrPixelConfig:
ct = kAlpha_8_SkColorType;
@@ -487,11 +485,9 @@ bool GrPixelConfigToColorAndColorSpace(GrPixelConfig config, SkColorType* ctOut,
break;
case kSRGBA_8888_GrPixelConfig:
ct = kRGBA_8888_SkColorType;
- cs = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
break;
case kSBGRA_8888_GrPixelConfig:
ct = kBGRA_8888_SkColorType;
- cs = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
break;
case kRGBA_half_GrPixelConfig:
ct = kRGBA_F16_SkColorType;
@@ -502,9 +498,6 @@ bool GrPixelConfigToColorAndColorSpace(GrPixelConfig config, SkColorType* ctOut,
if (ctOut) {
*ctOut = ct;
}
- if (csOut) {
- *csOut = cs;
- }
return true;
}
@@ -741,22 +734,6 @@ bool SkPaintToGrPaintWithTexture(GrContext* context,
////////////////////////////////////////////////////////////////////////////////////////////////
-SkImageInfo GrMakeInfoFromTexture(GrTexture* tex, int w, int h, bool isOpaque,
- sk_sp<SkColorSpace> colorSpace) {
-#ifdef SK_DEBUG
- const GrSurfaceDesc& desc = tex->desc();
- SkASSERT(w <= desc.fWidth);
- SkASSERT(h <= desc.fHeight);
-#endif
- const GrPixelConfig config = tex->config();
- SkColorType ct = kUnknown_SkColorType;
- SkAlphaType at = isOpaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType;
- if (!GrPixelConfigToColorAndColorSpace(config, &ct, nullptr)) {
- ct = kUnknown_SkColorType;
- }
- return SkImageInfo::Make(w, h, ct, at, std::move(colorSpace));
-}
-
GrTextureParams::FilterMode GrSkFilterQualityToGrFilterMode(SkFilterQuality paintFilterQuality,
const SkMatrix& viewM,
const SkMatrix& localM,
« no previous file with comments | « src/gpu/SkGpuDevice.h ('k') | src/gpu/SkGrPriv.h » ('j') | src/image/SkImage_Gpu.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698