Skia
2DGraphicsLibrary
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GrCaps Class Referenceabstract

Represents the capabilities of a GrContext. More...

#include <GrCaps.h>

Inheritance diagram for GrCaps:
SkRefCnt SkRefCntBase

Public Types

enum  InstancedSupport { kNone, kBasic, kMultisampled, kMixedSampled }
 Indicates the level of support for gr_instanced::* functionality. More...
 
enum  BlendEquationSupport { kBasic_BlendEquationSupport, kAdvanced_BlendEquationSupport, kAdvancedCoherent_BlendEquationSupport, kLast_BlendEquationSupport = kAdvancedCoherent_BlendEquationSupport }
 Indicates the capabilities of the fixed function blend unit.
 
enum  MapFlags { kNone_MapFlags = 0x0, kCanMap_MapFlag = 0x1, kSubset_MapFlag = 0x2 }
 Indicates whether GPU->CPU memory mapping for GPU resources such as vertex buffers and textures allows partial mappings or full mappings.
 

Public Member Functions

 GrCaps (const GrContextOptions &)
 
virtual SkString dump () const
 
const GrShaderCapsshaderCaps () const
 
bool npotTextureTileSupport () const
 
bool mipMapSupport () const
 To avoid as-yet-unnecessary complexity we don't allow any partial support of MIP Maps (e.g. More...
 
bool srgbSupport () const
 Skia convention is that a device only has sRGB support if it supports sRGB formats for both textures and framebuffers. More...
 
bool srgbWriteControl () const
 Is there support for enabling/disabling sRGB writes for sRGB-capable color buffers?
 
bool discardRenderTargetSupport () const
 
bool gpuTracingSupport () const
 
bool oversizedStencilSupport () const
 
bool textureBarrierSupport () const
 
bool sampleLocationsSupport () const
 
bool multisampleDisableSupport () const
 
bool instanceAttribSupport () const
 
bool usesMixedSamples () const
 
bool preferClientSideDynamicBuffers () const
 
bool useDrawInsteadOfClear () const
 
bool preferVRAMUseOverFlushes () const
 
InstancedSupport instancedSupport () const
 
bool avoidInstancedDrawsToFPTargets () const
 
bool avoidStencilBuffers () const
 
BlendEquationSupport blendEquationSupport () const
 
bool advancedBlendEquationSupport () const
 
bool advancedCoherentBlendEquationSupport () const
 
bool canUseAdvancedBlendEquation (GrBlendEquation equation) 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 maxTextureSize () const
 
int maxTileSize () const
 This is the maximum tile size to use by GPU devices for rendering sw-backed images/bitmaps. More...
 
int maxColorSampleCount () const
 
int maxStencilSampleCount () const
 
int maxRasterSamples () const
 
int maxSampleCount () const
 
int maxWindowRectangles () const
 
virtual bool isConfigTexturable (GrPixelConfig) const =0
 
virtual bool isConfigRenderable (GrPixelConfig config, bool withMSAA) const =0
 
virtual bool canConfigBeImageStorage (GrPixelConfig config) const =0
 
bool suppressPrints () const
 
size_t bufferMapThreshold () const
 
bool fullClearIsFree () const
 
bool mustClearUploadedBufferData () const
 True in environments that will issue errors if memory uploaded to buffers is not initialized (even if not read by draw calls). More...
 
bool wireframeMode () const
 
bool sampleShadingSupport () const
 
bool fenceSyncSupport () const
 
bool crossContextTextureSupport () const
 
virtual bool initDescForDstCopy (const GrRenderTargetProxy *src, GrSurfaceDesc *desc, bool *rectsMustMatch, bool *disallowSubrect) const =0
 This is can be called before allocating a texture to be a dst for copySurface. More...
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 Default construct, initializing the reference count to 1.
 
virtual ~SkRefCntBase ()
 Destruct, asserting that the reference count is 1.
 
int32_t getRefCnt () const
 Return the reference count. More...
 
void validate () const
 
bool unique () const
 May return true if the caller is the only owner. More...
 
void ref () const
 Increment the reference count. More...
 
void unref () const
 Decrement the reference count. More...
 

Protected Member Functions

