blob: bcbdbdd4b1412433c061a90bac68d0ca1804707b [file] [log] [blame]
Brian Salomonf391d0f2018-12-14 09:18:50 -05001/*
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 Daniel01f278c2020-06-12 16:58:17 -040011#include "include/core/SkImage.h"
Mike Kleinc0bd9f92019-04-23 12:05:21 -050012#include "include/gpu/mtl/GrMtlTypes.h"
Brian Salomonf391d0f2018-12-14 09:18:50 -050013
Greg Daniel01f278c2020-06-12 16:58:17 -040014class GrBackendFormat;
15
Brian Salomonf391d0f2018-12-14 09:18:50 -050016// Utilities that can be used from cpp files (rather than .mm).
17
18GrMTLPixelFormat GrGetMTLPixelFormatFromMtlTextureInfo(const GrMtlTextureInfo&);
19
Brian Salomondc8fcdb2020-03-26 16:45:05 -040020uint32_t GrMtlFormatChannels(GrMTLPixelFormat);
21
Greg Daniel01f278c2020-06-12 16:58:17 -040022SkImage::CompressionType GrMtlBackendFormatToCompressionType(const GrBackendFormat& format);
23
Robert Phillipsbac46722019-08-01 15:09:17 -040024#if GR_TEST_UTILS
25const char* GrMtlFormatToStr(GrMTLPixelFormat mtlFormat);
Robert Phillips9a30ee02020-04-29 08:58:39 -040026bool GrMtlFormatIsBGRA8(GrMTLPixelFormat mtlFormat);
Robert Phillipsbac46722019-08-01 15:09:17 -040027#endif
Brian Salomonf391d0f2018-12-14 09:18:50 -050028
29#endif