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

#include <GrProgramInfo.h>

Public Member Functions

 GrProgramInfo (const GrCaps &caps, const GrSurfaceProxyView &targetView, bool usesMSAASurface, const GrPipeline *pipeline, const GrUserStencilSettings *userStencilSettings, const GrGeometryProcessor *geomProc, GrPrimitiveType primitiveType, GrXferBarrierFlags renderPassXferBarriers, GrLoadOp colorLoadOp)
 
int numSamples () const
 
int needsStencil () const
 
bool isStencilEnabled () const
 
const GrUserStencilSettingsuserStencilSettings () const
 
const GrBackendFormatbackendFormat () const
 
GrSurfaceOrigin origin () const
 
const GrPipelinepipeline () const
 
const GrGeometryProcessorgeomProc () const
 
GrPrimitiveType primitiveType () const
 
bool targetHasVkResolveAttachmentWithInput () const
 
int targetsNumSamples () const
 
GrXferBarrierFlags renderPassBarriers () const
 
GrLoadOp colorLoadOp () const
 
uint16_t primitiveTypeKey () const
 
GrStencilSettings nonGLStencilSettings () const
 
void visitFPProxies (const GrVisitProxyFunc &func) const
 

Detailed Description

Definition at line 17 of file GrProgramInfo.h.

Constructor & Destructor Documentation

◆ GrProgramInfo()

GrProgramInfo::GrProgramInfo ( const GrCaps caps,
const GrSurfaceProxyView targetView,
bool  usesMSAASurface,
const GrPipeline pipeline,
const GrUserStencilSettings userStencilSettings,
const GrGeometryProcessor geomProc,
GrPrimitiveType  primitiveType,
GrXferBarrierFlags  renderPassXferBarriers,
GrLoadOp  colorLoadOp 
)

Definition at line 15 of file GrProgramInfo.cpp.

24 : fNeedsStencil(targetView.asRenderTargetProxy()->needsStencil())
25 , fBackendFormat(targetView.proxy()->backendFormat())
26 , fOrigin(targetView.origin())
27 , fTargetHasVkResolveAttachmentWithInput(
29 ((targetView.asRenderTargetProxy()->numSamples() > 1 &&
30 targetView.asTextureProxy()) ||
31 targetView.asRenderTargetProxy()->numSamples() == 1))
32 , fTargetsNumSamples(targetView.asRenderTargetProxy()->numSamples())
33 , fPipeline(pipeline)
34 , fUserStencilSettings(userStencilSettings)
35 , fGeomProc(geomProc)
36 , fPrimitiveType(primitiveType)
37 , fRenderPassXferBarriers(renderPassXferBarriers)
38 , fColorLoadOp(colorLoadOp) {
39 SkASSERT(fTargetsNumSamples > 0);
40 fNumSamples = fTargetsNumSamples;
41 if (fNumSamples == 1 && usesMSAASurface) {
42 fNumSamples = caps.internalMultisampleCount(this->backendFormat());
43 }
44 SkDEBUGCODE(this->validate(false);)
45}
#define SkASSERT(cond)
Definition: SkAssert.h:116
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
int internalMultisampleCount(const GrBackendFormat &format) const
Definition: GrCaps.h:271
GrPrimitiveType primitiveType() const
Definition: GrProgramInfo.h:42
const GrPipeline & pipeline() const
Definition: GrProgramInfo.h:39
const GrGeometryProcessor & geomProc() const
Definition: GrProgramInfo.h:40
const GrUserStencilSettings * userStencilSettings() const
Definition: GrProgramInfo.h:35
GrLoadOp colorLoadOp() const
Definition: GrProgramInfo.h:52
const GrBackendFormat & backendFormat() const
Definition: GrProgramInfo.h:37
bool supportsVkInputAttachment() const
GrTextureProxy * asTextureProxy() const
GrSurfaceOrigin origin() const
GrSurfaceProxy * proxy() const
GrRenderTargetProxy * asRenderTargetProxy() const
const GrBackendFormat & backendFormat() const

Member Function Documentation

