Flutter Engine
The Flutter Engine
Public Types | Public Member Functions | Protected Member Functions | List of all members
GrMockRenderTarget Class Reference

#include <GrMockTexture.h>

Inheritance diagram for GrMockRenderTarget:
GrRenderTarget GrSurface GrGpuResource GrIORef< GrGpuResource > SkNoncopyable GrMockTextureRenderTarget

Public Types

enum  Wrapped { kWrapped }
 
- Public Types inherited from GrSurface
typedef void * ReleaseCtx
 
typedef void(* ReleaseProc) (ReleaseCtx)
 
- Public Types inherited from GrIORef< GrGpuResource >
enum  LastRemovedRef
 

Public Member Functions

 GrMockRenderTarget (GrMockGpu *gpu, skgpu::Budgeted budgeted, SkISize dimensions, int sampleCnt, const GrMockRenderTargetInfo &info, std::string_view label)
 
 GrMockRenderTarget (GrMockGpu *gpu, Wrapped, SkISize dimensions, int sampleCnt, const GrMockRenderTargetInfo &info, std::string_view label)
 
bool canAttemptStencilAttachment (bool useMSAASurface) const override
 
bool completeStencilAttachment (GrAttachment *, bool useMSAASurface) override
 
size_t onGpuMemorySize () const override
 
GrBackendRenderTarget getBackendRenderTarget () const override
 
GrBackendFormat backendFormat () const override
 
- Public Member Functions inherited from GrRenderTarget
virtual bool alwaysClearStencil () const
 
GrRenderTargetasRenderTarget () override
 
const GrRenderTargetasRenderTarget () const override
 
int numSamples () const
 
virtual GrBackendRenderTarget getBackendRenderTarget () const =0
 
GrAttachmentgetStencilAttachment (bool useMSAASurface) const
 
GrAttachmentgetStencilAttachment () const
 
virtual bool canAttemptStencilAttachment (bool useMSAASurface) const =0
 
void attachStencilAttachment (sk_sp< GrAttachment > stencil, bool useMSAASurface)
 
int numStencilBits (bool useMSAASurface) const
 
int getSamplePatternKey ()
 
const skia_private::TArray< SkPoint > & getSampleLocations ()
 
void setRequiresManualMSAAResolve ()
 
bool requiresManualMSAAResolve () const
 
- Public Member Functions inherited from GrSurface
SkISize dimensions () const
 
int width () const
 
int height () const
 
SkRect getBoundsRect () const
 
virtual GrBackendFormat backendFormat () const =0
 
void setRelease (sk_sp< skgpu::RefCntedCallback > releaseHelper)
 
void setRelease (ReleaseProc proc, ReleaseCtx ctx)
 
virtual GrTextureasTexture ()
 
virtual const GrTextureasTexture () const
 
virtual GrRenderTargetasRenderTarget ()
 
virtual const GrRenderTargetasRenderTarget () const
 
GrInternalSurfaceFlags flags () const
 
bool readOnly () const
 
bool framebufferOnly () const
 
bool isProtected () const
 
void setFramebufferOnly ()
 
- Public Member Functions inherited from GrGpuResource
bool wasDestroyed () const
 
const GrDirectContextgetContext () const
 
GrDirectContextgetContext ()
 
size_t gpuMemorySize () const
 
UniqueID uniqueID () const
 
const skgpu::UniqueKeygetUniqueKey () const
 
std::string getLabel () const
 
void setLabel (std::string_view label)
 
CacheAccess cacheAccess ()
 
const CacheAccess cacheAccess () const
 
ProxyAccess proxyAccess ()
 
ResourcePriv resourcePriv ()
 
const ResourcePriv resourcePriv () const
 
virtual void dumpMemoryStatistics (SkTraceMemoryDump *traceMemoryDump) const
 
virtual const char * getResourceType () const =0
 
- Public Member Functions inherited from GrIORef< GrGpuResource >
bool unique () const
 
void ref () const
 
void unref () const
 
