Flutter Engine
The Flutter Engine
|
#include <GrTextureEffect.h>
Classes | |
class | Impl |
struct | Sampling |
Public Member Functions | |
std::unique_ptr< GrFragmentProcessor > | clone () const override |
const char * | name () const override |
GrSamplerState | samplerState () const |
GrTexture * | texture () const |
const GrSurfaceProxyView & | view () const |
SkMatrix | coordAdjustmentMatrix () const |
Public Member Functions inherited from GrFragmentProcessor | |
const GrFragmentProcessor * | parent () const |
std::unique_ptr< ProgramImpl > | makeProgramImpl () const |
void | addToKey (const GrShaderCaps &caps, skgpu::KeyBuilder *b) const |
int | numChildProcessors () const |
int | numNonNullChildProcessors () const |
GrFragmentProcessor * | childProcessor (int index) |
const GrFragmentProcessor * | childProcessor (int index) const |
SkDEBUGCODE (bool isInstantiated() const ;) bool willReadDstColor() const | |
bool | isBlendFunction () const |
bool | usesSampleCoordsDirectly () const |
bool | usesSampleCoords () const |
const SkSL::SampleUsage & | sampleUsage () const |
bool | compatibleWithCoverageAsAlpha () const |
bool | preservesOpaqueInput () const |
bool | hasConstantOutputForConstantInput (SkPMColor4f inputColor, SkPMColor4f *outputColor) const |
bool | hasConstantOutputForConstantInput () const |
void | clearConstantOutputForConstantInputFlag () |
bool | isEqual (const GrFragmentProcessor &that) const |
void | visitProxies (const GrVisitProxyFunc &) const |
void | visitTextureEffects (const std::function< void(const GrTextureEffect &)> &) const |
void | visitWithImpls (const std::function< void(const GrFragmentProcessor &, ProgramImpl &)> &, ProgramImpl &) const |
GrTextureEffect * | asTextureEffect () |
const GrTextureEffect * | asTextureEffect () 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 T & | cast () const |
ClassID | classID () const |
Static Public Member Functions | |
static std::unique_ptr< GrFragmentProcessor > | Make (GrSurfaceProxyView, SkAlphaType, const SkMatrix &=SkMatrix::I(), GrSamplerState::Filter=GrSamplerState::Filter::kNearest, GrSamplerState::MipmapMode mipmapMode=GrSamplerState::MipmapMode::kNone) |
static std::unique_ptr< GrFragmentProcessor > | Make (GrSurfaceProxyView, SkAlphaType, const SkMatrix &, GrSamplerState, const GrCaps &caps, const float border[4]=kDefaultBorder) |
static std::unique_ptr< GrFragmentProcessor > | MakeSubset (GrSurfaceProxyView, SkAlphaType, const SkMatrix &, GrSamplerState, const SkRect &subset, const GrCaps &caps, const float border[4]=kDefaultBorder, bool alwaysUseShaderTileMode=false) |
static std::unique_ptr< GrFragmentProcessor > | MakeSubset (GrSurfaceProxyView, SkAlphaType, const SkMatrix &, GrSamplerState, const SkRect &subset, const SkRect &domain, const GrCaps &caps, const float border[4]=kDefaultBorder) |
static std::unique_ptr< GrFragmentProcessor > | MakeCustomLinearFilterInset (GrSurfaceProxyView, SkAlphaType, const SkMatrix &, GrSamplerState::WrapMode wx, GrSamplerState::WrapMode wy, const SkRect &subset, const SkRect *domain, SkVector inset, const GrCaps &caps, const float border[4]=kDefaultBorder) |
Static Public Member Functions inherited from GrFragmentProcessor | |
static std::unique_ptr< GrFragmentProcessor > | MakeColor (SkPMColor4f color) |
static std::unique_ptr< GrFragmentProcessor > | MulInputByChildAlpha (std::unique_ptr< GrFragmentProcessor > child) |
static std::unique_ptr< GrFragmentProcessor > | ApplyPaintAlpha (std::unique_ptr< GrFragmentProcessor > child) |
static std::unique_ptr< GrFragmentProcessor > | ModulateRGBA (std::unique_ptr< GrFragmentProcessor > child, const SkPMColor4f &color) |
static std::unique_ptr< GrFragmentProcessor > | OverrideInput (std::unique_ptr< GrFragmentProcessor >, const SkPMColor4f &) |
static std::unique_ptr< GrFragmentProcessor > | DisableCoverageAsAlpha (std::unique_ptr< GrFragmentProcessor >) |
static std::unique_ptr< GrFragmentProcessor > | DestColor () |
static std::unique_ptr< GrFragmentProcessor > | SwizzleOutput (std::unique_ptr< GrFragmentProcessor >, const skgpu::Swizzle &) |
static std::unique_ptr< GrFragmentProcessor > | ClampOutput (std::unique_ptr< GrFragmentProcessor >) |
static std::unique_ptr< GrFragmentProcessor > | Compose (std::unique_ptr< GrFragmentProcessor > f, std::unique_ptr< GrFragmentProcessor > g) |
static std::unique_ptr< GrFragmentProcessor > | ColorMatrix (std::unique_ptr< GrFragmentProcessor > child, const float matrix[20], bool unpremulInput, bool clampRGBOutput, bool premulOutput) |
static std::unique_ptr< GrFragmentProcessor > | SurfaceColor () |
static std::unique_ptr< GrFragmentProcessor > | DeviceSpace (std::unique_ptr< GrFragmentProcessor >) |
static std::unique_ptr< GrFragmentProcessor > | Rect (std::unique_ptr< GrFragmentProcessor >, GrClipEdgeType, SkRect) |
static GrFPResult | Circle (std::unique_ptr< GrFragmentProcessor >, GrClipEdgeType, SkPoint center, float radius) |
static GrFPResult | Ellipse (std::unique_ptr< GrFragmentProcessor >, GrClipEdgeType, SkPoint center, SkPoint radii, const GrShaderCaps &) |
static std::unique_ptr< GrFragmentProcessor > | HighPrecision (std::unique_ptr< GrFragmentProcessor >) |
Static Public Attributes | |
static constexpr float | kDefaultBorder [4] = {0} |
static constexpr float | kInsetEpsilon = 0.f |
static constexpr float | kLinearInset = 0.5f + kInsetEpsilon |
Private Member Functions | |
std::unique_ptr< ProgramImpl > | onMakeProgramImpl () const override |
void | onAddToKey (const GrShaderCaps &, skgpu::KeyBuilder *) const override |
bool | onIsEqual (const GrFragmentProcessor &) const override |
Definition at line 32 of file GrTextureEffect.h.
|
overridevirtual |
Makes a copy of this fragment processor that draws equivalently to the original. If the processor has child processors they are cloned as well.
Implements GrFragmentProcessor.
Definition at line 850 of file GrTextureEffect.cpp.
SkMatrix GrTextureEffect::coordAdjustmentMatrix | ( | ) | const |
Definition at line 303 of file GrTextureEffect.cpp.
|
static |
Make from a full GrSamplerState. Caps are required to determine support for kClampToBorder. This will be emulated in the shader if there is no hardware support.
Definition at line 229 of file GrTextureEffect.cpp.
|
static |
Make from a filter. The sampler will be configured with clamp mode.
|
static |
Like MakeSubset() but always uses kLinear filtering. MakeSubset() uses the subset rect dimensions to determine the period of the wrap mode (for repeat and mirror). Once it computes the wrapped texture coordinate inside subset rect it further clamps it to a 0.5 inset rect of subset. When subset is an integer rectangle this clamping avoids the hw linear filtering from reading texels just outside the subset rect. This factory allows a custom inset clamping distance rather than 0.5, allowing those neighboring texels to influence the linear filtering sample result. If there is a known restriction on the post-matrix texture coords it can be specified using domain.
Definition at line 284 of file GrTextureEffect.cpp.
|
static |
Makes a texture effect that samples a subset of a texture. The wrap modes of the GrSampleState are applied to the subset in the shader rather than using HW samplers. The 'subset' parameter specifies the texels in the base level. The shader code will avoid allowing linear filtering to read outside the texel window. However, if MIP filtering is used and a shader invocation reads from a level other than the base then it may read texel values that were computed from in part from base level texels outside the window. More specifically, we treat the MIP map case exactly like the linear case in terms of how the final texture coords are computed. If alwaysUseShaderTileMode is true then MakeSubset won't attempt to use HW wrap modes if the subset contains the entire texture.
Definition at line 248 of file GrTextureEffect.cpp.
|
static |
The same as above but also takes a 'domain' that specifies any known limit on the post- matrix texture coords that will be used to sample the texture. Specifying this requires knowledge of how this effect will be nested into a paint, the local coords used with the draw, etc. It is only used to attempt to optimize away the shader subset calculations.
Definition at line 269 of file GrTextureEffect.cpp.
|
inlineoverridevirtual |
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 131 of file GrTextureEffect.h.
|
overrideprivatevirtual |
Implements GrFragmentProcessor.
Definition at line 787 of file GrTextureEffect.cpp.
|
overrideprivatevirtual |
Subclass implements this to support isEqual(). It will only be called if it is known that the two processors are of the same subclass (i.e. have the same ClassID).
Implements GrFragmentProcessor.
Definition at line 795 of file GrTextureEffect.cpp.
|
overrideprivatevirtual |
Returns a new instance of the appropriate ProgramImpl subclass for the given GrFragmentProcessor. It will emit the appropriate code and live with the cached program to setup uniform data for each draw that uses the program.
Implements GrFragmentProcessor.
Definition at line 783 of file GrTextureEffect.cpp.
|
inline |
Definition at line 133 of file GrTextureEffect.h.
|
inline |
Definition at line 135 of file GrTextureEffect.h.
|
inline |
Definition at line 137 of file GrTextureEffect.h.
|
inlinestaticconstexpr |
Definition at line 34 of file GrTextureEffect.h.
|
inlinestaticconstexpr |
Definition at line 49 of file GrTextureEffect.h.
|
inlinestaticconstexpr |
Definition at line 52 of file GrTextureEffect.h.