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

Functions

SK_API GrBackendRenderTarget MakeGL (int width, int height, int sampleCnt, int stencilBits, const GrGLFramebufferInfo &glInfo)
 
SK_API bool GetGLFramebufferInfo (const GrBackendRenderTarget &, GrGLFramebufferInfo *)
 
SK_API GrBackendRenderTarget MakeMtl (int width, int height, const GrMtlTextureInfo &mtlInfo)
 
SK_API bool GetMtlTextureInfo (const GrBackendRenderTarget &, GrMtlTextureInfo *)
 
SK_API GrBackendRenderTarget MakeVk (int width, int height, const GrVkImageInfo &)
 
SK_API bool GetVkImageInfo (const GrBackendRenderTarget &, GrVkImageInfo *)
 
SK_API void SetVkImageLayout (GrBackendRenderTarget *, VkImageLayout)
 

Function Documentation

◆ GetGLFramebufferInfo()

bool GrBackendRenderTargets::GetGLFramebufferInfo ( const GrBackendRenderTarget rt,
GrGLFramebufferInfo outInfo 
)

Definition at line 284 of file GrGLBackendSurface.cpp.

284 {
285 if (!rt.isValid() || rt.backend() != GrBackendApi::kOpenGL) {
286 return false;
287 }
289 SkASSERT(data);
290 *outInfo = data->info();
291 return true;
292}
static const GrGLBackendFormatData * get_and_cast_data(const GrBackendFormat &format)
#define SkASSERT(cond)
Definition SkAssert.h:116
GrBackendApi backend() const

◆ GetMtlTextureInfo()

bool GrBackendRenderTargets::GetMtlTextureInfo ( const GrBackendRenderTarget rt,
GrMtlTextureInfo *  outInfo 
)

Definition at line 213 of file GrMtlBackendSurface.mm.

213 {
214 if (!rt.isValid() || rt.backend() != GrBackendApi::kMetal) {
215 return false;
216 }
218 SkASSERT(data);
219 *outInfo = data->info();
220 return true;
221}
static const GrMtlBackendFormatData * get_and_cast_data(const GrBackendFormat &format)

◆ GetVkImageInfo()

bool GrBackendRenderTargets::GetVkImageInfo ( const GrBackendRenderTarget rt,
GrVkImageInfo outInfo 
)

Definition at line 428 of file GrVkBackendSurface.cpp.

428 {
429 if (!rt.isValid() || rt.backend() != GrBackendApi::kVulkan) {
430 return false;
431 }
433 SkASSERT(data);
434 *outInfo = GrVkImageInfoWithMutableState(data->info(), data->mutableState());
435 return true;
436}
static const GrVkBackendFormatData * get_and_cast_data(const GrBackendFormat &format)
GrVkImageInfo GrVkImageInfoWithMutableState(const GrVkImageInfo &info, const skgpu::MutableTextureState *mutableState)

◆ MakeGL()

GrBackendRenderTarget GrBackendRenderTargets::MakeGL ( int  width,
int  height,
int  sampleCnt,
int  stencilBits,
const GrGLFramebufferInfo glInfo 
)

Definition at line 273 of file GrGLBackendSurface.cpp.

274 {
276 height,
277 std::max(1, sampleCnt),
278 stencilBits,
280 /*framebufferOnly=*/false,
282}
static GrBackendRenderTarget MakeGrBackendRenderTarget(int width, int height, int sampleCnt, int stencilBits, GrBackendApi backend, bool framebufferOnly, const RenderTargetData &data)
int32_t height
int32_t width

◆ MakeMtl()

GrBackendRenderTarget GrBackendRenderTargets::MakeMtl ( int  width,
int  height,
const GrMtlTextureInfo &  mtlInfo 
)

Definition at line 202 of file GrMtlBackendSurface.mm.

202 {
204 width,
205 height,
206 std::max(1, GrMtlTextureInfoSampleCount(mtlInfo)),
207 /*stencilBits=*/0,
209 /*framebufferOnly=*/false, // TODO: set this from mtlInfo.fTexture->framebufferOnly
211}
int GrMtlTextureInfoSampleCount(const GrMtlTextureInfo &)
Definition GrMtlUtil.mm:294

◆ MakeVk()

GrBackendRenderTarget GrBackendRenderTargets::MakeVk ( int  width,
int  height,
const GrVkImageInfo vkInfo 
)

Definition at line 402 of file GrVkBackendSurface.cpp.

402 {
404 width,
405 height,
406 std::max(1U, vkInfo.fSampleCount),
407 /*stencilBits=*/0,
409 /*framebufferOnly=*/false,
411}
static GrVkImageInfo apply_default_usage_flags(const GrVkImageInfo &info, VkImageUsageFlags defaultFlags)
static const VkImageUsageFlags kDefaultRTUsageFlags
uint32_t fSampleCount
Definition GrVkTypes.h:32

◆ SetVkImageLayout()

void GrBackendRenderTargets::SetVkImageLayout ( GrBackendRenderTarget rt,
VkImageLayout  layout 
)

Definition at line 438 of file GrVkBackendSurface.cpp.

438 {
439 if (rt && rt->isValid() && rt->backend() == GrBackendApi::kVulkan) {
441 skgpu::MutableTextureStates::SetVkImageLayout(data->mutableState(), layout);
442 }
443}
void SetVkImageLayout(MutableTextureState *state, VkImageLayout layout)