Flutter Engine
The Flutter Engine
Class Methods | List of all members
FlutterDarwinExternalTextureSkImageWrapper Class Reference

#import <FlutterDarwinExternalTextureMetal.h>

Inheritance diagram for FlutterDarwinExternalTextureSkImageWrapper:

Class Methods

(sk_sp< SkImage >) + wrapYUVATexture:UVTex:YUVColorSpace:grContext:width:height:
 
(sk_sp< SkImage >) + wrapRGBATexture:grContext:width:height:
 
(sk_sp< SkImage >) + wrapYUVATexture:UVTex:YUVColorSpace:grContext:width:height: [implementation]
 
(sk_sp< SkImage >) + wrapRGBATexture:grContext:width:height: [implementation]
 

Detailed Description

Definition at line 16 of file FlutterDarwinExternalTextureMetal.h.

Method Documentation

◆ wrapRGBATexture:grContext:width:height: [1/2]

+ (sk_sp< SkImage >) wrapRGBATexture: (id<MTLTexture>)  rgbaTex
grContext: (nonnull GrDirectContext*)  grContext
width: (size_t)  width
height: (size_t)  height 
implementation

Definition at line 31 of file FlutterDarwinExternalTextureMetal.mm.

324 :(id<MTLTexture>)rgbaTex
325 grContext:(nonnull GrDirectContext*)grContext
326 width:(size_t)width
327 height:(size_t)height {
328#if SLIMPELLER
329 return nullptr;
330#else // SLIMPELLER
331
332 GrMtlTextureInfo skiaTextureInfo;
333 skiaTextureInfo.fTexture = sk_cfp<const void*>{(__bridge_retained const void*)rgbaTex};
334
335 GrBackendTexture skiaBackendTexture =
337
338 return SkImages::BorrowTextureFrom(grContext, skiaBackendTexture, kTopLeft_GrSurfaceOrigin,
340 /*colorSpace=*/nullptr, /*releaseProc*/ nullptr,
341 /*releaseContext*/ nullptr);
342#endif // SLIMPELLER
343}
@ kTopLeft_GrSurfaceOrigin
Definition: GrTypes.h:148
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
Definition: SkAlphaType.h:29
@ kBGRA_8888_SkColorType
pixel with 8 bits for blue, green, red, alpha; in 32-bit word
Definition: SkColorType.h:26
SK_API GrBackendTexture MakeMtl(int width, int height, skgpu::Mipmapped, const GrMtlTextureInfo &mtlInfo, std::string_view label={})
SK_API sk_sp< SkImage > BorrowTextureFrom(GrRecordingContext *context, const GrBackendTexture &backendTexture, GrSurfaceOrigin origin, SkColorType colorType, SkAlphaType alphaType, sk_sp< SkColorSpace > colorSpace, TextureReleaseProc textureReleaseProc=nullptr, ReleaseContext releaseContext=nullptr)
int32_t height
int32_t width

◆ wrapRGBATexture:grContext:width:height: [2/2]

+ (sk_sp< SkImage >) wrapRGBATexture: (nonnull id< MTLTexture >)  rgbaTex
grContext: (nonnull GrDirectContext *)  grContext
width: (size_t)  width
height: (size_t)  height 

◆ wrapYUVATexture:UVTex:YUVColorSpace:grContext:width:height: [1/2]

+ (sk_sp< SkImage >) wrapYUVATexture: (id<MTLTexture>)  yTex
UVTex: (id<MTLTexture>)  uvTex
YUVColorSpace: (SkYUVColorSpace colorSpace
grContext: (nonnull GrDirectContext*)  grContext
width: (size_t)  width
height: (size_t)  height 
implementation

Definition at line 31 of file FlutterDarwinExternalTextureMetal.mm.

292 :(id<MTLTexture>)yTex
293 UVTex:(id<MTLTexture>)uvTex
295 grContext:(nonnull GrDirectContext*)grContext
296 width:(size_t)width
297 height:(size_t)height {
298#if SLIMPELLER
299 return nullptr;
300#else // SLIMPELLER
301 GrMtlTextureInfo ySkiaTextureInfo;
302 ySkiaTextureInfo.fTexture = sk_cfp<const void*>{(__bridge_retained const void*)yTex};
303
304 GrBackendTexture skiaBackendTextures[2];
305 skiaBackendTextures[0] =
307
308 GrMtlTextureInfo uvSkiaTextureInfo;
309 uvSkiaTextureInfo.fTexture = sk_cfp<const void*>{(__bridge_retained const void*)uvTex};
310
311 skiaBackendTextures[1] =
313 SkYUVAInfo yuvaInfo(skiaBackendTextures[0].dimensions(), SkYUVAInfo::PlaneConfig::kY_UV,
315 GrYUVABackendTextures yuvaBackendTextures(yuvaInfo, skiaBackendTextures,
317
318 return SkImages::TextureFromYUVATextures(grContext, yuvaBackendTextures,
319 /*imageColorSpace=*/nullptr,
320 /*releaseProc*/ nullptr, /*releaseContext*/ nullptr);
321#endif // SLIMPELLER
322}
SkYUVColorSpace
Definition: SkImageInfo.h:68
@ kY_UV
Plane 0: Y, Plane 1: UV.
@ k444
No subsampling. UV values for each Y.
SK_API sk_sp< SkImage > TextureFromYUVATextures(GrRecordingContext *context, const GrYUVABackendTextures &yuvaTextures, sk_sp< SkColorSpace > imageColorSpace, TextureReleaseProc textureReleaseProc=nullptr, ReleaseContext releaseContext=nullptr)
YUVColorSpace
Definition: color.h:55

◆ wrapYUVATexture:UVTex:YUVColorSpace:grContext:width:height: [2/2]

+ (sk_sp< SkImage >) wrapYUVATexture: (nonnull id< MTLTexture >)  yTex
UVTex: (nonnull id< MTLTexture >)  uvTex
YUVColorSpace: (SkYUVColorSpace colorSpace
grContext: (nonnull GrDirectContext *)  grContext
width: (size_t)  width
height: (size_t)  height 

The documentation for this class was generated from the following files: