aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/mtl
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2018-06-01 16:10:53 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-01 20:50:56 +0000
commit9363ac40b66b761634c077c50617bf6c6fb3f3ea (patch)
tree918ba8a306af73ec33071f301e9b20b45fa58edd /src/gpu/mtl
parentb54d2239d36f60087efb2611d320364d7b06374c (diff)
Remove most of the remaining conflation of colorSpace and sRGB in Ganesh
Change-Id: I22cd838f15c548b459da925cd7e7d228f95fb2e2 Reviewed-on: https://skia-review.googlesource.com/131583 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/gpu/mtl')
-rw-r--r--src/gpu/mtl/GrMtlTexture.mm7
-rw-r--r--src/gpu/mtl/GrMtlUtil.h6
-rw-r--r--src/gpu/mtl/GrMtlUtil.mm20
3 files changed, 1 insertions, 32 deletions
diff --git a/src/gpu/mtl/GrMtlTexture.mm b/src/gpu/mtl/GrMtlTexture.mm
index e029836b60..ac4e73579a 100644
--- a/src/gpu/mtl/GrMtlTexture.mm
+++ b/src/gpu/mtl/GrMtlTexture.mm
@@ -31,12 +31,7 @@ sk_sp<GrMtlTexture> GrMtlTexture::CreateNewTexture(GrMtlGpu* gpu, SkBudgeted bud
descriptor.cpuCacheMode = MTLCPUCacheModeWriteCombined;
// Shared is not available on MacOS. Is there a reason to want managed to allow mapping?
descriptor.storageMode = MTLStorageModePrivate;
-
- MTLTextureUsage texUsage = MTLTextureUsageShaderRead;
- if (GrMTLFormatIsSRGB(format, nullptr)) {
- texUsage |= MTLTextureUsagePixelFormatView;
- }
- descriptor.usage = texUsage;
+ descriptor.usage = MTLTextureUsageShaderRead;
id<MTLTexture> texture = [gpu->device() newTextureWithDescriptor:descriptor];
diff --git a/src/gpu/mtl/GrMtlUtil.h b/src/gpu/mtl/GrMtlUtil.h
index 1900c3933d..e53a8f5ee8 100644
--- a/src/gpu/mtl/GrMtlUtil.h
+++ b/src/gpu/mtl/GrMtlUtil.h
@@ -23,10 +23,4 @@ bool GrPixelConfigToMTLFormat(GrPixelConfig config, MTLPixelFormat* format);
*/
GrPixelConfig GrMTLFormatToPixelConfig(MTLPixelFormat format);
-/**
- * Returns true if the given vulkan texture format is sRGB encoded.
- * Also provides the non-sRGB version, if there is one.
- */
-bool GrMTLFormatIsSRGB(MTLPixelFormat format, MTLPixelFormat* linearFormat);
-
#endif
diff --git a/src/gpu/mtl/GrMtlUtil.mm b/src/gpu/mtl/GrMtlUtil.mm
index e8a736c8f1..3c5df209c4 100644
--- a/src/gpu/mtl/GrMtlUtil.mm
+++ b/src/gpu/mtl/GrMtlUtil.mm
@@ -113,23 +113,3 @@ GrPixelConfig GrMTLFormatToPixelConfig(MTLPixelFormat format) {
return kUnknown_GrPixelConfig;
}
}
-
-bool GrMTLFormatIsSRGB(MTLPixelFormat format, MTLPixelFormat* linearFormat) {
- MTLPixelFormat linearFmt = format;
- switch (format) {
- case MTLPixelFormatRGBA8Unorm_sRGB:
- linearFmt = MTLPixelFormatRGBA8Unorm;
- break;
- case MTLPixelFormatBGRA8Unorm_sRGB:
- linearFmt = MTLPixelFormatBGRA8Unorm;
- break;
- default:
- break;
- }
-
- if (linearFormat) {
- *linearFormat = linearFmt;
- }
- return (linearFmt != format);
-}
-