Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
GrBackendTextures Namespace Reference

Functions

SK_API GrBackendTexture MakeGL (int width, int height, skgpu::Mipmapped, const GrGLTextureInfo &glInfo, std::string_view label={})
 
SK_API bool GetGLTextureInfo (const GrBackendTexture &, GrGLTextureInfo *)
 
SK_API void GLTextureParametersModified (GrBackendTexture *)
 
SK_API GrBackendTexture MakeMtl (int width, int height, skgpu::Mipmapped, const GrMtlTextureInfo &mtlInfo, std::string_view label={})
 
SK_API bool GetMtlTextureInfo (const GrBackendTexture &, GrMtlTextureInfo *)
 
SK_API GrBackendTexture MakeVk (int width, int height, const GrVkImageInfo &, std::string_view label={})
 
SK_API bool GetVkImageInfo (const GrBackendTexture &, GrVkImageInfo *)
 
SK_API void SetVkImageLayout (GrBackendTexture *, VkImageLayout)
 

Function Documentation

◆ GetGLTextureInfo()

bool GrBackendTextures::GetGLTextureInfo ( const GrBackendTexture tex,
GrGLTextureInfo outInfo 
)

Definition at line 213 of file GrGLBackendSurface.cpp.

213 {
214 if (!tex.isValid() || tex.backend() != GrBackendApi::kOpenGL) {
215 return false;
216 }
217 const GrGLBackendTextureData* data = get_and_cast_data(tex);
218 SkASSERT(data);
219 *outInfo = data->info().info();
220 return true;
221}
static const GrGLBackendFormatData * get_and_cast_data(const GrBackendFormat &format)
#define SkASSERT(cond)
Definition SkAssert.h:116
GrBackendApi backend() const

◆ GetMtlTextureInfo()

bool GrBackendTextures::GetMtlTextureInfo ( const GrBackendTexture tex,
GrMtlTextureInfo *  outInfo 
)

Definition at line 150 of file GrMtlBackendSurface.mm.

150 {
151 if (!tex.isValid() || tex.backend() != GrBackendApi::kMetal) {
152 return false;
153 }
155 SkASSERT(data);
156 *outInfo = data->info();
157 return true;
158}
static const GrMtlBackendFormatData * get_and_cast_data(const GrBackendFormat &format)

◆ GetVkImageInfo()

bool GrBackendTextures::GetVkImageInfo ( const GrBackendTexture tex,
GrVkImageInfo outInfo 
)

Definition at line 303 of file GrVkBackendSurface.cpp.

303 {
304 if (!tex.isValid() || tex.backend() != GrBackendApi::kVulkan) {
305 return false;
306 }
307 const GrVkBackendTextureData* data = get_and_cast_data(tex);
308 SkASSERT(data);
309 *outInfo = GrVkImageInfoWithMutableState(data->info(), data->mutableState());
310 return true;
311}
static const GrVkBackendFormatData * get_and_cast_data(const GrBackendFormat &format)
GrVkImageInfo GrVkImageInfoWithMutableState(const GrVkImageInfo &info, const skgpu::MutableTextureState *mutableState)

◆ GLTextureParametersModified()

void GrBackendTextures::GLTextureParametersModified ( GrBackendTexture tex)

Definition at line 223 of file GrGLBackendSurface.cpp.

223 {
224 if (tex && tex->isValid() && tex->backend() == GrBackendApi::kOpenGL) {
226 SkASSERT(data);
227 data->info().parameters()->invalidate();
228 }
229}

◆ MakeGL()

GrBackendTexture GrBackendTextures::MakeGL ( int  width,
int  height,
skgpu::Mipmapped  mipped,
const GrGLTextureInfo glInfo,
std::string_view  label = {} 
)

Definition at line 180 of file GrGLBackendSurface.cpp.

184 {
186 width,
187 height,
188 label,
189 mipped,
192 GrGLBackendTextureData(glInfo, sk_make_sp<GrGLTextureParameters>()));
193 // Make no assumptions about client's texture's parameters.
195 return tex;
196}
static GrTextureType gl_target_to_gr_target(GrGLenum target)
static GrBackendTexture MakeGrBackendTexture(int width, int height, std::string_view label, skgpu::Mipmapped mipped, GrBackendApi backend, GrTextureType texture, const TextureData &data)
SK_API void GLTextureParametersModified(GrBackendTexture *)
int32_t height
int32_t width
GrGLenum fTarget
Definition GrGLTypes.h:181

◆ MakeMtl()

GrBackendTexture GrBackendTextures::MakeMtl ( int  width,
int  height,
skgpu::Mipmapped  mipmapped,
const GrMtlTextureInfo &  mtlInfo,
std::string_view  label = {} 
)

Definition at line 136 of file GrMtlBackendSurface.mm.

140 {
142 height,
143 label,
144 mipmapped,
147 GrMtlBackendTextureData(mtlInfo));
148}

◆ MakeVk()

GrBackendTexture GrBackendTextures::MakeVk ( int  width,
int  height,
const GrVkImageInfo vkInfo,
std::string_view  label = {} 
)

Definition at line 274 of file GrVkBackendSurface.cpp.

277 {
279 width,
280 height,
281 label,
282 skgpu::Mipmapped(vkInfo.fLevelCount > 1),
286}
static const VkImageUsageFlags kDefaultTexRTUsageFlags
static GrVkImageInfo apply_default_usage_flags(const GrVkImageInfo &info, VkImageUsageFlags defaultFlags)
static GrTextureType vk_image_info_to_texture_type(const GrVkImageInfo &info)
Mipmapped
Definition GpuTypes.h:53
uint32_t fLevelCount
Definition GrVkTypes.h:33

◆ SetVkImageLayout()

void GrBackendTextures::SetVkImageLayout ( GrBackendTexture tex,
VkImageLayout  layout 
)

Definition at line 313 of file GrVkBackendSurface.cpp.

313 {
314 if (tex && tex->isValid() && tex->backend() == GrBackendApi::kVulkan) {
316 SkASSERT(data);
317 skgpu::MutableTextureStates::SetVkImageLayout(data->mutableState(), layout);
318 }
319}
void SetVkImageLayout(MutableTextureState *state, VkImageLayout layout)