Flutter Engine
The Flutter Engine
Functions
GrBackendFormats Namespace Reference

Functions

SK_API GrBackendFormat MakeGL (GrGLenum format, GrGLenum target)
 
SK_API GrGLFormat AsGLFormat (const GrBackendFormat &)
 
SK_API GrGLenum AsGLFormatEnum (const GrBackendFormat &)
 
SK_API GrBackendFormat MakeMtl (GrMTLPixelFormat format)
 
SK_API GrMTLPixelFormat AsMtlFormat (const GrBackendFormat &)
 
SK_API GrBackendFormat MakeVk (VkFormat format, bool willUseDRMFormatModifiers=false)
 
SK_API GrBackendFormat MakeVk (const skgpu::VulkanYcbcrConversionInfo &ycbcrInfo, bool willUseDRMFormatModifiers=false)
 
SK_API bool AsVkFormat (const GrBackendFormat &, VkFormat *)
 
SK_API const skgpu::VulkanYcbcrConversionInfoGetVkYcbcrConversionInfo (const GrBackendFormat &)
 

Function Documentation

◆ AsGLFormat()

GrGLFormat GrBackendFormats::AsGLFormat ( const GrBackendFormat format)

Definition at line 119 of file GrGLBackendSurface.cpp.

119 {
120 if (format.isValid() && format.backend() == GrBackendApi::kOpenGL) {
122 SkASSERT(data);
123 return GrGLFormatFromGLEnum(data->asEnum());
124 }
126}
static const GrGLBackendFormatData * get_and_cast_data(const GrBackendFormat &format)
static constexpr GrGLFormat GrGLFormatFromGLEnum(GrGLenum glFormat)
Definition: GrGLUtil.h:409
#define SkASSERT(cond)
Definition: SkAssert.h:116
uint32_t uint32_t * format
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63

◆ AsGLFormatEnum()

GrGLenum GrBackendFormats::AsGLFormatEnum ( const GrBackendFormat format)

Definition at line 128 of file GrGLBackendSurface.cpp.

128 {
129 if (format.isValid() && format.backend() == GrBackendApi::kOpenGL) {
131 SkASSERT(data);
132 return data->asEnum();
133 }
134 return 0;
135}

◆ AsMtlFormat()

GrMTLPixelFormat GrBackendFormats::AsMtlFormat ( const GrBackendFormat format)

Definition at line 80 of file GrMtlBackendSurface.mm.

80 {
81 if (format.isValid() && format.backend() == GrBackendApi::kMetal) {
84 return data->asMtlFormat();
85 }
86 // MTLPixelFormatInvalid == 0
87 return GrMTLPixelFormat(0);
88}
static const GrMtlBackendFormatData * get_and_cast_data(const GrBackendFormat &format)
unsigned int GrMTLPixelFormat
Definition: GrMtlTypes.h:17

◆ AsVkFormat()

bool GrBackendFormats::AsVkFormat ( const GrBackendFormat format,
VkFormat vkFormat 
)

Definition at line 138 of file GrVkBackendSurface.cpp.

138 {
139 SkASSERT(vkFormat);
140 if (format.isValid() && format.backend() == GrBackendApi::kVulkan) {
142 SkASSERT(data);
143 *vkFormat = data->asVkFormat();
144 return true;
145 }
146 return false;
147}
static const GrVkBackendFormatData * get_and_cast_data(const GrBackendFormat &format)

◆ GetVkYcbcrConversionInfo()

const skgpu::VulkanYcbcrConversionInfo * GrBackendFormats::GetVkYcbcrConversionInfo ( const GrBackendFormat format)

Definition at line 149 of file GrVkBackendSurface.cpp.

149 {
150 if (format.isValid() && format.backend() == GrBackendApi::kVulkan) {
152 SkASSERT(data);
153 return data->getYcbcrConversionInfo();
154 }
155 return nullptr;
156}

◆ MakeGL()

GrBackendFormat GrBackendFormats::MakeGL ( GrGLenum  format,
GrGLenum  target 
)

Definition at line 114 of file GrGLBackendSurface.cpp.

114 {
117}
static GrTextureType gl_target_to_gr_target(GrGLenum target)
static GrBackendFormat MakeGrBackendFormat(GrTextureType textureType, GrBackendApi api, const FormatData &data)
uint32_t * target

◆ MakeMtl()

GrBackendFormat GrBackendFormats::MakeMtl ( GrMTLPixelFormat  format)

◆ MakeVk() [1/2]

GrBackendFormat GrBackendFormats::MakeVk ( const skgpu::VulkanYcbcrConversionInfo ycbcrInfo,
bool  willUseDRMFormatModifiers = false 
)

Definition at line 125 of file GrVkBackendSurface.cpp.

126 {
127 SkASSERT(ycbcrInfo.isValid());
128 GrTextureType textureType =
129 ((ycbcrInfo.isValid() && ycbcrInfo.fExternalFormat) || willUseDRMFormatModifiers)
133 textureType,
135 GrVkBackendFormatData(ycbcrInfo.fFormat, ycbcrInfo));
136}
GrTextureType
Definition: GrTypesPriv.h:268

◆ MakeVk() [2/2]

GrBackendFormat GrBackendFormats::MakeVk ( VkFormat  format,
bool  willUseDRMFormatModifiers = false 
)