Flutter Engine
The Flutter Engine
|
#include <GrXferProcessor.h>
Public Types | |
enum class | AnalysisProperties : unsigned { kNone = 0x0 , kReadsDstInShader = 0x1 , kCompatibleWithCoverageAsAlpha = 0x2 , kIgnoresInputColor = 0x4 , kRequiresDstTexture = 0x10 , kRequiresNonOverlappingDraws = 0x20 , kUsesNonCoherentHWBlending = 0x40 , kUnaffectedByDstValue = 0x80 } |
Public Member Functions | |
GR_DECL_BITFIELD_CLASS_OPS_FRIENDS (AnalysisProperties) | |
Static Public Member Functions | |
static sk_sp< const GrXferProcessor > | MakeXferProcessor (const GrXPFactory *, const GrProcessorAnalysisColor &, GrProcessorAnalysisCoverage, const GrCaps &caps, GrClampType) |
static AnalysisProperties | GetAnalysisProperties (const GrXPFactory *, const GrProcessorAnalysisColor &, const GrProcessorAnalysisCoverage &, const GrCaps &, GrClampType) |
static const GrXPFactory * | FromBlendMode (SkBlendMode) |
Protected Member Functions | |
constexpr | GrXPFactory () |
Private Member Functions | |
virtual sk_sp< const GrXferProcessor > | makeXferProcessor (const GrProcessorAnalysisColor &, GrProcessorAnalysisCoverage, const GrCaps &, GrClampType) const =0 |
virtual AnalysisProperties | analysisProperties (const GrProcessorAnalysisColor &, const GrProcessorAnalysisCoverage &, const GrCaps &, GrClampType) const =0 |
We install a GrXPFactory (XPF) early on in the pipeline before all the final draw information is known (e.g. whether there is fractional pixel coverage, will coverage be 1 or 4 channel, is the draw opaque, etc.). Once the state of the draw is finalized, we use the XPF along with all the draw information to create a GrXferProcessor (XP) which can implement the desired blending for the draw.
Before the XP is created, the XPF is able to answer queries about what functionality the XPs it creates will have. For example, can it create an XP that supports RGB coverage or will the XP blend with the destination color.
GrXPFactories are intended to be static immutable objects. We pass them around as raw pointers and expect the pointers to always be valid and for the factories to be reusable and thread safe. Equality is tested for using pointer comparison. GrXPFactory destructors must be no-ops.
Definition at line 202 of file GrXferProcessor.h.
|
strong |
Enumerator | |
---|---|
kNone | |
kReadsDstInShader | The fragment shader will require the destination color. |
kCompatibleWithCoverageAsAlpha | The op may apply coverage as alpha and still blend correctly. |
kIgnoresInputColor | The color input to the GrXferProcessor will be ignored. |
kRequiresDstTexture | The destination color will be provided to the fragment processor using a texture. This is additional information about the implementation of kReadsDstInShader. |
kRequiresNonOverlappingDraws | If set, each pixel can only be touched once during a draw (e.g., because we have a dst texture or because we need an xfer barrier). |
kUsesNonCoherentHWBlending | If set the draw will use fixed function non coherent advanced blends. |
kUnaffectedByDstValue | If set, the existing dst value has no effect on the final output. |
Definition at line 204 of file GrXferProcessor.h.
|
inlineconstexprprotected |
Definition at line 254 of file GrXferProcessor.h.
|
privatepure virtual |
Subclass analysis implementation. This should not return kNeedsDstInTexture as that will be inferred by the base class based on kReadsDstInShader and the caps.
|
static |
Definition at line 102 of file GrXferProcessor.cpp.
|
static |
Definition at line 66 of file GrXferProcessor.cpp.
GrXPFactory::GR_DECL_BITFIELD_CLASS_OPS_FRIENDS | ( | AnalysisProperties | ) |
|
privatepure virtual |
|
static |
Definition at line 90 of file GrXferProcessor.cpp.