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

#include <GrMockCaps.h>

Inheritance diagram for GrMockCaps:
GrCaps SkCapabilities SkRefCnt SkRefCntBase

Public Member Functions

 GrMockCaps (const GrContextOptions &contextOptions, const GrMockOptions &options)
 
bool isFormatSRGB (const GrBackendFormat &format) const override
 
bool isFormatTexturable (const GrBackendFormat &format, GrTextureType) const override
 
bool isFormatCopyable (const GrBackendFormat &format) const override
 
bool isFormatAsColorTypeRenderable (GrColorType ct, const GrBackendFormat &format, int sampleCount=1) const override
 
bool isFormatRenderable (const GrBackendFormat &format, int sampleCount) const override
 
int getRenderTargetSampleCount (int requestCount, GrColorType) const
 
int getRenderTargetSampleCount (int requestCount, const GrBackendFormat &format) const override
 
int maxRenderTargetSampleCount (GrColorType ct) const
 
int maxRenderTargetSampleCount (const GrBackendFormat &format) const override
 
SupportedWrite supportedWritePixelsColorType (GrColorType surfaceColorType, const GrBackendFormat &surfaceFormat, GrColorType srcColorType) const override
 
SurfaceReadPixelsSupport surfaceSupportsReadPixels (const GrSurface *surface) const override
 
GrBackendFormat getBackendFormatFromCompressionType (SkTextureCompressionType) const override
 
skgpu::Swizzle getWriteSwizzle (const GrBackendFormat &format, GrColorType ct) const override
 
uint64_t computeFormatKey (const GrBackendFormat &) const override
 
GrProgramDesc makeDesc (GrRenderTarget *, const GrProgramInfo &, ProgramDescOverrideFlags) const override
 
- Public Member Functions inherited from GrCaps
 GrCaps (const GrContextOptions &)
 
void dumpJSON (SkJSONWriter *) const
 
const GrShaderCapsshaderCaps () const
 
bool npotTextureTileSupport () const
 
bool mipmapSupport () const
 
bool anisoSupport () const
 
bool gpuTracingSupport () const
 
bool oversizedStencilSupport () const
 
bool textureBarrierSupport () const
 
bool sampleLocationsSupport () const
 
bool drawInstancedSupport () const
 
bool nativeDrawIndirectSupport () const
 
bool useClientSideIndirectBuffers () const
 
bool conservativeRasterSupport () const
 
bool wireframeSupport () const
 
bool msaaResolvesAutomatically () const
 
bool preferDiscardableMSAAAttachment () const
 
bool halfFloatVertexAttributeSupport () const
 
bool usePrimitiveRestart () const
 
bool preferClientSideDynamicBuffers () const
 
bool preferFullscreenClears () const
 
bool discardStencilValuesAfterRenderPass () const
 
bool twoSidedStencilRefsAndMasksMustMatch () const
 
bool preferVRAMUseOverFlushes () const
 
bool avoidStencilBuffers () const
 
bool avoidWritePixelsFastPath () const
 
bool nativeDrawIndexedIndirectIsBroken () const
 
BlendEquationSupport blendEquationSupport () const
 
bool advancedBlendEquationSupport () const
 
bool advancedCoherentBlendEquationSupport () const
 
bool isAdvancedBlendEquationDisabled (skgpu::BlendEquation equation) const
 
bool shouldCollapseSrcOverToSrcWhenAble () const
 
bool mustSyncGpuDuringAbandon () const
 
bool reducedShaderMode () const
 
uint32_t mapBufferFlags () const
 
bool reuseScratchTextures () const
 
bool reuseScratchBuffers () const
 
int maxVertexAttributes () const
 maximum number of attribute values per vertex
 
int maxRenderTargetSize () const
 
int maxPreferredRenderTargetSize () const
 
int maxTextureSize () const
 
int maxWindowRectangles () const
 
bool isWindowRectanglesSupportedForRT (const GrBackendRenderTarget &rt) const
 
uint32_t maxPushConstantsSize () const
 
size_t transferBufferRowBytesAlignment () const
 
size_t transferFromBufferToBufferAlignment () const
 
size_t bufferUpdateDataPreserveAlignment () const
 
bool isFormatCompressed (const GrBackendFormat &format) const
 
int internalMultisampleCount (const GrBackendFormat &format) const
 
bool surfaceSupportsWritePixels (const GrSurface *) const
 
SupportedRead supportedReadPixelsColorType (GrColorType srcColorType, const GrBackendFormat &srcFormat, GrColorType dstColorType) const
 
bool writePixelsRowBytesSupport () const
 
bool transferPixelsToRowBytesSupport () const
 
bool readPixelsRowBytesSupport () const
 
bool transferFromSurfaceToBufferSupport () const
 
bool transferFromBufferToTextureSupport () const
 
bool transferFromBufferToBufferSupport () const
 
bool suppressPrints () const
 
size_t bufferMapThreshold () const
 
bool mustClearUploadedBufferData () const
 
bool shouldInitializeTextures () const
 
bool buffersAreInitiallyZero () const
 
bool supportsAHardwareBufferImages () const
 
bool wireframeMode () const
 
bool semaphoreSupport () const
 
bool backendSemaphoreSupport () const
 
bool finishedProcAsyncCallbackSupport () const
 
bool crossContextTextureSupport () const
 
bool canCopySurface (const GrSurfaceProxy *dst, const SkIRect &dstRect, const GrSurfaceProxy *src, const SkIRect &srcRect) const
 
bool dynamicStateArrayGeometryProcessorTextureSupport () const
 
bool supportsProtectedContent () const
 
bool performPartialClearsAsDraws () const
 
bool performColorClearsAsDraws () const
 
bool avoidLargeIndexBufferDraws () const
 
bool performStencilClearsAsDraws () const
 
bool disableTessellationPathRenderer () const
 
GrDstSampleFlags getDstSampleFlagsForProxy (const GrRenderTargetProxy *, bool drawUsesMSAA) const
 
virtual DstCopyRestrictions getDstCopyRestrictions (const GrRenderTargetProxy *src, GrColorType ct) const
 
bool validateSurfaceParams (const SkISize &, const GrBackendFormat &, GrRenderable renderable, int renderTargetSampleCnt, skgpu::Mipmapped, GrTextureType) const
 
bool areColorTypeAndFormatCompatible (GrColorType grCT, const GrBackendFormat &format) const
 
GrBackendFormat getDefaultBackendFormat (GrColorType, GrRenderable) const
 
bool clampToBorderSupport () const
 
skgpu::Swizzle getReadSwizzle (const GrBackendFormat &format, GrColorType colorType) const
 
const GrDriverBugWorkaroundsworkarounds () const
 
virtual void addExtraSamplerKey (skgpu::KeyBuilder *, GrSamplerState, const GrBackendFormat &) const
 
 GR_DECL_BITFIELD_CLASS_OPS_FRIENDS (ProgramDescOverrideFlags)
 
virtual GrInternalSurfaceFlags getExtraSurfaceFlagsForDeferredRT () const
 
bool supportsDynamicMSAA (const GrRenderTargetProxy *) const
 
virtual bool dmsaaResolveCanBeUsedAsTextureInSameRenderPass () const
 
bool avoidReorderingRenderTasks () const
 
bool avoidDithering () const
 
bool disablePerspectiveSDFText () const
 
bool avoidLineDraws () const
 
std::tuple< GrColorType, GrBackendFormatgetFallbackColorTypeAndFormat (GrColorType, int sampleCount) const
 
- Public Member Functions inherited from SkCapabilities
SkSL::Version skslVersion () const
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Private Member Functions

bool onSurfaceSupportsWritePixels (const GrSurface *) const override
 
bool onCanCopySurface (const GrSurfaceProxy *dst, const SkIRect &dstRect, const GrSurfaceProxy *src, const SkIRect &srcRect) const override
 
GrBackendFormat onGetDefaultBackendFormat (GrColorType ct) const override
 
bool onAreColorTypeAndFormatCompatible (GrColorType ct, const GrBackendFormat &format) const override
 
SupportedRead onSupportedReadPixelsColorType (GrColorType srcColorType, const GrBackendFormat &, GrColorType) const override
 
skgpu::Swizzle onGetReadSwizzle (const GrBackendFormat &format, GrColorType ct) const override
 

Additional Inherited Members

- Public Types inherited from GrCaps
enum  BlendEquationSupport { kBasic_BlendEquationSupport , kAdvanced_BlendEquationSupport , kAdvancedCoherent_BlendEquationSupport , kLast_BlendEquationSupport = kAdvancedCoherent_BlendEquationSupport }
 
enum  MapFlags { kNone_MapFlags = 0x0 , kCanMap_MapFlag = 0x1 , kSubset_MapFlag = 0x2 , kAsyncRead_MapFlag = 0x4 }
 
enum class  SurfaceReadPixelsSupport { kSupported , kCopyToTexture2D , kUnsupported }
 
enum class  ProgramDescOverrideFlags { kNone = 0 , kVulkanHasResolveLoadSubpass = 0x1 }
 
- Static Public Member Functions inherited from SkCapabilities
static sk_sp< const SkCapabilitiesRasterBackend ()
 
- Protected Member Functions inherited from GrCaps
void finishInitialization (const GrContextOptions &options)
 
virtual bool onSupportsDynamicMSAA (const GrRenderTargetProxy *) const
 
- Protected Member Functions inherited from SkCapabilities
 SkCapabilities ()=default
 
void initSkCaps (const SkSL::ShaderCaps *)
 
- Protected Attributes inherited from GrCaps
std::unique_ptr< GrShaderCapsfShaderCaps
 
bool fNPOTTextureTileSupport: 1
 
bool fMipmapSupport: 1
 
bool fAnisoSupport: 1
 
bool fReuseScratchTextures: 1
 
bool fReuseScratchBuffers: 1
 
bool fGpuTracingSupport: 1
 
bool fOversizedStencilSupport: 1
 
bool fTextureBarrierSupport: 1
 
bool fSampleLocationsSupport: 1
 
bool fDrawInstancedSupport: 1
 
bool fNativeDrawIndirectSupport: 1
 
bool fUseClientSideIndirectBuffers: 1
 
bool fConservativeRasterSupport: 1
 
bool fWireframeSupport: 1
 
bool fMSAAResolvesAutomatically: 1
 
bool fPreferDiscardableMSAAAttachment: 1
 
bool fUsePrimitiveRestart: 1
 
bool fPreferClientSideDynamicBuffers: 1
 
bool fPreferFullscreenClears: 1
 
bool fTwoSidedStencilRefsAndMasksMustMatch: 1
 
bool fMustClearUploadedBufferData: 1
 
bool fBuffersAreInitiallyZero: 1
 
bool fShouldInitializeTextures: 1
 
bool fSupportsAHardwareBufferImages: 1
 
bool fHalfFloatVertexAttributeSupport: 1
 
bool fClampToBorderSupport: 1
 
bool fPerformPartialClearsAsDraws: 1
 
bool fPerformColorClearsAsDraws: 1
 
bool fAvoidLargeIndexBufferDraws: 1
 
bool fPerformStencilClearsAsDraws: 1
 
bool fTransferFromBufferToTextureSupport: 1
 
bool fTransferFromSurfaceToBufferSupport: 1
 
bool fTransferFromBufferToBufferSupport: 1
 
bool fWritePixelsRowBytesSupport: 1
 
bool fTransferPixelsToRowBytesSupport: 1
 
bool fReadPixelsRowBytesSupport: 1
 
