Flutter Engine
The Flutter Engine
Public Member Functions | Protected Member Functions | List of all members
SkRuntimeImageFilter Class Referencefinal
Inheritance diagram for SkRuntimeImageFilter:
SkImageFilter_Base SkImageFilter SkFlattenable SkRefCnt SkRefCntBase

Public Member Functions

 SkRuntimeImageFilter (const SkRuntimeShaderBuilder &builder, float maxSampleRadius, std::string_view childShaderNames[], const sk_sp< SkImageFilter > inputs[], int inputCount)
 
SkRect computeFastBounds (const SkRect &src) const override
 
- Public Member Functions inherited from SkImageFilter_Base
skif::FilterResult filterImage (const skif::Context &context) const
 
sk_sp< SkImagemakeImageWithFilter (sk_sp< skif::Backend > backend, sk_sp< SkImage > src, const SkIRect &subset, const SkIRect &clipBounds, SkIRect *outSubset, SkIPoint *offset) const
 
skif::LayerSpace< SkIRectgetInputBounds (const skif::Mapping &mapping, const skif::DeviceSpace< SkIRect > &desiredOutput, std::optional< skif::ParameterSpace< SkRect > > knownContentBounds) const
 
std::optional< skif::DeviceSpace< SkIRect > > getOutputBounds (const skif::Mapping &mapping, const skif::ParameterSpace< SkRect > &contentBounds) const
 
bool affectsTransparentBlack () const
 
bool usesSource () const
 
MatrixCapability getCTMCapability () const
 
uint32_t uniqueID () const
 
SkFlattenable::Type getFlattenableType () const override
 
- Public Member Functions inherited from SkImageFilter
SkIRect filterBounds (const SkIRect &src, const SkMatrix &ctm, MapDirection, const SkIRect *inputRect=nullptr) const
 
bool isColorFilterNode (SkColorFilter **filterPtr) const
 
bool asColorFilter (SkColorFilter **filterPtr) const
 
bool asAColorFilter (SkColorFilter **filterPtr) const
 
int countInputs () const
 
const SkImageFiltergetInput (int i) const
 
virtual SkRect computeFastBounds (const SkRect &bounds) const
 
bool canComputeFastBounds () const
 
sk_sp< SkImageFiltermakeWithLocalMatrix (const SkMatrix &matrix) const
 
- Public Member Functions inherited from SkFlattenable
 SkFlattenable ()
 
virtual Factory getFactory () const =0
 
virtual const char * getTypeName () const =0
 
virtual void flatten (SkWriteBuffer &) const
 
virtual Type getFlattenableType () const =0
 
sk_sp< SkDataserialize (const SkSerialProcs *=nullptr) const
 
size_t serialize (void *memory, size_t memory_size, const SkSerialProcs *=nullptr) const
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Protected Member Functions

void flatten (SkWriteBuffer &) const override
 
- Protected Member Functions inherited from SkImageFilter_Base
 SkImageFilter_Base (sk_sp< SkImageFilter > const *inputs, int inputCount, std::optional< bool > usesSrc={})
 
 ~SkImageFilter_Base () override
 
void flatten (SkWriteBuffer &) const override
 
skif::LayerSpace< SkIRectgetChildInputLayerBounds (int index, const skif::Mapping &mapping, const skif::LayerSpace< SkIRect > &desiredOutput, std::optional< skif::LayerSpace< SkIRect > > contentBounds) const
 
std::optional< skif::LayerSpace< SkIRect > > getChildOutputLayerBounds (int index, const skif::Mapping &mapping, std::optional< skif::LayerSpace< SkIRect > > contentBounds) const
 
skif::FilterResult getChildOutput (int index, const skif::Context &ctx) const
 
- Protected Member Functions inherited from SkImageFilter
sk_sp< SkImageFilterrefMe () const
 

Additional Inherited Members

- Public Types inherited from SkImageFilter_Base
using MatrixCapability = skif::MatrixCapability
 
- Public Types inherited from SkImageFilter
enum  MapDirection { kForward_MapDirection , kReverse_MapDirection }
 
