Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
GrMockGpu Class Reference

#include <GrMockGpu.h>

Inheritance diagram for GrMockGpu:
GrGpu

Public Member Functions

 ~GrMockGpu () override
 
GrThreadSafePipelineBuilderpipelineBuilder () override
 
sk_sp< GrThreadSafePipelineBuilderrefPipelineBuilder () override
 
std::unique_ptr< GrSemaphoremakeSemaphore (bool isOwned) override
 
std::unique_ptr< GrSemaphorewrapBackendSemaphore (const GrBackendSemaphore &, GrSemaphoreWrapType, GrWrapOwnership) override
 
void insertSemaphore (GrSemaphore *semaphore) override
 
void waitSemaphore (GrSemaphore *semaphore) override
 
std::unique_ptr< GrSemaphoreprepareTextureForCrossContextUsage (GrTexture *) override
 
void submit (GrOpsRenderPass *renderPass) override
 
void checkFinishProcs () override
 
void finishOutstandingGpuWork () override
 
- Public Member Functions inherited from GrGpu
 GrGpu (GrDirectContext *direct)
 
virtual ~GrGpu ()
 
GrDirectContextgetContext ()
 
const GrDirectContextgetContext () const
 
const GrCapscaps () const
 
sk_sp< const GrCapsrefCaps () const
 
virtual GrStagingBufferManagerstagingBufferManager ()
 
virtual GrRingBufferuniformsRingBuffer ()
 
virtual void disconnect (DisconnectType)
 
virtual GrThreadSafePipelineBuilderpipelineBuilder ()=0
 
virtual sk_sp< GrThreadSafePipelineBuilderrefPipelineBuilder ()=0
 
virtual bool isDeviceLost () const
 
void markContextDirty (uint32_t state=kAll_GrBackendState)
 
sk_sp< GrTexturecreateTexture (SkISize dimensions, const GrBackendFormat &format, GrTextureType textureType, GrRenderable renderable, int renderTargetSampleCnt, skgpu::Budgeted budgeted, GrProtected isProtected, GrColorType textureColorType, GrColorType srcColorType, const GrMipLevel texels[], int texelLevelCount, std::string_view label)
 
sk_sp< GrTexturecreateTexture (SkISize dimensions, const GrBackendFormat &format, GrTextureType textureType, GrRenderable renderable, int renderTargetSampleCnt, skgpu::Mipmapped mipmapped, skgpu::Budgeted budgeted, GrProtected isProtected, std::string_view label)
 
sk_sp< GrTexturecreateCompressedTexture (SkISize dimensions, const GrBackendFormat &format, skgpu::Budgeted budgeted, skgpu::Mipmapped mipmapped, GrProtected isProtected, const void *data, size_t dataSize)
 
sk_sp< GrTexturewrapBackendTexture (const GrBackendTexture &, GrWrapOwnership, GrWrapCacheable, GrIOType)
 
sk_sp< GrTexturewrapCompressedBackendTexture (const GrBackendTexture &, GrWrapOwnership, GrWrapCacheable)
 
sk_sp< GrTexturewrapRenderableBackendTexture (const GrBackendTexture &, int sampleCnt, GrWrapOwnership, GrWrapCacheable)
 
sk_sp< GrRenderTargetwrapBackendRenderTarget (const GrBackendRenderTarget &)
 
sk_sp< GrRenderTargetwrapVulkanSecondaryCBAsRenderTarget (const SkImageInfo &, const GrVkDrawableInfo &)
 
sk_sp< GrGpuBuffercreateBuffer (size_t size, GrGpuBufferType intendedType, GrAccessPattern accessPattern)
 
void resolveRenderTarget (GrRenderTarget *, const SkIRect &resolveRect)
 
bool regenerateMipMapLevels (GrTexture *)
 
void resetTextureBindings ()
 
bool readPixels (GrSurface *surface, SkIRect rect, GrColorType surfaceColorType, GrColorType dstColorType, void *buffer, size_t rowBytes)
 
bool writePixels (GrSurface *surface, SkIRect rect, GrColorType surfaceColorType, GrColorType srcColorType, const GrMipLevel texels[], int mipLevelCount, bool prepForTexSampling=false)
 
bool writePixels (GrSurface *surface, SkIRect rect, GrColorType surfaceColorType, GrColorType srcColorType, const void *buffer, size_t rowBytes, bool prepForTexSampling=false)
 
bool transferFromBufferToBuffer (sk_sp< GrGpuBuffer > src, size_t srcOffset, sk_sp< GrGpuBuffer > dst, size_t dstOffset, size_t size)
 