void applyOptionsOverrides (const GrContextOptions &options)
 Subclasses must call this at the end of their constructors in order to apply caps overrides requested by the client. More...
 
 GR_STATIC_ASSERT (kLast_GrBlendEquation< 32)
 
- Protected Member Functions inherited from SkRefCntBase
void internal_dispose_restore_refcnt_to_1 () const
 Allow subclasses to call this if they've overridden internal_dispose so they can reset fRefCnt before the destructor is called or if they choose not to call the destructor (e.g. More...
 

Protected Attributes

sk_sp< GrShaderCapsfShaderCaps
 
bool fNPOTTextureTileSupport: 1
 
bool fMipMapSupport: 1
 
bool fSRGBSupport: 1
 
bool fSRGBWriteControl: 1
 
bool fDiscardRenderTargetSupport: 1
 
bool fReuseScratchTextures: 1
 
bool fReuseScratchBuffers: 1
 
bool fGpuTracingSupport: 1
 
bool fOversizedStencilSupport: 1
 
bool fTextureBarrierSupport: 1
 
bool fSampleLocationsSupport: 1
 
bool fMultisampleDisableSupport: 1
 
bool fInstanceAttribSupport: 1
 
bool fUsesMixedSamples: 1
 
bool fPreferClientSideDynamicBuffers: 1
 
bool fFullClearIsFree: 1
 
bool fMustClearUploadedBufferData: 1
 
bool fUseDrawInsteadOfClear: 1
 
bool fAvoidInstancedDrawsToFPTargets: 1
 
bool fAvoidStencilBuffers: 1
 
bool fPreferVRAMUseOverFlushes: 1
 
bool fSampleShadingSupport: 1
 
bool fFenceSyncSupport: 1
 
bool fCrossContextTextureSupport: 1
 
InstancedSupport fInstancedSupport
 
BlendEquationSupport fBlendEquationSupport
 
uint32_t fAdvBlendEqBlacklist
 
uint32_t fMapBufferFlags
 
int fBufferMapThreshold
 
int fMaxRenderTargetSize
 
int fMaxVertexAttributes
 
int fMaxTextureSize
 
int fMaxTileSize
 
int fMaxColorSampleCount
 
int fMaxStencilSampleCount
 
int fMaxRasterSamples
 
int fMaxWindowRectangles
 

Private Types

typedef SkRefCnt INHERITED
 

Private Member Functions

virtual void onApplyOptionsOverrides (const GrContextOptions &)
 

Private Attributes

bool fSuppressPrints: 1
 
bool fWireframeMode: 1
 

Detailed Description

Represents the capabilities of a GrContext.

Member Enumeration Documentation

Indicates the level of support for gr_instanced::* functionality.

A higher level includes all functionality from the levels below it.

Member Function Documentation

void GrCaps::applyOptionsOverrides ( const GrContextOptions options)
protected

Subclasses must call this at the end of their constructors in order to apply caps overrides requested by the client.

Note that overrides will only reduce the caps never expand them.

virtual bool GrCaps::initDescForDstCopy ( const GrRenderTargetProxy *  src,
GrSurfaceDesc desc,
bool *  rectsMustMatch,
bool *  disallowSubrect 
) const
pure virtual

This is can be called before allocating a texture to be a dst for copySurface.

This is only used for doing dst copies needed in blends, thus the src is always a GrRenderTargetProxy. It will populate the origin, config, and flags fields of the desc such that copySurface can efficiently succeed. rectsMustMatch will be set to true if the copy operation must ensure that the src and dest rects are identical. disallowSubrect will be set to true if copy rect must equal src's bounds.

int GrCaps::maxTileSize ( ) const
inline

This is the maximum tile size to use by GPU devices for rendering sw-backed images/bitmaps.

It is usually the max texture size, unless we're overriding it for testing.

bool GrCaps::mipMapSupport ( ) const
inline

To avoid as-yet-unnecessary complexity we don't allow any partial support of MIP Maps (e.g.

only for POT textures)

bool GrCaps::mustClearUploadedBufferData ( ) const
inline

True in environments that will issue errors if memory uploaded to buffers is not initialized (even if not read by draw calls).

bool GrCaps::srgbSupport ( ) const
inline

Skia convention is that a device only has sRGB support if it supports sRGB formats for both textures and framebuffers.

In addition: Decoding to linear of an sRGB texture can be disabled.


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