Skia
2DGraphicsLibrary
|
We install a GrXPFactory (XPF) early on in the pipeline before all the final draw information is known (e.g. More...
#include <GrXferProcessor.h>
Classes | |
struct | InvariantBlendedColor |
Known color information after blending, but before accounting for any coverage. More... | |
Public Types | |
typedef GrXferProcessor::DstTexture | DstTexture |
Public Member Functions | |
GrXferProcessor * | createXferProcessor (const GrPipelineAnalysis &, bool hasMixedSamples, const DstTexture *, const GrCaps &caps) const |
virtual void | getInvariantBlendedColor (const GrProcOptInfo &colorPOI, InvariantBlendedColor *) const =0 |
Returns information about the output color, produced by XPs from this factory, that will be known after blending. More... | |
bool | willNeedDstTexture (const GrCaps &caps, const GrPipelineAnalysis &) const |
Private Member Functions | |
virtual GrXferProcessor * | onCreateXferProcessor (const GrCaps &caps, const GrPipelineAnalysis &, bool hasMixedSamples, const DstTexture *) const =0 |
bool | willReadDstColor (const GrCaps &, const GrPipelineAnalysis &) const |
virtual bool | onWillReadDstColor (const GrCaps &, const GrPipelineAnalysis &) const =0 |
Returns true if the XP generated by this factory will explicitly read dst in the fragment shader. | |
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.
|
pure virtual |
Returns information about the output color, produced by XPs from this factory, that will be known after blending.
Note that we can conflate coverage and color, so the actual values written to pixels with partial coverage may not always seem consistent with the invariant information returned by this function.