Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Class Methods | List of all members
FlutterDarwinExternalTextureSkImageWrapper Class Reference

#include <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.

320 :(id<MTLTexture>)rgbaTex
321 grContext:(nonnull GrDirectContext*)grContext
322 width:(size_t)width
323 height:(size_t)height {
324 GrMtlTextureInfo skiaTextureInfo;
325 skiaTextureInfo.fTexture = sk_cfp<const void*>{(__bridge_retained const void*)rgbaTex};
326
327 GrBackendTexture skiaBackendTexture =
328 GrBackendTextures::MakeMtl(width, height, skgpu::Mipmapped ::kNo, skiaTextureInfo);
329
330 return SkImages::BorrowTextureFrom(grContext, skiaBackendTexture, kTopLeft_GrSurfaceOrigin,
332 /*colorSpace=*/nullptr, /*releaseProc*/ nullptr,
333 /*releaseContext*/ nullptr);
334}
@ 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 GrMtlTextureInfo ySkiaTextureInfo;
299 ySkiaTextureInfo.fTexture = sk_cfp<const void*>{(__bridge_retained const void*)yTex};
300
301 GrBackendTexture skiaBackendTextures[2];
302 skiaBackendTextures[0] =
303 GrBackendTextures::MakeMtl(width, height, skgpu::Mipmapped::kNo, ySkiaTextureInfo);
304
305 GrMtlTextureInfo uvSkiaTextureInfo;
306 uvSkiaTextureInfo.fTexture = sk_cfp<const void*>{(__bridge_retained const void*)uvTex};
307
308 skiaBackendTextures[1] =
309 GrBackendTextures::MakeMtl(width, height, skgpu::Mipmapped::kNo, uvSkiaTextureInfo);
310 SkYUVAInfo yuvaInfo(skiaBackendTextures[0].dimensions(), SkYUVAInfo::PlaneConfig::kY_UV,
312 GrYUVABackendTextures yuvaBackendTextures(yuvaInfo, skiaBackendTextures,
314
315 return SkImages::TextureFromYUVATextures(grContext, yuvaBackendTextures,
316 /*imageColorSpace=*/nullptr,
317 /*releaseProc*/ nullptr, /*releaseContext*/ nullptr);
318}
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
const uintptr_t id

◆ 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: