Flutter Engine
The Flutter Engine
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)
 
GrBackendTexture MakeGL (int width, int height, skgpu::Mipmapped mipped, const GrGLTextureInfo &glInfo, sk_sp< GrGLTextureParameters > params, std::string_view label)
 
GrBackendTexture MakeVk (int width, int height, const GrVkImageInfo &vkInfo, sk_sp< skgpu::MutableTextureState > mutableState)
 

Function Documentation

◆ GetGLTextureInfo()

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

Definition at line 214 of file GrGLBackendSurface.cpp.

214 {
215 if (!tex.isValid() || tex.backend() != GrBackendApi::kOpenGL) {
216 return false;
217 }
219 SkASSERT(data);
220 *outInfo = data->info().info();
221 return true;
222}
static const GrGLBackendFormatData * get_and_cast_data(const GrBackendFormat &format)
#define SkASSERT(cond)
Definition: SkAssert.h:116
bool isValid() const
GrBackendApi backend() const
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63

◆ 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 307 of file GrVkBackendSurface.cpp.

307 {
308 if (!tex.isValid() || tex.backend() != GrBackendApi::kVulkan) {
309 return false;
310 }
312 SkASSERT(data);
313 *outInfo = GrVkImageInfoWithMutableState(data->info(), data->mutableState());
314 return true;
315}
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 224 of file GrGLBackendSurface.cpp.

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

◆ MakeGL() [1/2]

GrBackendTexture GrBackendTextures::MakeGL ( int  width,
int  height,
skgpu::Mipmapped  mipped,
const GrGLTextureInfo glInfo,
sk_sp< GrGLTextureParameters params,
std::string_view  label 
)

Definition at line 199 of file GrGLBackendSurface.cpp.

204 {
206 height,
207 label,
208 mipped,
212}
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)
const EmbeddedViewParams * params
int32_t height
int32_t width
GrGLenum fTarget
Definition: GrGLTypes.h:181

◆ MakeGL() [2/2]

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

Definition at line 181 of file GrGLBackendSurface.cpp.

185 {
187 width,
188 height,
189 label,
190 mipped,
193 GrGLBackendTextureData(glInfo, sk_make_sp<GrGLTextureParameters>()));
194 // Make no assumptions about client's texture's parameters.
196 return tex;
197}
SK_API void GLTextureParametersModified(GrBackendTexture *)

◆ 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() [1/2]

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

Definition at line 278 of file GrVkBackendSurface.cpp.

281 {
283 width,
284 height,
285 label,
286 skgpu::Mipmapped(vkInfo.fLevelCount > 1),
290}
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

◆ MakeVk() [2/2]

SK_API GrBackendTexture GrBackendTextures::MakeVk ( int  width,
int  height,
const GrVkImageInfo vkInfo,
sk_sp< skgpu::MutableTextureState mutableState 
)

Definition at line 292 of file GrVkBackendSurface.cpp.

295 {
297 width,
298 height,
299 /*label=*/{},
300 skgpu::Mipmapped(vkInfo.fLevelCount > 1),
304 std::move(mutableState)));
305}

◆ SetVkImageLayout()

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

Definition at line 317 of file GrVkBackendSurface.cpp.

317 {
318 if (tex && tex->isValid() && tex->backend() == GrBackendApi::kVulkan) {
320 SkASSERT(data);
322 }
323}
void SetVkImageLayout(MutableTextureState *state, VkImageLayout layout)