Flutter Engine
The Flutter Engine
|
#import <Metal/Metal.h>
#include "include/gpu/GrBackendSurface.h"
#include "include/gpu/GrContextOptions.h"
#include "include/gpu/ganesh/mtl/GrMtlBackendSurface.h"
#include "include/private/gpu/ganesh/GrTypesPriv.h"
#include "src/gpu/ganesh/mtl/GrMtlTypesPriv.h"
#include "src/sksl/ir/SkSLProgram.h"
Go to the source code of this file.
Namespaces | |
namespace | SkSL |
Enumerations | |
enum class | GrMtlErrorCode { kTimeout = 1 } |
Functions | |
GR_NORETAIN_BEGIN SK_ALWAYS_INLINE id< MTLTexture > | GrGetMTLTexture (const void *mtlTexture) |
SK_ALWAYS_INLINE const void * | GrGetPtrFromId (id idObject) |
SK_ALWAYS_INLINE CF_RETURNS_RETAINED const void * | GrRetainPtrFromId (id idObject) |
NSError * | GrCreateMtlError (NSString *description, GrMtlErrorCode errorCode) |
MTLTextureDescriptor * | GrGetMTLTextureDescriptor (id< MTLTexture > mtlTexture) |
id< MTLLibrary > | GrCompileMtlShaderLibrary (const GrMtlGpu *gpu, const std::string &msl, GrContextOptions::ShaderErrorHandler *errorHandler) |
void | GrPrecompileMtlShaderLibrary (const GrMtlGpu *gpu, const std::string &msl) |
id< MTLLibrary > | GrMtlNewLibraryWithSource (id< MTLDevice >, NSString *mslCode, MTLCompileOptions *, NSError **) |
id< MTLRenderPipelineState > | GrMtlNewRenderPipelineStateWithDescriptor (id< MTLDevice >, MTLRenderPipelineDescriptor *, NSError **) |
id< MTLTexture > | GrGetMTLTextureFromSurface (GrSurface *surface) |
static MTLPixelFormat | GrBackendFormatAsMTLPixelFormat (const GrBackendFormat &format) |
SkTextureCompressionType | GrMtlFormatToCompressionType (MTLPixelFormat) |
int | GrMtlFormatStencilBits (MTLPixelFormat) |
GrColorFormatDesc | GrMtlFormatDesc (MTLPixelFormat) |
|
strong |
Enumerator | |
---|---|
kTimeout |
Definition at line 63 of file GrMtlUtil.h.
|
inlinestatic |
Definition at line 106 of file GrMtlUtil.h.
id< MTLLibrary > GrCompileMtlShaderLibrary | ( | const GrMtlGpu * | gpu, |
const std::string & | msl, | ||
GrContextOptions::ShaderErrorHandler * | errorHandler | ||
) |
Returns a compiled MTLLibrary created from MSL code
Definition at line 52 of file GrMtlUtil.mm.
NSError * GrCreateMtlError | ( | NSString * | description, |
GrMtlErrorCode | errorCode | ||
) |
Definition at line 28 of file GrMtlUtil.mm.
GR_NORETAIN_BEGIN SK_ALWAYS_INLINE id< MTLTexture > GrGetMTLTexture | ( | const void * | mtlTexture | ) |
Returns a id<MTLTexture> to the MTLTexture pointed at by the const void*.
TODO: Remove this and the other bridging functions? It's better to cast on the calling side so ARC has more context, and they don't add much value.
Definition at line 36 of file GrMtlUtil.h.
MTLTextureDescriptor * GrGetMTLTextureDescriptor | ( | id< MTLTexture > | mtlTexture | ) |
Returns a MTLTextureDescriptor which describes the MTLTexture. Useful when creating a duplicate MTLTexture without the same storage allocation.
Definition at line 36 of file GrMtlUtil.mm.
Returns a MTLTexture corresponding to the GrSurface.
Definition at line 201 of file GrMtlUtil.mm.
SK_ALWAYS_INLINE const void * GrGetPtrFromId | ( | id | idObject | ) |
Returns a const void* to whatever the id object is pointing to.
Definition at line 47 of file GrMtlUtil.h.
GrColorFormatDesc GrMtlFormatDesc | ( | MTLPixelFormat | mtlFormat | ) |
Definition at line 233 of file GrMtlUtil.mm.
int GrMtlFormatStencilBits | ( | MTLPixelFormat | format | ) |
Definition at line 302 of file GrMtlUtil.mm.
SkTextureCompressionType GrMtlFormatToCompressionType | ( | MTLPixelFormat | format | ) |
Maps a MTLPixelFormat into the CompressionType enum if applicable.
Definition at line 282 of file GrMtlUtil.mm.
id< MTLLibrary > GrMtlNewLibraryWithSource | ( | id< MTLDevice > | device, |
NSString * | mslCode, | ||
MTLCompileOptions * | options, | ||
NSError ** | error | ||
) |
Replacement for newLibraryWithSource:options:error that has a timeout.
Definition at line 130 of file GrMtlUtil.mm.
id< MTLRenderPipelineState > GrMtlNewRenderPipelineStateWithDescriptor | ( | id< MTLDevice > | device, |
MTLRenderPipelineDescriptor * | pipelineDescriptor, | ||
NSError ** | error | ||
) |
Replacement for newRenderPipelineStateWithDescriptor:error that has a timeout.
Definition at line 166 of file GrMtlUtil.mm.
void GrPrecompileMtlShaderLibrary | ( | const GrMtlGpu * | gpu, |
const std::string & | msl | ||
) |
Attempts to compile an MSL shader asynchronously. We are not concerned about the result, which will be cached in the Apple shader cache.
Definition at line 94 of file GrMtlUtil.mm.
SK_ALWAYS_INLINE CF_RETURNS_RETAINED const void * GrRetainPtrFromId | ( | id | idObject | ) |
Returns a const void* to whatever the id object is pointing to. Will call CFRetain on the object.
Definition at line 59 of file GrMtlUtil.h.