bool fShouldCollapseSrcOverToSrcWhenAble: 1
 
bool fMustSyncGpuDuringAbandon: 1
 
bool fDisableTessellationPathRenderer: 1
 
bool fAvoidStencilBuffers: 1
 
bool fAvoidWritePixelsFastPath: 1
 
bool fNativeDrawIndexedIndirectIsBroken: 1
 
bool fAvoidReorderingRenderTasks: 1
 
bool fAvoidDithering: 1
 
bool fDisablePerspectiveSDFText: 1
 
bool fAvoidLineDraws: 1
 
bool fPreferVRAMUseOverFlushes: 1
 
bool fSemaphoreSupport: 1
 
bool fBackendSemaphoreSupport: 1
 
bool fFinishedProcAsyncCallbackSupport: 1
 
bool fCrossContextTextureSupport: 1
 
bool fDynamicStateArrayGeometryProcessorTextureSupport: 1
 
bool fSupportsProtectedContent: 1
 
BlendEquationSupport fBlendEquationSupport
 
uint32_t fAdvBlendEqDisableFlags
 
uint32_t fMapBufferFlags
 
int fBufferMapThreshold
 
int fMaxRenderTargetSize
 
int fMaxPreferredRenderTargetSize
 
int fMaxVertexAttributes
 
int fMaxTextureSize
 
int fMaxWindowRectangles
 
int fInternalMultisampleCount
 
uint32_t fMaxPushConstantsSize = 0
 
size_t fTransferBufferRowBytesAlignment = 1
 
size_t fTransferFromBufferToBufferAlignment = 1
 
size_t fBufferUpdateDataPreserveAlignment = 1
 
GrDriverBugWorkarounds fDriverBugWorkarounds
 
- Protected Attributes inherited from SkCapabilities
SkSL::Version fSkSLVersion = SkSL::Version::k100
 

Detailed Description

Definition at line 37 of file GrMockCaps.h.

Constructor & Destructor Documentation

◆ GrMockCaps()

GrMockCaps::GrMockCaps ( const GrContextOptions contextOptions,
const GrMockOptions options 
)
inline

Definition at line 39 of file GrMockCaps.h.

40 : INHERITED(contextOptions), fOptions(options) {
42 fDrawInstancedSupport = options.fDrawInstancedSupport;
43 fHalfFloatVertexAttributeSupport = options.fHalfFloatVertexAttributeSupport;
44 fMapBufferFlags = options.fMapBufferFlags;
45 fBufferMapThreshold = SK_MaxS32; // Overridable in GrContextOptions.
46 fMaxTextureSize = options.fMaxTextureSize;
47 fMaxWindowRectangles = options.fMaxWindowRectangles;
48 fMaxRenderTargetSize = std::min(options.fMaxRenderTargetSize, fMaxTextureSize);
50 fMaxVertexAttributes = options.fMaxVertexAttributes;
53
54 fShaderCaps = std::make_unique<GrShaderCaps>();
55 fShaderCaps->fIntegerSupport = options.fIntegerSupport;
56 fShaderCaps->fFlatInterpolationSupport = options.fFlatInterpolationSupport;
57 fShaderCaps->fMaxFragmentSamplers = options.fMaxFragmentSamplers;
58 fShaderCaps->fShaderDerivativeSupport = options.fShaderDerivativeSupport;
59 fShaderCaps->fDualSourceBlendingSupport = options.fDualSourceBlendingSupport;
60 fShaderCaps->fSampleMaskSupport = true;
61
62 this->finishInitialization(contextOptions);
63 }
const char * options
static constexpr int32_t SK_MaxS32
Definition SkMath.h:21
bool fSupportsProtectedContent
Definition GrCaps.h:648
int fMaxPreferredRenderTargetSize
Definition GrCaps.h:658
int fMaxVertexAttributes
Definition GrCaps.h:659
int fMaxRenderTargetSize
Definition GrCaps.h:657
std::unique_ptr< GrShaderCaps > fShaderCaps
Definition GrCaps.h:584
int fBufferMapThreshold
Definition GrCaps.h:655
bool fHalfFloatVertexAttributeSupport
Definition GrCaps.h:610
bool fSampleLocationsSupport
Definition GrCaps.h:594
int fMaxWindowRectangles
Definition GrCaps.h:661
bool fMipmapSupport
Definition GrCaps.h:587
uint32_t fMapBufferFlags
Definition GrCaps.h:654
void finishInitialization(const GrContextOptions &options)
Definition GrCaps.cpp:107
bool fDrawInstancedSupport
Definition GrCaps.h:595
int fMaxTextureSize
Definition GrCaps.h:660

