![]() |
Flutter Engine
The Flutter Engine
|
#include <GrXferProcessor.h>
Classes | |
class | ProgramImpl |
Public Member Functions | |
void | addToKey (const GrShaderCaps &, skgpu::KeyBuilder *, const GrSurfaceOrigin *originIfDstTexture, bool usesInputAttachmentForDstRead) const |
virtual std::unique_ptr< ProgramImpl > | makeProgramImpl () const =0 |
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 |
![]() | |
virtual | ~GrProcessor ()=default |
virtual const char * | name () const =0 |
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 T & | cast () const |
ClassID | classID () const |
![]() | |
GrNonAtomicRef () | |
bool | unique () const |
int | refCnt () const |
void | ref () const |
void | unref () const |
![]() | |
SkNoncopyable ()=default | |
SkNoncopyable (SkNoncopyable &&)=default | |
SkNoncopyable & | operator= (SkNoncopyable &&)=default |
Protected Member Functions | |
GrXferProcessor (ClassID classID) | |
GrXferProcessor (ClassID classID, bool willReadDstColor, GrProcessorAnalysisCoverage) | |
![]() | |
GrProcessor (ClassID classID) | |
GrProcessor (const GrProcessor &)=delete | |
GrProcessor & | operator= (const GrProcessor &)=delete |
Private Member Functions | |
virtual void | onAddToKey (const GrShaderCaps &, skgpu::KeyBuilder *) const =0 |
virtual bool | onHasSecondaryOutput () const |
virtual void | onGetBlendInfo (skgpu::BlendInfo *) const |
virtual bool | onIsEqual (const GrXferProcessor &) const =0 |
GrXferProcessor is responsible for implementing the xfer mode that blends the src color and dst color, and for applying any coverage. It does this by emitting fragment shader code and controlling the fixed-function blend state. When dual-source blending is available, it may also write a secondary fragment shader output color. GrXferProcessor has two modes of operation:
Dst read: When allowed by the backend API, or when supplied a texture of the destination, the GrXferProcessor may read the destination color. While operating in this mode, the subclass only provides shader code that blends the src and dst colors, and the base class applies coverage.
No dst read: When not performing a dst read, the subclass is given full control of the fixed- function blend state and/or secondary output, and is responsible to apply coverage on its own.
A GrXferProcessor is never installed directly into our draw state, but instead is created from a GrXPFactory once we have finalized the state of our draw.
Definition at line 69 of file GrXferProcessor.h.
|
protected |
Definition at line 23 of file GrXferProcessor.cpp.
|
protected |
Definition at line 28 of file GrXferProcessor.cpp.
void GrXferProcessor::addToKey | ( | const GrShaderCaps & | caps, |
skgpu::KeyBuilder * | b, | ||
const GrSurfaceOrigin * | originIfDstTexture, | ||
bool | usesInputAttachmentForDstRead | ||
) | const |
Adds a key on the skgpu::KeyBuilder calls onAddToKey(...) to get the specific subclass's key.
Definition at line 41 of file GrXferProcessor.cpp.
|
inline |
Definition at line 101 of file GrXferProcessor.h.
bool GrXferProcessor::hasSecondaryOutput | ( | ) | const |
Returns whether or not this xferProcossor will set a secondary output to be used with dual source blending.
Definition at line 34 of file GrXferProcessor.cpp.
|
inline |
Returns true if this and other processor conservatively draw identically. It can only return true when the two processor are of the same subclass (i.e. they return the same object from from getFactory()).
A return value of true from isEqual() should not be used to test whether the processor would generate the same shader code. To test for identical code generation use addToKey.
Definition at line 127 of file GrXferProcessor.h.
|
inline |
Definition at line 117 of file GrXferProcessor.h.
|
pure virtual |
Returns a new instance of the appropriate GL implementation class for the given GrXferProcessor; caller is responsible for deleting the object.
Implemented in CoverageSetOpXP, CustomXP, PorterDuffXferProcessor, ShaderPDXferProcessor, and PDLCDXferProcessor.
|
privatepure virtual |
Adds a key on the skgpu::KeyBuilder that reflects any variety in the code that may be emitted by the xfer processor subclass.
|
inlineprivatevirtual |
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".
Definition at line 163 of file GrXferProcessor.h.
|
inlineprivatevirtual |
If we are not performing a dst read, returns whether the subclass will set a secondary output. When using dst reads, the base class controls the secondary output and this method will not be called.
Definition at line 156 of file GrXferProcessor.h.
|
privatepure virtual |
|
inline |
Definition at line 109 of file GrXferProcessor.h.
|
inlinevirtual |
Returns the barrier type, if any, that this XP will require. Note that the possibility that a kTexture type barrier is required is handled by the GrPipeline and need not be considered by subclass overrides of this function.
Reimplemented in CustomXP.
Definition at line 97 of file GrXferProcessor.h.