Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
GrMtlTextureRenderTarget.mm File Reference
#include "src/gpu/ganesh/mtl/GrMtlTextureRenderTarget.h"
#include "include/gpu/ganesh/mtl/GrMtlBackendSurface.h"
#include "src/gpu/ganesh/GrDirectContextPriv.h"
#include "src/gpu/ganesh/GrResourceProvider.h"
#include "src/gpu/ganesh/mtl/GrMtlGpu.h"
#include "src/gpu/ganesh/mtl/GrMtlUtil.h"

Go to the source code of this file.

Functions

bool create_rt_attachments (GrMtlGpu *gpu, SkISize dimensions, MTLPixelFormat format, int sampleCnt, sk_sp< GrMtlAttachment > texture, sk_sp< GrMtlAttachment > *colorAttachment, sk_sp< GrMtlAttachment > *resolveAttachment)
 

Function Documentation

◆ create_rt_attachments()

bool create_rt_attachments ( GrMtlGpu gpu,
SkISize  dimensions,
MTLPixelFormat  format,
int  sampleCnt,
sk_sp< GrMtlAttachment texture,
sk_sp< GrMtlAttachment > *  colorAttachment,
sk_sp< GrMtlAttachment > *  resolveAttachment 
)

Definition at line 51 of file GrMtlTextureRenderTarget.mm.

53 {
54 if (sampleCnt > 1) {
55 auto rp = gpu->getContext()->priv().resourceProvider();
56 sk_sp<GrAttachment> msaaAttachment =
57 rp->makeMSAAAttachment(dimensions,
59 sampleCnt,
60 GrProtected::kNo,
62 if (!msaaAttachment) {
63 return false;
64 }
65 *colorAttachment =
66 sk_sp<GrMtlAttachment>(static_cast<GrMtlAttachment*>(msaaAttachment.release()));
67 *resolveAttachment = std::move(texture);
68 } else {
69 *colorAttachment = std::move(texture);
70 }
71 return true;
72}
GrResourceProvider * resourceProvider()
GrDirectContextPriv priv()
GrDirectContext * getContext()
Definition GrGpu.h:67
T * release()
Definition SkRefCnt.h:324
uint32_t uint32_t * format
FlTexture * texture
SK_API GrBackendFormat MakeMtl(GrMTLPixelFormat format)