Member Function Documentation

◆ computeFormatKey()

uint64_t GrMockCaps::computeFormatKey ( const GrBackendFormat format) const
overridevirtual

Implements GrCaps.

Definition at line 37 of file GrMockCaps.cpp.

37 {
38#ifdef SK_DEBUG
39 SkTextureCompressionType compression = format.asMockCompressionType();
41#endif
42 auto ct = format.asMockColorType();
43 return (uint64_t)ct;
44}
#define SkASSERT(cond)
Definition SkAssert.h:116
uint32_t uint32_t * format

◆ getBackendFormatFromCompressionType()

GrBackendFormat GrMockCaps::getBackendFormatFromCompressionType ( SkTextureCompressionType  ) const
inlineoverridevirtual

Implements GrCaps.

Definition at line 152 of file GrMockCaps.h.

152 {
153 return {};
154 }

◆ getRenderTargetSampleCount() [1/2]

int GrMockCaps::getRenderTargetSampleCount ( int  requestCount,
const GrBackendFormat format 
) const
inlineoverridevirtual

Implements GrCaps.

Definition at line 110 of file GrMockCaps.h.

111 {
112 SkTextureCompressionType compression = format.asMockCompressionType();
113 if (compression != SkTextureCompressionType::kNone) {
114 return 0; // no compressed format is renderable
115 }
116
117 return this->getRenderTargetSampleCount(requestCount, format.asMockColorType());
118 }
int getRenderTargetSampleCount(int requestCount, GrColorType) const

◆ getRenderTargetSampleCount() [2/2]

int GrMockCaps::getRenderTargetSampleCount ( int  requestCount,
GrColorType  ct 
) const

Definition at line 14 of file GrMockCaps.cpp.

14 {
15 requestCount = std::max(requestCount, 1);
16
17 switch (fOptions.fConfigOptions[(int)ct].fRenderability) {
19 return 0;
21 return requestCount > 1 ? 0 : 1;
23 return requestCount > kMaxSampleCnt ? 0 : GrNextPow2(requestCount);
24 }
25 return 0;
26}
static uint32_t GrNextPow2(uint32_t n)
Definition SkMathPriv.h:302
ConfigOptions fConfigOptions[kGrColorTypeCnt]

◆ getWriteSwizzle()

skgpu::Swizzle GrMockCaps::getWriteSwizzle ( const GrBackendFormat ,
GrColorType   
) const
inlineoverridevirtual

Returns the skgpu::Swizzle to use when writing colors to a surface with the passed in GrBackendFormat and GrColorType.

Implements GrCaps.

Definition at line 156 of file GrMockCaps.h.

156 {
158 return skgpu::Swizzle("rgba");
159 }
bool areColorTypeAndFormatCompatible(GrColorType grCT, const GrBackendFormat &format) const
Definition GrCaps.cpp:428

◆ isFormatAsColorTypeRenderable()

bool GrMockCaps::isFormatAsColorTypeRenderable ( GrColorType  ct,
const GrBackendFormat format,
int  sampleCount = 1 
) const
inlineoverridevirtual

Implements GrCaps.

Definition at line 89 of file GrMockCaps.h.

