Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | List of all members
GrMockTextureRenderTarget Class Reference

#include <GrMockTexture.h>

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

Public Member Functions

 GrMockTextureRenderTarget (GrMockGpu *gpu, skgpu::Budgeted budgeted, SkISize dimensions, int sampleCnt, GrMipmapStatus mipmapStatus, const GrMockTextureInfo &texInfo, const GrMockRenderTargetInfo &rtInfo, std::string_view label)
 
 GrMockTextureRenderTarget (GrMockGpu *gpu, SkISize dimensions, int sampleCnt, GrMipmapStatus mipmapStatus, const GrMockTextureInfo &texInfo, const GrMockRenderTargetInfo &rtInfo, GrWrapCacheable cacheable, std::string_view label)
 
GrTextureasTexture () override
 
GrRenderTargetasRenderTarget () override
 
const GrTextureasTexture () const override
 
const GrRenderTargetasRenderTarget () const override
 
GrBackendFormat backendFormat () const override
 
- Public Member Functions inherited from GrMockTexture
 GrMockTexture (GrMockGpu *gpu, skgpu::Budgeted budgeted, SkISize dimensions, GrMipmapStatus mipmapStatus, const GrMockTextureInfo &info, std::string_view label)
 
 GrMockTexture (GrMockGpu *gpu, SkISize dimensions, GrMipmapStatus mipmapStatus, const GrMockTextureInfo &info, GrWrapCacheable cacheable, GrIOType ioType, std::string_view label)
 
 ~GrMockTexture () override
 
GrBackendTexture getBackendTexture () const override
 
void textureParamsModified () override
 
- Public Member Functions inherited from GrTexture
GrTextureasTexture () override
 
const GrTextureasTexture () const override
 
GrTextureType textureType () const
 
bool hasRestrictedSampling () const
 
void markMipmapsDirty ()
 
void markMipmapsClean ()
 
skgpu::Mipmapped mipmapped () const
 
bool mipmapsAreDirty () const
 
GrMipmapStatus mipmapStatus () const
 
int maxMipmapLevel () const
 
- Public Member Functions inherited from GrSurface
SkISize dimensions () const
 
int width () const
 
int height () const
 
SkRect getBoundsRect () const
 
void setRelease (sk_sp< skgpu::RefCntedCallback > releaseHelper)
 
void setRelease (ReleaseProc proc, ReleaseCtx ctx)
 
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
 
- 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
 
- Public Member Functions inherited from GrMockRenderTarget
 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
 
GrBackendRenderTarget getBackendRenderTarget () const override
 
- Public Member Functions inherited from GrRenderTarget
virtual bool alwaysClearStencil () const
 
GrRenderTargetasRenderTarget () override
 
const GrRenderTargetasRenderTarget () const override
 
int numSamples () const
 
GrAttachmentgetStencilAttachment (bool useMSAASurface) const
 
GrAttachmentgetStencilAttachment () const
 
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
 

Private Member Functions

void onAbandon () override
 
void onRelease () override
 
size_t onGpuMemorySize () const override
 
void onSetLabel () override
 
void computeScratchKey (skgpu::ScratchKey *key) const override
 

Additional Inherited Members

- Public Types inherited from GrSurface
typedef void * ReleaseCtx
 
typedef void(* ReleaseProc) (ReleaseCtx)
 
- Public Types inherited from GrIORef< GrGpuResource >
enum  LastRemovedRef
 
- Public Types inherited from GrMockRenderTarget
enum  Wrapped { kWrapped }
 
- Static Public Member Functions inherited from GrTexture
static bool StealBackendTexture (sk_sp< GrTexture >, GrBackendTexture *, SkImages::BackendTextureReleaseProc *)
 
static void ComputeScratchKey (const GrCaps &caps, const GrBackendFormat &format, SkISize dimensions, GrRenderable, int sampleCnt, skgpu::Mipmapped, GrProtected, skgpu::ScratchKey *key)
 
- 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 ()
 
- Protected Member Functions inherited from GrMockTexture
 GrMockTexture (GrMockGpu *gpu, const SkISize &dims, GrMipmapStatus mipmapStatus, const GrMockTextureInfo &info, std::string_view label)
 
bool onStealBackendTexture (GrBackendTexture *, SkImages::BackendTextureReleaseProc *) override
 
- Protected Member Functions inherited from GrTexture
 GrTexture (GrGpu *, const SkISize &, GrProtected, GrTextureType, GrMipmapStatus, std::string_view label)
 
void computeScratchKey (skgpu::ScratchKey *) const 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 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
 
- Protected Member Functions inherited from GrMockRenderTarget
 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
 

Detailed Description

Definition at line 173 of file GrMockTexture.h.

Constructor & Destructor Documentation

◆ GrMockTextureRenderTarget() [1/2]

GrMockTextureRenderTarget::GrMockTextureRenderTarget ( GrMockGpu gpu,
skgpu::Budgeted  budgeted,
SkISize  dimensions,
int  sampleCnt,
GrMipmapStatus  mipmapStatus,
const GrMockTextureInfo texInfo,
const GrMockRenderTargetInfo rtInfo,
std::string_view  label 
)
inline

Definition at line 176 of file GrMockTexture.h.

184 : GrSurface(gpu, dimensions, texInfo.getProtected(), label)
185 , GrMockTexture(gpu, dimensions, mipmapStatus, texInfo, label)
186 , GrMockRenderTarget(gpu, dimensions, sampleCnt, rtInfo, label) {
187 SkASSERT(texInfo.getProtected() == rtInfo.getProtected());
188 this->registerWithCache(budgeted);
189 }
#define SkASSERT(cond)
Definition SkAssert.h:116
void registerWithCache(skgpu::Budgeted)
SkISize dimensions() const
Definition GrSurface.h:27
GrMipmapStatus mipmapStatus() const
Definition GrTexture.h:66
skgpu::Protected getProtected() const
Definition GrMockTypes.h:92
skgpu::Protected getProtected() const
Definition GrMockTypes.h:58

◆ GrMockTextureRenderTarget() [2/2]

GrMockTextureRenderTarget::GrMockTextureRenderTarget ( GrMockGpu gpu,
SkISize  dimensions,
int  sampleCnt,
GrMipmapStatus  mipmapStatus,
const GrMockTextureInfo texInfo,
const GrMockRenderTargetInfo rtInfo,
GrWrapCacheable  cacheable,
std::string_view  label 
)
inline

Definition at line 192 of file GrMockTexture.h.

200 : GrSurface(gpu, dimensions, texInfo.getProtected(), label)
201 , GrMockTexture(gpu, dimensions, mipmapStatus, texInfo, label)
202 , GrMockRenderTarget(gpu, dimensions, sampleCnt, rtInfo, label) {
203 SkASSERT(texInfo.getProtected() == rtInfo.getProtected());
204 this->registerWithCacheWrapped(cacheable);
205 }
void registerWithCacheWrapped(GrWrapCacheable)

Member Function Documentation

◆ asRenderTarget() [1/2]

const GrRenderTarget * GrMockTextureRenderTarget::asRenderTarget ( ) const
inlineoverridevirtual

Reimplemented from GrSurface.

Definition at line 210 of file GrMockTexture.h.

210{ return this; }

◆ asRenderTarget() [2/2]

GrRenderTarget * GrMockTextureRenderTarget::asRenderTarget ( )
inlineoverridevirtual
Returns
the render target underlying this surface, may be null.

Reimplemented from GrSurface.

Definition at line 208 of file GrMockTexture.h.

208{ return this; }

◆ asTexture() [1/2]

const GrTexture * GrMockTextureRenderTarget::asTexture ( ) const
inlineoverridevirtual

Reimplemented from GrSurface.

Definition at line 209 of file GrMockTexture.h.

209{ return this; }

◆ asTexture() [2/2]

GrTexture * GrMockTextureRenderTarget::asTexture ( )
inlineoverridevirtual
Returns
the texture associated with the surface, may be null.

Reimplemented from GrSurface.

Definition at line 207 of file GrMockTexture.h.

207{ return this; }

◆ backendFormat()

GrBackendFormat GrMockTextureRenderTarget::backendFormat ( ) const
inlineoverridevirtual

Reimplemented from GrMockTexture.

Definition at line 212 of file GrMockTexture.h.

212 {
214 }
GrBackendFormat backendFormat() const override

◆ computeScratchKey()

void GrMockTextureRenderTarget::computeScratchKey ( skgpu::ScratchKey ) const
inlineoverrideprivatevirtual

Called by the registerWithCache if the resource is available to be used as scratch. Resource subclasses should override this if the instances should be recycled as scratch resources and populate the scratchKey with the key. By default resources are not recycled as scratch.

Reimplemented from GrGpuResource.

Definition at line 240 of file GrMockTexture.h.

240 {
242 }
void computeScratchKey(skgpu::ScratchKey *) const override
Definition GrTexture.cpp:91

◆ onAbandon()

void GrMockTextureRenderTarget::onAbandon ( )
inlineoverrideprivatevirtual

Overridden to abandon any internal handles, ptrs, etc to backend API resources. This may be called when the underlying 3D context is no longer valid and so no backend API calls should be made.

Reimplemented from GrMockTexture.

Definition at line 217 of file GrMockTexture.h.

217 {
220 }
void onAbandon() override
void onAbandon() override

◆ onGpuMemorySize()

size_t GrMockTextureRenderTarget::onGpuMemorySize ( ) const
inlineoverrideprivatevirtual

Implements GrGpuResource.

Definition at line 227 of file GrMockTexture.h.

227 {
228 int numColorSamples = this->numSamples();
229 if (numColorSamples > 1) {
230 // Add one to account for the resolve buffer.
231 ++numColorSamples;
232 }
233 return GrSurface::ComputeSize(this->backendFormat(), this->dimensions(),
234 numColorSamples, this->mipmapped());
235 }
GrBackendFormat backendFormat() const override
int numSamples() const
static size_t ComputeSize(const GrBackendFormat &, SkISize dimensions, int colorSamplesPerPixel, skgpu::Mipmapped, bool binSize=false)
Definition GrSurface.cpp:21
skgpu::Mipmapped mipmapped() const
Definition GrTexture.h:62

◆ onRelease()

void GrMockTextureRenderTarget::onRelease ( )
inlineoverrideprivatevirtual

Overridden to free GPU resources in the backend API.

Reimplemented from GrMockTexture.

Definition at line 222 of file GrMockTexture.h.

222 {
225 }
void onRelease() override
void onRelease() override

◆ onSetLabel()

void GrMockTextureRenderTarget::onSetLabel ( )
inlineoverrideprivatevirtual

Reimplemented from GrMockTexture.

Definition at line 237 of file GrMockTexture.h.

237{}

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