69 std::optional<skif::LayerSpace<SkIRect>>
content;
95 return combinedBounds;
124 (*filterPtr)->unref();
139 static std::atomic<int32_t> nextID{1};
143 id = nextID.fetch_add(1, std::memory_order_relaxed);
150 std::optional<bool> usesSrc)
151 : fUsesSrcInput(usesSrc.has_value() ? *usesSrc :
false)
153 fInputs.
reset(inputCount);
155 for (
int i = 0;
i < inputCount; ++
i) {
157 fUsesSrcInput =
true;
167std::pair<sk_sp<SkImageFilter>, std::optional<SkRect>>
171 return {
nullptr, std::nullopt};
182 if (!
buffer.validate(expectedCount < 0 ||
count == expectedCount)) {
186#if defined(SK_BUILD_FOR_FUZZER)
201 static constexpr uint32_t kHasAll_CropEdge = 0x0F;
213 if (
flags == kHasAll_CropEdge) {
222 for (
int i = 0;
i < fInputs.
count();
i++) {
225 if (input !=
nullptr) {
226 buffer.writeFlattenable(input);
243 const bool srcInKey = fUsesSrcInput && context.
source();
250 srcGenID, srcSubset);
271 if (!outSubset || !
offset || !
src->bounds().contains(subset)) {
275 auto srcSpecialImage =
backend->makeImage(subset,
src);
276 if (!srcSpecialImage) {
286 src->imageInfo().colorSpace(),
298 *outSubset =
result->subset();
311 std::optional<skif::LayerSpace<SkIRect>> contentBounds;
312 if (knownContentBounds) {
313 contentBounds = mapping.
paramToLayer(*knownContentBounds).roundOut();
326 std::optional<skif::LayerSpace<SkIRect>> filterOutput =
363 if (contentBounds && !visibleContent.
intersect(*contentBounds)) {
367 return visibleContent;
388void SkImageFilter_Base::PurgeCache() {
static SkColorFilterBase * as_CFB(SkColorFilter *filter)
static int32_t next_image_filter_unique_id()
static SkImageFilter_Base * as_IFB(SkImageFilter *filter)
static constexpr uint32_t SK_InvalidUniqueID
static bool SkIsValidRect(const SkRect &rect)
bool affectsTransparentBlack() const
virtual bool get(const SkImageFilterCacheKey &key, skif::FilterResult *result) const =0
virtual void set(const SkImageFilterCacheKey &key, const SkImageFilter *filter, const skif::FilterResult &result)=0
static sk_sp< SkImageFilterCache > Get(CreateIfNecessary=CreateIfNecessary::kYes)
virtual void purgeByImageFilter(const SkImageFilter *)=0
bool unflatten(SkReadBuffer &, int expectedInputs)
virtual bool onIsColorFilterNode(SkColorFilter **) const
~SkImageFilter_Base() override
virtual skif::LayerSpace< SkIRect > onGetInputLayerBounds(const skif::Mapping &mapping, const skif::LayerSpace< SkIRect > &desiredOutput, std::optional< skif::LayerSpace< SkIRect > > contentBounds) const =0
std::optional< skif::DeviceSpace< SkIRect > > getOutputBounds(const skif::Mapping &mapping, const skif::ParameterSpace< SkRect > &contentBounds) const
virtual bool onAffectsTransparentBlack() const
skif::LayerSpace< SkIRect > getChildInputLayerBounds(int index, const skif::Mapping &mapping, const skif::LayerSpace< SkIRect > &desiredOutput, std::optional< skif::LayerSpace< SkIRect > > contentBounds) const
void flatten(SkWriteBuffer &) const override
virtual bool ignoreInputsAffectsTransparentBlack() const
virtual std::optional< skif::LayerSpace< SkIRect > > onGetOutputLayerBounds(const skif::Mapping &mapping, std::optional< skif::LayerSpace< SkIRect > > contentBounds) const =0
virtual skif::FilterResult onFilterImage(const skif::Context &context) const =0
skif::LayerSpace< SkIRect > getInputBounds(const skif::Mapping &mapping, const skif::DeviceSpace< SkIRect > &desiredOutput, std::optional< skif::ParameterSpace< SkRect > > knownContentBounds) const
skif::FilterResult getChildOutput(int index, const skif::Context &ctx) const
sk_sp< SkImage > makeImageWithFilter(sk_sp< skif::Backend > backend, sk_sp< SkImage > src, const SkIRect &subset, const SkIRect &clipBounds, SkIRect *outSubset, SkIPoint *offset) const
skif::FilterResult filterImage(const skif::Context &context) const
bool affectsTransparentBlack() const
std::optional< skif::LayerSpace< SkIRect > > getChildOutputLayerBounds(int index, const skif::Mapping &mapping, std::optional< skif::LayerSpace< SkIRect > > contentBounds) const
MatrixCapability getCTMCapability() const
static std::pair< sk_sp< SkImageFilter >, std::optional< SkRect > > Unflatten(SkReadBuffer &buffer)
virtual MatrixCapability onGetCTMCapability() const
friend class SkImageFilter_Base
sk_sp< SkImageFilter > refMe() const
SkIRect filterBounds(const SkIRect &src, const SkMatrix &ctm, MapDirection, const SkIRect *inputRect=nullptr) const
bool asAColorFilter(SkColorFilter **filterPtr) const
bool isColorFilterNode(SkColorFilter **filterPtr) const
virtual SkRect computeFastBounds(const SkRect &bounds) const
const SkImageFilter * getInput(int i) const
bool canComputeFastBounds() const
sk_sp< SkImageFilter > makeWithLocalMatrix(const SkMatrix &matrix) const
static sk_sp< SkImageFilter > Make(const SkMatrix &localMatrix, sk_sp< SkImageFilter > input)
static const SkMatrix & I()
@ kRemoveDeprecatedCropRect
static SkIRect MakeILarge()
uint32_t uniqueID() const
const SkIRect & subset() const
virtual void writeBool(bool value)=0
SkImageFilterCache * cache() const
void markCacheHit() const
const Backend * backend() const
const LayerSpace< SkIRect > & desiredOutput() const
const FilterResult & source() const
const Mapping & mapping() const
void markVisitedImageFilter() const
sk_sp< SkSpecialImage > imageAndOffset(const Context &ctx, SkIPoint *offset) const
const SkSpecialImage * image() const
bool intersect(const LayerSpace< SkIRect > &r)
LayerSpace< SkIRect > roundOut() const
const SkMatrix & deviceToLayer() const
const SkMatrix & layerToDevice() const
const SkMatrix & layerMatrix() const
LayerSpace< T > paramToLayer(const ParameterSpace< T > ¶mGeometry) const
FlutterSemanticsFlag flags
static float min(float r, float g, float b)
union flutter::testing::@2836::KeyboardChange::@76 content
unsigned useCenter Optional< SkMatrix > matrix
sk_sp< SkBlender > blender SkRect rect
SK_API sk_sp< SkShader > Empty()
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 Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails trace Trace early application lifecycle Automatically switches to an endless trace buffer trace skia Filters out all Skia trace event categories except those that are specified in this comma separated list dump skp on shader Automatically dump the skp that triggers new shader compilations This is useful for writing custom ShaderWarmUp to reduce jank By this is not enabled to reduce the overhead purge persistent cache
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
static constexpr SkIRect MakeWH(int32_t w, int32_t h)
constexpr SkIPoint topLeft() const
static constexpr SkIRect MakeXYWH(int32_t x, int32_t y, int32_t w, int32_t h)
bool contains(int32_t x, int32_t y) const
void join(const SkRect &r)