90 {
91 // Currently we don't allow RGB_888X to be renderable because we don't have a way to
92 // handle blends that reference dst alpha when the values in the dst alpha channel are
93 // uninitialized.
94 if (ct == GrColorType::kRGB_888x) {
95 return false;
96 }
97 return this->isFormatRenderable(format, sampleCount);
98 }
bool isFormatRenderable(const GrBackendFormat &format, int sampleCount) const override
Definition GrMockCaps.h:100

◆ isFormatCopyable()

bool GrMockCaps::isFormatCopyable ( const GrBackendFormat format) const
inlineoverridevirtual

Implements GrCaps.

Definition at line 85 of file GrMockCaps.h.

85 {
86 return false;
87 }

◆ isFormatRenderable()

bool GrMockCaps::isFormatRenderable ( const GrBackendFormat format,
int  sampleCount 
) const
inlineoverridevirtual

Implements GrCaps.

Definition at line 100 of file GrMockCaps.h.

100 {
101 if (format.asMockCompressionType() != SkTextureCompressionType::kNone) {
102 return false; // compressed formats are never renderable
103 }
104
105 return sampleCount <= this->maxRenderTargetSampleCount(format.asMockColorType());
106 }
GrColorType asMockColorType() const
int maxRenderTargetSampleCount(GrColorType ct) const
Definition GrMockCaps.h:120

◆ isFormatSRGB()

bool GrMockCaps::isFormatSRGB ( const GrBackendFormat format) const
inlineoverridevirtual

Implements GrCaps.

Definition at line 65 of file GrMockCaps.h.

65 {
66 SkTextureCompressionType compression = format.asMockCompressionType();
67 if (compression != SkTextureCompressionType::kNone) {
68 return false;
69 }
70
71 auto ct = format.asMockColorType();
73 }
static constexpr GrColorFormatDesc GrGetColorTypeDesc(GrColorType ct)
constexpr GrColorTypeEncoding encoding() const

◆ isFormatTexturable()

bool GrMockCaps::isFormatTexturable ( const GrBackendFormat format,
GrTextureType   
) const
inlineoverridevirtual

Implements GrCaps.

Definition at line 75 of file GrMockCaps.h.

75 {
76 SkTextureCompressionType compression = format.asMockCompressionType();
77 if (compression != SkTextureCompressionType::kNone) {
78 return fOptions.fCompressedOptions[(int)compression].fTexturable;
79 }
80
81 auto index = static_cast<int>(format.asMockColorType());
82 return fOptions.fConfigOptions[index].fTexturable;
83 }
Type::kYUV Type::kRGBA() int(0.7 *637)
ConfigOptions fCompressedOptions[kSkTextureCompressionTypeCount]

◆ makeDesc()

GrProgramDesc GrMockCaps::makeDesc ( GrRenderTarget ,
const GrProgramInfo programInfo,
ProgramDescOverrideFlags  overrideFlags 
) const
overridevirtual

Implements GrCaps.

Definition at line 28 of file GrMockCaps.cpp.

30 {
33 GrProgramDesc::Build(&desc, programInfo, *this);
34 return desc;
35}
static void Build(GrProgramDesc *, const GrProgramInfo &, const GrCaps &)

◆ maxRenderTargetSampleCount() [1/2]

int GrMockCaps::maxRenderTargetSampleCount ( const GrBackendFormat format) const
inlineoverridevirtual

Implements GrCaps.

Definition at line 132 of file GrMockCaps.h.

132 {
133 SkTextureCompressionType compression = format.asMockCompressionType();
134 if (compression != SkTextureCompressionType::kNone) {
135 return 0; // no compressed format is renderable
136 }
137
138 return this->maxRenderTargetSampleCount(format.asMockColorType());
139 }

◆ maxRenderTargetSampleCount() [2/2]

int GrMockCaps::maxRenderTargetSampleCount ( GrColorType  ct) const
inline