bool transferPixelsTo (GrTexture *texture, SkIRect rect, GrColorType textureColorType, GrColorType bufferColorType, sk_sp< GrGpuBuffer > transferBuffer, size_t offset, size_t rowBytes)
 
bool transferPixelsFrom (GrSurface *surface, SkIRect rect, GrColorType surfaceColorType, GrColorType bufferColorType, sk_sp< GrGpuBuffer > transferBuffer, size_t offset)
 
bool copySurface (GrSurface *dst, const SkIRect &dstRect, GrSurface *src, const SkIRect &srcRect, GrSamplerState::Filter filter)
 
GrOpsRenderPassgetOpsRenderPass (GrRenderTarget *renderTarget, bool useMSAASurface, GrAttachment *stencil, GrSurfaceOrigin, const SkIRect &bounds, const GrOpsRenderPass::LoadAndStoreInfo &, const GrOpsRenderPass::StencilLoadAndStoreInfo &, const skia_private::TArray< GrSurfaceProxy *, true > &sampledProxies, GrXferBarrierFlags renderPassXferBarriers)
 
void executeFlushInfo (SkSpan< GrSurfaceProxy * >, SkSurfaces::BackendSurfaceAccess access, const GrFlushInfo &, const skgpu::MutableTextureState *newState)
 
virtual void willExecute ()
 
bool submitToGpu (GrSyncCpu sync)
 
virtual void submit (GrOpsRenderPass *)=0
 
virtual std::unique_ptr< GrSemaphoremakeSemaphore (bool isOwned=true)=0
 
virtual std::unique_ptr< GrSemaphorewrapBackendSemaphore (const GrBackendSemaphore &, GrSemaphoreWrapType, GrWrapOwnership)=0
 
virtual void insertSemaphore (GrSemaphore *semaphore)=0
 
virtual void waitSemaphore (GrSemaphore *semaphore)=0
 
virtual void addFinishedProc (GrGpuFinishedProc finishedProc, GrGpuFinishedContext finishedContext)=0
 
virtual void checkFinishProcs ()=0
 
virtual void finishOutstandingGpuWork ()=0
 
virtual void takeOwnershipOfBuffer (sk_sp< GrGpuBuffer >)
 
bool checkAndResetOOMed ()
 
virtual std::unique_ptr< GrSemaphoreprepareTextureForCrossContextUsage (GrTexture *)=0
 
virtual void releaseUnlockedBackendObjects ()
 
Statsstats ()
 
void dumpJSON (SkJSONWriter *) const
 
GrBackendTexture createBackendTexture (SkISize dimensions, const GrBackendFormat &, GrRenderable, skgpu::Mipmapped, GrProtected, std::string_view label)
 
bool clearBackendTexture (const GrBackendTexture &, sk_sp< skgpu::RefCntedCallback > finishedCallback, std::array< float, 4 > color)
 
GrBackendTexture createCompressedBackendTexture (SkISize dimensions, const GrBackendFormat &, skgpu::Mipmapped, GrProtected)
 
bool updateCompressedBackendTexture (const GrBackendTexture &, sk_sp< skgpu::RefCntedCallback > finishedCallback, const void *data, size_t length)
 
virtual bool setBackendTextureState (const GrBackendTexture &, const skgpu::MutableTextureState &, skgpu::MutableTextureState *previousState, sk_sp< skgpu::RefCntedCallback > finishedCallback)
 
virtual bool setBackendRenderTargetState (const GrBackendRenderTarget &, const skgpu::MutableTextureState &, skgpu::MutableTextureState *previousState, sk_sp< skgpu::RefCntedCallback > finishedCallback)
 
virtual void deleteBackendTexture (const GrBackendTexture &)=0
 
virtual bool compile (const GrProgramDesc &, const GrProgramInfo &)=0
 
virtual bool precompileShader (const SkData &key, const SkData &data)
 
virtual sk_sp< GrAttachmentmakeStencilAttachment (const GrBackendFormat &colorFormat, SkISize dimensions, int numStencilSamples)=0
 
virtual GrBackendFormat getPreferredStencilFormat (const GrBackendFormat &)=0
 
virtual sk_sp< GrAttachmentmakeMSAAAttachment (SkISize dimensions, const GrBackendFormat &format, int numSamples, GrProtected isProtected, GrMemoryless isMemoryless)=0
 
void handleDirtyContext ()
 
virtual void storeVkPipelineCacheData ()
 
virtual void xferBarrier (GrRenderTarget *, GrXferBarrierType)=0
 

Static Public Member Functions

static std::unique_ptr< GrGpuMake (const GrMockOptions *, const GrContextOptions &, GrDirectContext *)
 