◆ backendFormat()

const GrBackendFormat & GrProgramInfo::backendFormat ( ) const
inline

Definition at line 37 of file GrProgramInfo.h.

37{ return fBackendFormat; }

◆ colorLoadOp()

GrLoadOp GrProgramInfo::colorLoadOp ( ) const
inline

Definition at line 52 of file GrProgramInfo.h.

52{ return fColorLoadOp; }

◆ geomProc()

const GrGeometryProcessor & GrProgramInfo::geomProc ( ) const
inline

Definition at line 40 of file GrProgramInfo.h.

40{ return *fGeomProc; }

◆ isStencilEnabled()

bool GrProgramInfo::isStencilEnabled ( ) const
inline

Definition at line 31 of file GrProgramInfo.h.

31 {
32 return fUserStencilSettings != &GrUserStencilSettings::kUnused ||
33 fPipeline->hasStencilClip();
34 }
bool hasStencilClip() const
Definition: GrPipeline.h:174
static const GrUserStencilSettings & kUnused

◆ needsStencil()

int GrProgramInfo::needsStencil ( ) const
inline

Definition at line 30 of file GrProgramInfo.h.

30{ return fNeedsStencil; }

◆ nonGLStencilSettings()

GrStencilSettings GrProgramInfo::nonGLStencilSettings ( ) const

Definition at line 47 of file GrProgramInfo.cpp.

47 {
48 GrStencilSettings stencil;
49
50 if (this->isStencilEnabled()) {
51 stencil.reset(*fUserStencilSettings, this->pipeline().hasStencilClip(), 8);
52 }
53
54 return stencil;
55}
bool isStencilEnabled() const
Definition: GrProgramInfo.h:31
void reset(const GrUserStencilSettings &, bool hasStencilClip, int numStencilBits)

◆ numSamples()

int GrProgramInfo::numSamples ( ) const
inline

Definition at line 29 of file GrProgramInfo.h.

29{ return fNumSamples; }

◆ origin()

GrSurfaceOrigin GrProgramInfo::origin ( ) const
inline

Definition at line 38 of file GrProgramInfo.h.

38{ return fOrigin; }

◆ pipeline()

const GrPipeline & GrProgramInfo::pipeline ( ) const
inline

Definition at line 39 of file GrProgramInfo.h.

39{ return *fPipeline; }

◆ primitiveType()

GrPrimitiveType GrProgramInfo::primitiveType ( ) const
inline

Definition at line 42 of file GrProgramInfo.h.

42{ return fPrimitiveType; }

◆ primitiveTypeKey()

uint16_t GrProgramInfo::primitiveTypeKey ( ) const
inline

Definition at line 54 of file GrProgramInfo.h.

54 {
55 return (uint16_t) fPrimitiveType;
56 }

◆ renderPassBarriers()

GrXferBarrierFlags GrProgramInfo::renderPassBarriers ( ) const
inline

Definition at line 50 of file GrProgramInfo.h.

50{ return fRenderPassXferBarriers; }

◆ targetHasVkResolveAttachmentWithInput()

bool GrProgramInfo::targetHasVkResolveAttachmentWithInput ( ) const
inline

Definition at line 44 of file GrProgramInfo.h.

44 {
45 return fTargetHasVkResolveAttachmentWithInput;
46 }

◆ targetsNumSamples()

int GrProgramInfo::targetsNumSamples ( ) const
inline

Definition at line 48 of file GrProgramInfo.h.

48{ return fTargetsNumSamples; }

◆ userStencilSettings()

const GrUserStencilSettings * GrProgramInfo::userStencilSettings ( ) const
inline

Definition at line 35 of file GrProgramInfo.h.

35{ return fUserStencilSettings; }

◆ visitFPProxies()

void GrProgramInfo::visitFPProxies ( const GrVisitProxyFunc func) const
inline

Definition at line 64 of file GrProgramInfo.h.

64{ fPipeline->visitProxies(func); }
void visitProxies(const GrVisitProxyFunc &) const
Definition: GrPipeline.cpp:105

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