15#import <Metal/Metal.h>
17using sk_gpu_test::ManagedBackendTexture;
51 auto dContext = ctxInfo.directContext();
54 constexpr SkColor4f kTransCol { 0, 0.25f, 0.75f, 0.5f };
55 constexpr SkColor4f kGrayCol { 0.75f, 0.75f, 0.75f, 0.75f };
59 MTLPixelFormat fFormat;
73 { 0.25f, 0.5f, 0.75f, 1.0f } },
74#ifdef SK_BUILD_FOR_MAC
76 { 0.25f, 0.5f, 0.75f, 1.0f } },
78#ifdef SK_BUILD_FOR_IOS
100 for (
auto combo : combinations) {
132 return ManagedBackendTexture::MakeWithoutData(dContext,
154 switch (combo.fColorType) {
182 combo.fColor, mipmapped, renderable);
207 createWithSrcDataMtd,
static constexpr SkColorType GrColorTypeToSkColorType(GrColorType ct)
@ kBottomLeft_GrSurfaceOrigin
@ kTopLeft_GrSurfaceOrigin
void test_wrapping(GrDirectContext *, skiatest::Reporter *, const std::function< sk_sp< ManagedBackendTexture >(GrDirectContext *, skgpu::Mipmapped, GrRenderable)> &create, GrColorType, skgpu::Mipmapped, GrRenderable)
void test_color_init(GrDirectContext *, skiatest::Reporter *, const std::function< sk_sp< ManagedBackendTexture >(GrDirectContext *, const SkColor4f &, skgpu::Mipmapped, GrRenderable)> &create, GrColorType, const SkColor4f &, skgpu::Mipmapped, GrRenderable)
void test_pixmap_init(GrDirectContext *, skiatest::Reporter *, const std::function< sk_sp< ManagedBackendTexture >(GrDirectContext *, const SkPixmap srcData[], int numLevels, GrSurfaceOrigin, GrRenderable)> &create, SkColorType, GrSurfaceOrigin, skgpu::Mipmapped, GrRenderable)
DEF_GANESH_TEST_FOR_METAL_CONTEXT(MtlBackendAllocationTest, reporter, ctxInfo)
@ kUnknown_SkColorType
uninitialized
bool mipmapSupport() const
bool isFormatAsColorTypeRenderable(GrColorType ct, const GrBackendFormat &format, int sampleCount=1) const override
bool isFormatTexturable(const GrBackendFormat &, GrTextureType) const override
constexpr std::array< float, 4 > applyTo(std::array< float, 4 > color) const
uint32_t uint32_t * format
Dart_NativeFunction function
constexpr SkColor4f kLtGray
constexpr SkColor4f kGreen
constexpr SkColor4f kBlue
constexpr SkColor4f kYellow
SK_API sk_sp< SkPixelRef > MakeWithData(const SkImageInfo &, size_t rowBytes, sk_sp< SkData > data)