Brian Salomon | f391d0f | 2018-12-14 09:18:50 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #ifndef GrMtlCppUtil_DEFINED |
| 9 | #define GrMtlCppUtil_DEFINED |
| 10 | |
Greg Daniel | 01f278c | 2020-06-12 16:58:17 -0400 | [diff] [blame^] | 11 | #include "include/core/SkImage.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 12 | #include "include/gpu/mtl/GrMtlTypes.h" |
Brian Salomon | f391d0f | 2018-12-14 09:18:50 -0500 | [diff] [blame] | 13 | |
Greg Daniel | 01f278c | 2020-06-12 16:58:17 -0400 | [diff] [blame^] | 14 | class GrBackendFormat; |
| 15 | |
Brian Salomon | f391d0f | 2018-12-14 09:18:50 -0500 | [diff] [blame] | 16 | // Utilities that can be used from cpp files (rather than .mm). |
| 17 | |
| 18 | GrMTLPixelFormat GrGetMTLPixelFormatFromMtlTextureInfo(const GrMtlTextureInfo&); |
| 19 | |
Brian Salomon | dc8fcdb | 2020-03-26 16:45:05 -0400 | [diff] [blame] | 20 | uint32_t GrMtlFormatChannels(GrMTLPixelFormat); |
| 21 | |
Greg Daniel | 01f278c | 2020-06-12 16:58:17 -0400 | [diff] [blame^] | 22 | SkImage::CompressionType GrMtlBackendFormatToCompressionType(const GrBackendFormat& format); |
| 23 | |
Robert Phillips | bac4672 | 2019-08-01 15:09:17 -0400 | [diff] [blame] | 24 | #if GR_TEST_UTILS |
| 25 | const char* GrMtlFormatToStr(GrMTLPixelFormat mtlFormat); |
Robert Phillips | 9a30ee0 | 2020-04-29 08:58:39 -0400 | [diff] [blame] | 26 | bool GrMtlFormatIsBGRA8(GrMTLPixelFormat mtlFormat); |
Robert Phillips | bac4672 | 2019-08-01 15:09:17 -0400 | [diff] [blame] | 27 | #endif |
Brian Salomon | f391d0f | 2018-12-14 09:18:50 -0500 | [diff] [blame] | 28 | |
| 29 | #endif |