10#include "third_party/skia/include/core/SkColorSpace.h"
11#include "third_party/skia/include/gpu/ganesh/GrBackendSurface.h"
12#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
13#include "third_party/skia/include/gpu/ganesh/mtl/GrMtlBackendSurface.h"
14#include "third_party/skia/include/gpu/ganesh/mtl/GrMtlTypes.h"
19 sk_sp<GrDirectContext> context,
31 auto texture_info = test_metal_context_->CreateMetalTexture(surface_size);
33 GrMtlTextureInfo skia_texture_info;
34 skia_texture_info.fTexture.reset(SkCFSafeRetain(texture_info.texture));
35 GrBackendTexture backend_texture = GrBackendTextures::MakeMtl(
36 surface_size.width, surface_size.height, skgpu::Mipmapped::kNo, skia_texture_info);
39 SkSurfaces::WrapBackendTexture(
context_.get(), backend_texture, kTopLeft_GrSurfaceOrigin, 1,
40 kBGRA_8888_SkColorType,
nullptr,
nullptr);
43 FML_LOG(ERROR) <<
"Could not create Skia surface from a Metal texture.";
55 reinterpret_cast<SkSurface*
>(
user_data)->unref();
63 FML_LOG(FATAL) <<
"Unimplemented.";
69 FML_LOG(FATAL) <<
"Unimplemented.";
sk_sp< GrDirectContext > context_
@ kFlutterBackingStoreTypeMetal
Specifies a Metal backing store. This is backed by a Metal texture.
#define FML_LOG(severity)
impeller::ISize32 DlISize
FlutterSize size
The size of the render target the engine expects to render into.
FlutterMetalBackingStore metal
FlutterBackingStoreType type
Specifies the type of backing store.
FlutterMetalTextureHandle texture
VoidCallback destruction_callback