Additional Inherited Members

- Public Types inherited from GrGpu
enum class  DisconnectType { kAbandon , kCleanup }
 
- Protected Member Functions inherited from GrGpu
void didWriteToSurface (GrSurface *surface, GrSurfaceOrigin origin, const SkIRect *bounds, uint32_t mipLevels=1) const
 
void setOOMed ()
 
void initCaps (sk_sp< const GrCaps > caps)
 
- Static Protected Member Functions inherited from GrGpu
static bool CompressedDataIsCorrect (SkISize dimensions, SkTextureCompressionType, skgpu::Mipmapped, const void *data, size_t length)
 
- Protected Attributes inherited from GrGpu
Stats fStats
 

Detailed Description

Definition at line 53 of file GrMockGpu.h.

Constructor & Destructor Documentation

◆ ~GrMockGpu()

GrMockGpu::~GrMockGpu ( )
override

Definition at line 93 of file GrMockGpu.cpp.

93{}

Member Function Documentation

◆ checkFinishProcs()

void GrMockGpu::checkFinishProcs ( )
inlineoverridevirtual

Implements GrGpu.

Definition at line 80 of file GrMockGpu.h.

80{}

◆ finishOutstandingGpuWork()

void GrMockGpu::finishOutstandingGpuWork ( )
inlineoverridevirtual

Implements GrGpu.

Definition at line 81 of file GrMockGpu.h.

81{}

◆ insertSemaphore()

void GrMockGpu::insertSemaphore ( GrSemaphore semaphore)
inlineoverridevirtual

Implements GrGpu.

Definition at line 72 of file GrMockGpu.h.

72{}

◆ Make()

std::unique_ptr< GrGpu > GrMockGpu::Make ( const GrMockOptions mockOptions,
const GrContextOptions contextOptions,
GrDirectContext direct 
)
static

Definition at line 57 of file GrMockGpu.cpp.

59 {
60 static const GrMockOptions kDefaultOptions = GrMockOptions();
61 if (!mockOptions) {
62 mockOptions = &kDefaultOptions;
63 }
64 return std::unique_ptr<GrGpu>(new GrMockGpu(direct, *mockOptions, contextOptions));
65}

◆ makeSemaphore()

std::unique_ptr< GrSemaphore > GrMockGpu::makeSemaphore ( bool  isOwned)
inlineoverridevirtual

Implements GrGpu.

Definition at line 64 of file GrMockGpu.h.

64 {
65 return nullptr;
66 }

◆ pipelineBuilder()

GrThreadSafePipelineBuilder * GrMockGpu::pipelineBuilder ( )
overridevirtual

Implements GrGpu.

Definition at line 95 of file GrMockGpu.cpp.

95 {
96 return nullptr;
97}

◆ prepareTextureForCrossContextUsage()

std::unique_ptr< GrSemaphore > GrMockGpu::prepareTextureForCrossContextUsage ( GrTexture )
inlineoverridevirtual

Put this texture in a safe and known state for use across multiple contexts. Depending on the backend, this may return a GrSemaphore. If so, other contexts should wait on that semaphore before using this texture.

Implements GrGpu.

Definition at line 74 of file GrMockGpu.h.

74 {
75 return nullptr;
76 }

◆ refPipelineBuilder()

sk_sp< GrThreadSafePipelineBuilder > GrMockGpu::refPipelineBuilder ( )
overridevirtual

Implements GrGpu.

Definition at line 99 of file GrMockGpu.cpp.

99 {
100 return nullptr;
101}

◆ submit()

void GrMockGpu::submit ( GrOpsRenderPass renderPass)
overridevirtual

Implements GrGpu.

Definition at line 79 of file GrMockGpu.cpp.

79 {
80 for (int i = 0; i < static_cast<GrMockOpsRenderPass*>(renderPass)->numDraws(); ++i) {
82 }
83 delete renderPass;
84}
void incNumDraws()
Definition: GrGpu.h:541
Stats fStats
Definition: GrGpu.h:703

◆ waitSemaphore()

void GrMockGpu::waitSemaphore ( GrSemaphore semaphore)
inlineoverridevirtual

Implements GrGpu.

Definition at line 73 of file GrMockGpu.h.

73{}

◆ wrapBackendSemaphore()

std::unique_ptr< GrSemaphore > GrMockGpu::wrapBackendSemaphore ( const GrBackendSemaphore ,
GrSemaphoreWrapType  ,
GrWrapOwnership   
)
inlineoverridevirtual

Implements GrGpu.

Definition at line 67 of file GrMockGpu.h.

69 {
70 return nullptr;
71 }

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