void refCommandBuffer () const
 
void unrefCommandBuffer () const
 
- Public Member Functions inherited from SkNoncopyable
 SkNoncopyable ()=default
 
 SkNoncopyable (SkNoncopyable &&)=default
 
SkNoncopyableoperator= (SkNoncopyable &&)=default
 

Protected Member Functions

 GrMockRenderTarget (GrMockGpu *gpu, SkISize dimensions, int sampleCnt, const GrMockRenderTargetInfo &info, std::string_view label)
 
- Protected Member Functions inherited from GrRenderTarget
 GrRenderTarget (GrGpu *, const SkISize &, int sampleCount, GrProtected, std::string_view label, sk_sp< GrAttachment > stenicl=nullptr)
 
 ~GrRenderTarget () override
 
void onAbandon () override
 
void onRelease () override
 
- Protected Member Functions inherited from GrSurface
void setGLRTFBOIDIs0 ()
 
bool glRTFBOIDis0 () const
 
void setRequiresManualMSAAResolve ()
 
bool requiresManualMSAAResolve () const
 
void setReadOnly ()
 
void setVkRTSupportsInputAttachment ()
 
 GrSurface (GrGpu *gpu, const SkISize &dimensions, skgpu::Protected isProtected, std::string_view label)
 
 ~GrSurface () override
 
void onRelease () override
 
void onAbandon () override
 
- Protected Member Functions inherited from GrGpuResource
void registerWithCache (skgpu::Budgeted)
 
void registerWithCacheWrapped (GrWrapCacheable)
 
 GrGpuResource (GrGpu *, std::string_view label)
 
virtual ~GrGpuResource ()
 
GrGpugetGpu () const
 
virtual void onRelease ()
 
virtual void onAbandon ()
 
virtual void setMemoryBacking (SkTraceMemoryDump *, const SkString &) const
 
SkString getResourceName () const
 
void dumpMemoryStatisticsPriv (SkTraceMemoryDump *traceMemoryDump, const SkString &resourceName, const char *type, size_t size) const
 
- Protected Member Functions inherited from GrIORef< GrGpuResource >
 GrIORef ()
 
bool internalHasRef () const
 
bool internalHasNoCommandBufferUsages () const
 
void addInitialRef () const
 

Additional Inherited Members

- Static Public Member Functions inherited from GrSurface
static size_t ComputeSize (const GrBackendFormat &, SkISize dimensions, int colorSamplesPerPixel, skgpu::Mipmapped, bool binSize=false)
 
- Static Public Member Functions inherited from GrGpuResource
static uint32_t CreateUniqueID ()
 

Detailed Description

Definition at line 98 of file GrMockTexture.h.

Member Enumeration Documentation

◆ Wrapped

Enumerator
kWrapped 

Definition at line 112 of file GrMockTexture.h.

Constructor & Destructor Documentation

◆ GrMockRenderTarget() [1/3]

GrMockRenderTarget::GrMockRenderTarget ( GrMockGpu gpu,
skgpu::Budgeted  budgeted,
SkISize  dimensions,
int  sampleCnt,
const GrMockRenderTargetInfo info,
std::string_view  label 
)
inline

Definition at line 100 of file GrMockTexture.h.

106 : GrSurface(gpu, dimensions, info.getProtected(), label)
107 , GrRenderTarget(gpu, dimensions, sampleCnt, info.getProtected(), label)
108 , fInfo(info) {
109 this->registerWithCache(budgeted);
110 }
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
void registerWithCache(skgpu::Budgeted)
GrRenderTarget(GrGpu *, const SkISize &, int sampleCount, GrProtected, std::string_view label, sk_sp< GrAttachment > stenicl=nullptr)
SkISize dimensions() const
Definition: GrSurface.h:27
GrSurface(GrGpu *gpu, const SkISize &dimensions, skgpu::Protected isProtected, std::string_view label)
Definition: GrSurface.h:140

◆ GrMockRenderTarget() [2/3]