Definition at line 120 of file GrMockCaps.h.

120 {
121 switch (fOptions.fConfigOptions[(int)ct].fRenderability) {
123 return 0;
125 return 1;
127 return kMaxSampleCnt;
128 }
129 return 0;
130 }

◆ onAreColorTypeAndFormatCompatible()

bool GrMockCaps::onAreColorTypeAndFormatCompatible ( GrColorType  ct,
const GrBackendFormat format 
) const
inlineoverrideprivatevirtual

Implements GrCaps.

Definition at line 184 of file GrMockCaps.h.

185 {
186 if (ct == GrColorType::kUnknown) {
187 return false;
188 }
189
190 SkTextureCompressionType compression = format.asMockCompressionType();
193 return ct == GrColorType::kRGB_888x; // TODO: this may be too restrictive
194 }
196 return ct == GrColorType::kRGBA_8888;
197 }
198
199 return ct == format.asMockColorType();
200 }

◆ onCanCopySurface()

bool GrMockCaps::onCanCopySurface ( const GrSurfaceProxy dst,
const SkIRect dstRect,
const GrSurfaceProxy src,
const SkIRect srcRect 
) const
inlineoverrideprivatevirtual

Implements GrCaps.

Definition at line 173 of file GrMockCaps.h.

174 {
175 if (src->isProtected() == GrProtected::kYes && dst->isProtected() != GrProtected::kYes) {
176 return false;
177 }
178 return true;
179 }
dst
Definition cp.py:12

◆ onGetDefaultBackendFormat()

GrBackendFormat GrMockCaps::onGetDefaultBackendFormat ( GrColorType  ct) const
inlineoverrideprivatevirtual

Implements GrCaps.

Definition at line 180 of file GrMockCaps.h.

180 {
182 }
static GrBackendFormat MakeMock(GrColorType colorType, SkTextureCompressionType compression, bool isStencilFormat=false)

◆ onGetReadSwizzle()

skgpu::Swizzle GrMockCaps::onGetReadSwizzle ( const GrBackendFormat format,
GrColorType  ct 
) const
inlineoverrideprivatevirtual

Implements GrCaps.

Definition at line 207 of file GrMockCaps.h.

207 {
209 return skgpu::Swizzle("rgba");
210 }

◆ onSupportedReadPixelsColorType()

SupportedRead GrMockCaps::onSupportedReadPixelsColorType ( GrColorType  srcColorType,
const GrBackendFormat ,
GrColorType   
) const
inlineoverrideprivatevirtual

Implements GrCaps.

Definition at line 202 of file GrMockCaps.h.

203 {
204 return SupportedRead{srcColorType, 1};
205 }

◆ onSurfaceSupportsWritePixels()

bool GrMockCaps::onSurfaceSupportsWritePixels ( const GrSurface ) const
inlineoverrideprivatevirtual

Implements GrCaps.

Definition at line 172 of file GrMockCaps.h.

172{ return true; }

◆ supportedWritePixelsColorType()

SupportedWrite GrMockCaps::supportedWritePixelsColorType ( GrColorType  surfaceColorType,
const GrBackendFormat surfaceFormat,
GrColorType  srcColorType 
) const
inlineoverridevirtual

Given a dst pixel config and a src color type what color type must the caller coax the the data into in order to use GrGpu::writePixels().

Implements GrCaps.

Definition at line 141 of file GrMockCaps.h.

143 {
144 return {surfaceColorType, 1};
145 }

◆ surfaceSupportsReadPixels()

SurfaceReadPixelsSupport GrMockCaps::surfaceSupportsReadPixels ( const GrSurface ) const
inlineoverridevirtual

Backends may have restrictions on what types of surfaces support GrGpu::readPixels(). We may either be able to read directly from the surface, read from a copy of the surface, or not read at all.

Implements GrCaps.

Definition at line 147 of file GrMockCaps.h.


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