Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | List of all members
DisableColorXP Class Reference
Inheritance diagram for DisableColorXP:
GrXferProcessor GrProcessor GrNonAtomicRef< GrXferProcessor > SkNoncopyable

Public Member Functions

 DisableColorXP ()
 
- Public Member Functions inherited from GrXferProcessor
void addToKey (const GrShaderCaps &, skgpu::KeyBuilder *, const GrSurfaceOrigin *originIfDstTexture, bool usesInputAttachmentForDstRead) const
 
virtual GrXferBarrierType xferBarrierType (const GrCaps &caps) const
 
skgpu::BlendInfo getBlendInfo () const
 
bool willReadDstColor () const
 
bool hasSecondaryOutput () const
 
bool isLCD () const
 
bool isEqual (const GrXferProcessor &that) const
 
- Public Member Functions inherited from GrProcessor
virtual ~GrProcessor ()=default
 
void * operator new (size_t size)
 
void * operator new (size_t object_size, size_t footer_size)
 
void operator delete (void *target)
 
void * operator new (size_t size, void *placement)
 
void operator delete (void *target, void *placement)
 
template<typename T >
const Tcast () const
 
ClassID classID () const
 
- Public Member Functions inherited from GrNonAtomicRef< GrXferProcessor >
 GrNonAtomicRef ()
 
bool unique () const
 
int refCnt () const
 
void ref () const
 
void unref () const
 
- Public Member Functions inherited from SkNoncopyable
 SkNoncopyable ()=default
 
 SkNoncopyable (SkNoncopyable &&)=default
 
SkNoncopyableoperator= (SkNoncopyable &&)=default
 

Private Member Functions

const char * name () const override
 
bool onIsEqual (const GrXferProcessor &xpBase) const override
 
void onAddToKey (const GrShaderCaps &, skgpu::KeyBuilder *) const override
 
void onGetBlendInfo (skgpu::BlendInfo *blendInfo) const override
 
std::unique_ptr< ProgramImplmakeProgramImpl () const override
 

Additional Inherited Members

- Public Types inherited from GrProcessor
enum  ClassID {
  kNull_ClassID , kAttributeTestProcessor_ClassID , kBigKeyProcessor_ClassID , kBlendFragmentProcessor_ClassID ,
  kBlockInputFragmentProcessor_ClassID , kButtCapStrokedCircleGeometryProcessor_ClassID , kCircleGeometryProcessor_ClassID , kCircularRRectEffect_ClassID ,
  kClockwiseTestProcessor_ClassID , kColorTableEffect_ClassID , kCoverageSetOpXP_ClassID , kCustomXP_ClassID ,
  kDashingCircleEffect_ClassID , kDashingLineEffect_ClassID , kDefaultGeoProc_ClassID , kDeviceSpace_ClassID ,
  kDIEllipseGeometryProcessor_ClassID , kDisableColorXP_ClassID , kDrawAtlasPathShader_ClassID , kEllipseGeometryProcessor_ClassID ,
  kEllipticalRRectEffect_ClassID , kFwidthSquircleTestProcessor_ClassID , kGP_ClassID , kGrBicubicEffect_ClassID ,
  kGrBitmapTextGeoProc_ClassID , kGrColorSpaceXformEffect_ClassID , kGrConicEffect_ClassID , kGrConvexPolyEffect_ClassID ,
  kGrDiffuseLightingEffect_ClassID , kGrDisplacementMapEffect_ClassID , kGrDistanceFieldA8TextGeoProc_ClassID , kGrDistanceFieldLCDTextGeoProc_ClassID ,
  kGrDistanceFieldPathGeoProc_ClassID , kGrFillRRectOp_Processor_ClassID , kGrGaussianConvolutionFragmentProcessor_ClassID , kGrMatrixConvolutionEffect_ClassID ,
  kGrMatrixEffect_ClassID , kGrMeshTestProcessor_ClassID , kGrMorphologyEffect_ClassID , kGrPerlinNoise2Effect_ClassID ,
  kGrPipelineDynamicStateTestProcessor_ClassID , kGrQuadEffect_ClassID , kGrRRectShadowGeoProc_ClassID , kGrSkSLFP_ClassID ,
  kGrSpecularLightingEffect_ClassID , kGrTextureEffect_ClassID , kGrUnrolledBinaryGradientColorizer_ClassID , kGrYUVtoRGBEffect_ClassID ,
  kHighPrecisionFragmentProcessor_ClassID , kLatticeGP_ClassID , kPDLCDXferProcessor_ClassID , kPorterDuffXferProcessor_ClassID ,
  kPremulFragmentProcessor_ClassID , kQuadEdgeEffect_ClassID , kQuadPerEdgeAAGeometryProcessor_ClassID , kSeriesFragmentProcessor_ClassID ,
  kShaderPDXferProcessor_ClassID , kSurfaceColorProcessor_ClassID , kSwizzleFragmentProcessor_ClassID , kTessellate_BoundingBoxShader_ClassID ,
  kTessellate_GrModulateAtlasCoverageEffect_ClassID , kTessellate_GrStrokeTessellationShader_ClassID , kTessellate_HullShader_ClassID , kTessellate_MiddleOutShader_ClassID ,
  kTessellate_SimpleTriangleShader_ClassID , kTessellationTestTriShader_ClassID , kTestFP_ClassID , kTestRectOp_ClassID ,
  kVertexColorSpaceBenchGP_ClassID , kVerticesGP_ClassID
}
 
