| 1 |
/* |
| 2 |
* Copyright 2024 Google LLC |
| 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 |
#ifndef GrMtlBackendSurface_DEFINED |
| 8 |
#define GrMtlBackendSurface_DEFINED |
| 9 |
|
| 10 |
#include "include/gpu/ganesh/mtl/GrMtlTypes.h" |
| 11 |
#include "include/private/base/SkAPI.h" |
| 12 |
|
| 13 |
#include <string_view> |
| 14 |
|
| 15 |
class GrBackendFormat; |
| 16 |
class GrBackendTexture; |
| 17 |
class GrBackendRenderTarget; |
| 18 |
|
| 19 |
namespace GrBackendFormats { |
| 20 |
SK_API GrBackendFormat MakeMtl(GrMTLPixelFormat format); |
| 21 |
|
| 22 |
SK_API GrMTLPixelFormat AsMtlFormat(const GrBackendFormat&); |
| 23 |
|
| 24 |
} // namespace GrBackendFormats |
| 25 |
|
| 26 |
namespace GrBackendTextures { |
| 27 |
SK_API GrBackendTexture MakeMtl(int width, |
| 28 |
int height, |
| 29 |
skgpu::Mipmapped, |
| 30 |
const GrMtlTextureInfo& mtlInfo, |
| 31 |
std::string_view label = {}); |
| 32 |
|
| 33 |
SK_API bool GetMtlTextureInfo(const GrBackendTexture&, GrMtlTextureInfo*); |
| 34 |
|
| 35 |
} // namespace GrBackendTextures |
| 36 |
|
| 37 |
namespace GrBackendRenderTargets { |
| 38 |
SK_API GrBackendRenderTarget MakeMtl(int width, int height, const GrMtlTextureInfo& mtlInfo); |
| 39 |
|
| 40 |
SK_API bool GetMtlTextureInfo(const GrBackendRenderTarget&, GrMtlTextureInfo*); |
| 41 |
|
| 42 |
} // namespace GrBackendRenderTargets |
| 43 |
|
| 44 |
#endif |