Flutter Engine
The Flutter Engine
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)
 
GrBackendRenderTarget MakeVk (int width, int height, const GrVkImageInfo &vkInfo, sk_sp< skgpu::MutableTextureState > mutableState)
 

Function Documentation

◆ GetGLFramebufferInfo()

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

Definition at line 285 of file GrGLBackendSurface.cpp.

285 {
286 if (!rt.isValid() || rt.backend() != GrBackendApi::kOpenGL) {
287 return false;
288 }
290 SkASSERT(data);
291 *outInfo = data->info();
292 return true;
293}
static const GrGLBackendFormatData * get_and_cast_data(const GrBackendFormat &format)
#define SkASSERT(cond)
Definition: SkAssert.h:116
GrBackendApi backend() const
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63

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

432 {
433 if (!rt.isValid() || rt.backend() != GrBackendApi::kVulkan) {
434 return false;
435 }
437 SkASSERT(data);
438 *outInfo = GrVkImageInfoWithMutableState(data->info(), data->mutableState());
439 return true;
440}
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 274 of file GrGLBackendSurface.cpp.

275 {
277 height,
278 std::max(1, sampleCnt),
279 stencilBits,
281 /*framebufferOnly=*/false,
283}
static GrBackendRenderTarget MakeGrBackendRenderTarget(int width, int height, int sampleCnt, int stencilBits, GrBackendApi backend, bool framebufferOnly, const RenderTargetData &data)
static float max(float r, float g, float b)
Definition: hsl.cpp:49
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,
207 /*stencilBits=*/0,
209 /*framebufferOnly=*/false, // TODO: set this from mtlInfo.fTexture->framebufferOnly
211}
int GrMtlTextureInfoSampleCount(const GrMtlTextureInfo &)
Definition: GrMtlUtil.mm:294

◆ MakeVk() [1/2]

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

Definition at line 406 of file GrVkBackendSurface.cpp.

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

◆ MakeVk() [2/2]

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

Definition at line 417 of file GrVkBackendSurface.cpp.

420 {
422 width,
423 height,
424 std::max(1U, vkInfo.fSampleCount),
425 /*stencilBits=*/0,
427 /*framebufferOnly=*/false,
429 std::move(mutableState)));
430}

◆ SetVkImageLayout()

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

Definition at line 442 of file GrVkBackendSurface.cpp.

442 {
443 if (rt && rt->isValid() && rt->backend() == GrBackendApi::kVulkan) {
446 }
447}
void SetVkImageLayout(MutableTextureState *state, VkImageLayout layout)