xref: /aosp_15_r20/external/skia/src/gpu/ganesh/mtl/GrMtlCppUtil.h (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
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 
11 #include "include/gpu/ganesh/mtl/GrMtlTypes.h"
12 #include "include/private/gpu/ganesh/GrTypesPriv.h"
13 
14 // Utilities that can be used from cpp files (rather than .mm).
15 
16 GrMTLPixelFormat GrGetMTLPixelFormatFromMtlTextureInfo(const GrMtlTextureInfo&);
17 
18 /**
19  * Gets the sample count of a texture held by GrMtlTextureInfo or zero if the texture is nil.
20  */
21 int GrMtlTextureInfoSampleCount(const GrMtlTextureInfo&);
22 
23 #if defined(SK_DEBUG) || defined(GPU_TEST_UTILS)
24 bool GrMtlFormatIsBGRA8(GrMTLPixelFormat mtlFormat);
25 #endif
26 
27 #endif
28