- Public Types inherited from SkFlattenable
enum  Type {
  kSkColorFilter_Type , kSkBlender_Type , kSkDrawable_Type , kSkDrawLooper_Type ,
  kSkImageFilter_Type , kSkMaskFilter_Type , kSkPathEffect_Type , kSkShader_Type
}
 
typedef sk_sp< SkFlattenable >(* Factory) (SkReadBuffer &)
 
- Static Public Member Functions inherited from SkImageFilter_Base
static SkFlattenable::Type GetFlattenableType ()
 
static std::pair< sk_sp< SkImageFilter >, std::optional< SkRect > > Unflatten (SkReadBuffer &buffer)
 
- Static Public Member Functions inherited from SkImageFilter
static sk_sp< SkImageFilterDeserialize (const void *data, size_t size, const SkDeserialProcs *procs=nullptr)
 
- Static Public Member Functions inherited from SkFlattenable
static Factory NameToFactory (const char name[])
 
static const char * FactoryToName (Factory)
 
static void Register (const char name[], Factory)
 
static sk_sp< SkFlattenableDeserialize (Type, const void *data, size_t length, const SkDeserialProcs *procs=nullptr)
 

Detailed Description

Definition at line 41 of file SkRuntimeImageFilter.cpp.

Constructor & Destructor Documentation

◆ SkRuntimeImageFilter()

SkRuntimeImageFilter::SkRuntimeImageFilter ( const SkRuntimeShaderBuilder builder,
float  maxSampleRadius,
std::string_view  childShaderNames[],
const sk_sp< SkImageFilter inputs[],
int  inputCount 
)
inline

Definition at line 43 of file SkRuntimeImageFilter.cpp.

48 : SkImageFilter_Base(inputs, inputCount)
49 , fRuntimeEffectBuilder(builder)
50 , fMaxSampleRadius(maxSampleRadius) {
51 SkASSERT(maxSampleRadius >= 0.f);
52 fChildShaderNames.reserve_exact(inputCount);
53 for (int i = 0; i < inputCount; i++) {
54 fChildShaderNames.push_back(SkString(childShaderNames[i]));
55 }
56 }
#define SkASSERT(cond)
Definition: SkAssert.h:116
friend class SkImageFilter_Base
void reserve_exact(int n)
Definition: SkTArray.h:181

Member Function Documentation

◆ computeFastBounds()

SkRect SkRuntimeImageFilter::computeFastBounds ( const SkRect src) const
overridevirtual

Reimplemented from SkImageFilter.

Definition at line 300 of file SkRuntimeImageFilter.cpp.

300 {
301 // Can't predict what the RT Shader will generate (see onGetOutputLayerBounds)
303}
static SkRect MakeLargeS32()
Definition: SkRectPriv.h:33

◆ flatten()

void SkRuntimeImageFilter::flatten ( SkWriteBuffer ) const
overrideprotectedvirtual

Override this if your subclass needs to record data that it will need to recreate itself from its CreateProc (returned by getFactory()).

DEPRECATED public : will move to protected ... use serialize() instead

Reimplemented from SkImageFilter_Base.

Definition at line 217 of file SkRuntimeImageFilter.cpp.

217 {
219 fRuntimeEffectLock.acquire();
220 buffer.writeString(fRuntimeEffectBuilder.effect()->source().c_str());
221 buffer.writeDataAsByteArray(fRuntimeEffectBuilder.uniforms().get());
222 for (const SkString& name : fChildShaderNames) {
223 buffer.writeString(name.c_str());
224 }
225 for (size_t x = 0; x < fRuntimeEffectBuilder.children().size(); x++) {
226 buffer.writeFlattenable(fRuntimeEffectBuilder.children()[x].flattenable());
227 }
228 fRuntimeEffectLock.release();
229
230 buffer.writeScalar(fMaxSampleRadius);
231}
void flatten(SkWriteBuffer &) const override
sk_sp< const SkData > uniforms() const
const SkRuntimeEffect * effect() const
SkSpan< const SkRuntimeEffect::ChildPtr > children() const
const std::string & source() const
T * get() const
Definition: SkRefCnt.h:303
double x
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
Definition: switches.h:126
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259

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