- Protected Member Functions inherited from GrXferProcessor
 GrXferProcessor (ClassID classID)
 
 GrXferProcessor (ClassID classID, bool willReadDstColor, GrProcessorAnalysisCoverage)
 
- Protected Member Functions inherited from GrProcessor
 GrProcessor (ClassID classID)
 
 GrProcessor (const GrProcessor &)=delete
 
GrProcessoroperator= (const GrProcessor &)=delete
 
- Protected Attributes inherited from GrProcessor
const ClassID fClassID
 

Detailed Description

This xfer processor disables color writing. Thus color and coverage and ignored and no blending occurs. This XP is usful for things like stenciling.

Definition at line 26 of file GrDisableColorXP.cpp.

Constructor & Destructor Documentation

◆ DisableColorXP()

DisableColorXP::DisableColorXP ( )
inline

Definition at line 28 of file GrDisableColorXP.cpp.

28: INHERITED(kDisableColorXP_ClassID) {}
@ kDisableColorXP_ClassID
Definition GrProcessor.h:43

Member Function Documentation

◆ makeProgramImpl()

std::unique_ptr< GrXferProcessor::ProgramImpl > DisableColorXP::makeProgramImpl ( ) const
overrideprivatevirtual

Returns a new instance of the appropriate GL implementation class for the given GrXferProcessor; caller is responsible for deleting the object.

Implements GrXferProcessor.

Definition at line 42 of file GrDisableColorXP.cpp.

42 {
43 class Impl : public ProgramImpl {
44 private:
45 void emitOutputsForBlendState(const EmitArgs& args) override {
46 if (args.fShaderCaps->fMustWriteToFragColor) {
47 // This emit code should be empty. However, on the nexus 6 there is a driver bug
48 // where if you do not give gl_FragColor a value, the gl context is lost and we end
49 // up drawing nothing. So this fix just sets the gl_FragColor arbitrarily to 0.
50 // https://bugs.chromium.org/p/chromium/issues/detail?id=445377
51 GrGLSLXPFragmentBuilder* fragBuilder = args.fXPFragBuilder;
52 fragBuilder->codeAppendf("%s = half4(0);", args.fOutputPrimary);
53 }
54 }
55
56 void emitWriteSwizzle(GrGLSLXPFragmentBuilder*,
57 const skgpu::Swizzle&,
58 const char*,
59 const char*) const override {
60 // Don't write any swizzling. This makes sure the final shader does not output a color.
61 }
62 };
63
64 return std::make_unique<Impl>();
65}
void codeAppendf(const char format[],...) SK_PRINTF_LIKE(2
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args

◆ name()

const char * DisableColorXP::name ( ) const
inlineoverrideprivatevirtual

Human-meaningful string to identify this processor; may be embedded in generated shader code and must be a legal SkSL identifier prefix.

Implements GrProcessor.

Definition at line 31 of file GrDisableColorXP.cpp.

31{ return "Disable Color"; }

◆ onAddToKey()

void DisableColorXP::onAddToKey ( const GrShaderCaps ,
skgpu::KeyBuilder  
) const
inlineoverrideprivatevirtual

Adds a key on the skgpu::KeyBuilder that reflects any variety in the code that may be emitted by the xfer processor subclass.

Implements GrXferProcessor.

Definition at line 33 of file GrDisableColorXP.cpp.

33{}

◆ onGetBlendInfo()

void DisableColorXP::onGetBlendInfo ( skgpu::BlendInfo ) const
inlineoverrideprivatevirtual

If we are not performing a dst read, retrieves the fixed-function blend state required by the subclass. When using dst reads, the base class controls the fixed-function blend state and this method will not be called. The BlendInfo struct comes initialized to "no blending".

Reimplemented from GrXferProcessor.

Definition at line 34 of file GrDisableColorXP.cpp.

34 {
35 blendInfo->fWritesColor = false;
36 }

◆ onIsEqual()

bool DisableColorXP::onIsEqual ( const GrXferProcessor xpBase) const
inlineoverrideprivatevirtual

Implements GrXferProcessor.

Definition at line 32 of file GrDisableColorXP.cpp.

32{ return true; }

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