GrMockRenderTarget::GrMockRenderTarget ( GrMockGpu gpu,
Wrapped  ,
SkISize  dimensions,
int  sampleCnt,
const GrMockRenderTargetInfo info,
std::string_view  label 
)
inline

Definition at line 113 of file GrMockTexture.h.

116 : GrSurface(gpu, dimensions, info.getProtected(), label)
117 , GrRenderTarget(gpu, dimensions, sampleCnt, info.getProtected(), label)
118 , fInfo(info) {
120 }
void registerWithCacheWrapped(GrWrapCacheable)

◆ GrMockRenderTarget() [3/3]

GrMockRenderTarget::GrMockRenderTarget ( GrMockGpu gpu,
SkISize  dimensions,
int  sampleCnt,
const GrMockRenderTargetInfo info,
std::string_view  label 
)
inlineprotected

Definition at line 156 of file GrMockTexture.h.

161 : GrSurface(gpu, dimensions, info.getProtected(), label)
162 , GrRenderTarget(gpu, dimensions, sampleCnt, info.getProtected(), label)
163 , fInfo(info) {}

Member Function Documentation

◆ backendFormat()

GrBackendFormat GrMockRenderTarget::backendFormat ( ) const
inlineoverridevirtual

Implements GrSurface.

Reimplemented in GrMockTextureRenderTarget.

Definition at line 150 of file GrMockTexture.h.

150 {
151 return fInfo.getBackendFormat();
152 }
GrBackendFormat getBackendFormat() const
Definition: GrMockTypes.cpp:15

◆ canAttemptStencilAttachment()

bool GrMockRenderTarget::canAttemptStencilAttachment ( bool  useMSAASurface) const
inlineoverridevirtual

Implements GrRenderTarget.

Definition at line 122 of file GrMockTexture.h.

122 {
123 SkASSERT(useMSAASurface == (this->numSamples() > 1));
124 return true;
125 }
#define SkASSERT(cond)
Definition: SkAssert.h:116
int numSamples() const

◆ completeStencilAttachment()

bool GrMockRenderTarget::completeStencilAttachment ( GrAttachment ,
bool  useMSAASurface 
)
inlineoverridevirtual

Implements GrRenderTarget.

Definition at line 127 of file GrMockTexture.h.

127 {
128 SkASSERT(useMSAASurface == (this->numSamples() > 1));
129 return true;
130 }

◆ getBackendRenderTarget()

GrBackendRenderTarget GrMockRenderTarget::getBackendRenderTarget ( ) const
inlineoverridevirtual

Implements GrRenderTarget.

Definition at line 142 of file GrMockTexture.h.

142 {
143 int numStencilBits = 0;
144 if (GrAttachment* stencil = this->getStencilAttachment()) {
145 numStencilBits = GrBackendFormatStencilBits(stencil->backendFormat());
146 }
147 return {this->width(), this->height(), this->numSamples(), numStencilBits, fInfo};
148 }
int GrBackendFormatStencilBits(const GrBackendFormat &format)
GrAttachment * getStencilAttachment() const
int numStencilBits(bool useMSAASurface) const
int height() const
Definition: GrSurface.h:37
int width() const
Definition: GrSurface.h:32

◆ onGpuMemorySize()

size_t GrMockRenderTarget::onGpuMemorySize ( ) const
inlineoverridevirtual

Implements GrGpuResource.

Definition at line 132 of file GrMockTexture.h.

132 {
133 int numColorSamples = this->numSamples();
134 if (numColorSamples > 1) {
135 // Add one to account for the resolve buffer.
136 ++numColorSamples;
137 }
139 this->backendFormat(), this->dimensions(), numColorSamples, skgpu::Mipmapped::kNo);
140 }
GrBackendFormat backendFormat() const override
static size_t ComputeSize(const GrBackendFormat &, SkISize dimensions, int colorSamplesPerPixel, skgpu::Mipmapped, bool binSize=false)
Definition: GrSurface.cpp:21

The documentation for this class was generated from the following file: