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

#include <GrMockTexture.h>

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

Public Member Functions

 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
 
GrBackendFormat backendFormat () const override
 
void textureParamsModified () override
 
- Public Member Functions inherited from GrTexture
GrTextureasTexture () override
 
const GrTextureasTexture () const override
 
virtual GrBackendTexture getBackendTexture () const =0
 
virtual void textureParamsModified ()=0
 
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
 
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

 GrMockTexture (GrMockGpu *gpu, const SkISize &dims, GrMipmapStatus mipmapStatus, const GrMockTextureInfo &info, std::string_view label)
 
void onRelease () override
 
void onAbandon () override
 
bool onStealBackendTexture (GrBackendTexture *, SkImages::BackendTextureReleaseProc *) override
 
- Protected Member Functions inherited from GrTexture
 GrTexture (GrGpu *, const SkISize &, GrProtected, GrTextureType, GrMipmapStatus, std::string_view label)
 
virtual bool onStealBackendTexture (GrBackendTexture *, SkImages::BackendTextureReleaseProc *)=0
 
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 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

- Public Types inherited from GrSurface
typedef void * ReleaseCtx
 
typedef void(* ReleaseProc) (ReleaseCtx)
 
- Public Types inherited from GrIORef< GrGpuResource >
enum  LastRemovedRef
 
- 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 ()
 

Detailed Description

Definition at line 29 of file GrMockTexture.h.

Constructor & Destructor Documentation

◆ GrMockTexture() [1/3]

GrMockTexture::GrMockTexture ( GrMockGpu gpu,
skgpu::Budgeted  budgeted,
SkISize  dimensions,
GrMipmapStatus  mipmapStatus,
const GrMockTextureInfo info,
std::string_view  label 
)
inline

Definition at line 31 of file GrMockTexture.h.

37 : GrMockTexture(gpu, dimensions, mipmapStatus, info, label) {
38 this->registerWithCache(budgeted);
39 }
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
void registerWithCache(skgpu::Budgeted)
GrMockTexture(GrMockGpu *gpu, skgpu::Budgeted budgeted, SkISize dimensions, GrMipmapStatus mipmapStatus, const GrMockTextureInfo &info, std::string_view label)
Definition: GrMockTexture.h:31
SkISize dimensions() const
Definition: GrSurface.h:27
GrMipmapStatus mipmapStatus() const
Definition: GrTexture.h:66

◆ GrMockTexture() [2/3]

GrMockTexture::GrMockTexture ( GrMockGpu gpu,
SkISize  dimensions,
GrMipmapStatus  mipmapStatus,
const GrMockTextureInfo info,
GrWrapCacheable  cacheable,
GrIOType  ioType,
std::string_view  label 
)
inline

Definition at line 41 of file GrMockTexture.h.

48 : GrMockTexture(gpu, dimensions, mipmapStatus, info, label) {
49 if (ioType == kRead_GrIOType) {
50 this->setReadOnly();
51 }
52 this->registerWithCacheWrapped(cacheable);
53 }
@ kRead_GrIOType
Definition: GrTypesPriv.h:403
void registerWithCacheWrapped(GrWrapCacheable)
void setReadOnly()
Definition: GrSurface.h:130

◆ ~GrMockTexture()

GrMockTexture::~GrMockTexture ( )
inlineoverride

Definition at line 55 of file GrMockTexture.h.

55{}

◆ GrMockTexture() [3/3]

GrMockTexture::GrMockTexture ( GrMockGpu gpu,
const SkISize dims,
GrMipmapStatus  mipmapStatus,
const GrMockTextureInfo info,
std::string_view  label 
)
inlineprotected

Definition at line 69 of file GrMockTexture.h.

74 : GrSurface(gpu, dims, info.getProtected(), label)
75 , GrTexture(gpu, dims, info.getProtected(), GrTextureType::k2D, mipmapStatus, label)
76 , fInfo(info) {}
GrSurface(GrGpu *gpu, const SkISize &dimensions, skgpu::Protected isProtected, std::string_view label)
Definition: GrSurface.h:140
GrTexture(GrGpu *, const SkISize &, GrProtected, GrTextureType, GrMipmapStatus, std::string_view label)
Definition: GrTexture.cpp:42

Member Function Documentation

◆ backendFormat()

GrBackendFormat GrMockTexture::backendFormat ( ) const
inlineoverridevirtual

Implements GrSurface.

Reimplemented in GrMockTextureRenderTarget.

Definition at line 61 of file GrMockTexture.h.

61 {
62 return fInfo.getBackendFormat();
63 }
GrBackendFormat getBackendFormat() const
Definition: GrMockTypes.cpp:19

◆ getBackendTexture()

GrBackendTexture GrMockTexture::getBackendTexture ( ) const
inlineoverridevirtual

Implements GrTexture.

Definition at line 57 of file GrMockTexture.h.

57 {
58 return GrBackendTexture(this->width(), this->height(), this->mipmapped(), fInfo);
59 }
int height() const
Definition: GrSurface.h:37
int width() const
Definition: GrSurface.h:32
skgpu::Mipmapped mipmapped() const
Definition: GrTexture.h:62

◆ onAbandon()

void GrMockTexture::onAbandon ( )
inlineoverrideprotectedvirtual

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 GrSurface.

Definition at line 82 of file GrMockTexture.h.

82 {
84 }
void onAbandon() override
Definition: GrSurface.cpp:86

◆ onRelease()

void GrMockTexture::onRelease ( )
inlineoverrideprotectedvirtual

Overridden to free GPU resources in the backend API.

Reimplemented from GrSurface.

Definition at line 78 of file GrMockTexture.h.

78 {
80 }
void onRelease() override
Definition: GrSurface.cpp:81

◆ onStealBackendTexture()

bool GrMockTexture::onStealBackendTexture ( GrBackendTexture ,
SkImages::BackendTextureReleaseProc  
)
inlineoverrideprotectedvirtual

Implements GrTexture.

Definition at line 86 of file GrMockTexture.h.

86 {
87 return false;
88 }

◆ textureParamsModified()

void GrMockTexture::textureParamsModified ( )
inlineoverridevirtual

This function indicates that the texture parameters (wrap mode, filtering, ...) have been changed externally to Skia.

Implements GrTexture.

Definition at line 65 of file GrMockTexture.h.

65{}

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