36 , fTileMode(tileMode) {
47 friend void ::SkRegisterCropImageFilterFlattenable();
90 return this->cropRect(mapping).relevantSubset(outputBounds, fTileMode);
157 buffer.writeInt(
static_cast<int32_t
>(fTileMode));
170 return childOutput.
applyCrop(context, this->cropRect(context.
mapping()), fTileMode);
189 return this->getChildInputLayerBounds(0, mapping, requiredInput, contentBounds);
192std::optional<skif::LayerSpace<SkIRect>> SkCropImageFilter::onGetOutputLayerBounds(
198 auto childOutput = this->getChildOutputLayerBounds(0, mapping, contentBounds);
201 if (childOutput && !crop.intersect(*childOutput)) {
216SkRect SkCropImageFilter::computeFastBounds(
const SkRect& bounds)
const {
222 SkRect inputBounds = this->getInput(0) ? this->getInput(0)->computeFastBounds(bounds) :
bounds;
void SkRegisterCropImageFilterFlattenable()
#define SK_FLATTENABLE_HOOKS(type)
#define SK_REGISTER_FLATTENABLE(type)
#define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount)
static bool SkIsValidRect(const SkRect &rect)
static void Register(const char name[], Factory)
virtual skif::LayerSpace< SkIRect > onGetInputLayerBounds(const skif::Mapping &mapping, const skif::LayerSpace< SkIRect > &desiredOutput, std::optional< skif::LayerSpace< SkIRect > > contentBounds) const =0
virtual bool onAffectsTransparentBlack() 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
virtual SkRect computeFastBounds(const SkRect &bounds) const
static sk_sp< SkImageFilter > Empty()
static sk_sp< SkImageFilter > Crop(const SkRect &rect, SkTileMode tileMode, sk_sp< SkImageFilter > input)
static sk_sp< SkImageFilter > Tile(const SkRect &src, const SkRect &dst, sk_sp< SkImageFilter > input)
@ kCropImageFilterSupportsTiling
static SkRect MakeLargeS32()
const LayerSpace< SkIRect > & desiredOutput() const
Context withNewDesiredOutput(const LayerSpace< SkIRect > &desiredOutput) const
const Mapping & mapping() const
FilterResult applyCrop(const Context &ctx, const LayerSpace< SkIRect > &crop, SkTileMode tileMode=SkTileMode::kDecal) const
LayerSpace< T > paramToLayer(const ParameterSpace< T > ¶mGeometry) const
static const uint8_t buffer[]
Optional< SkRect > bounds
static constexpr SkRect MakeEmpty()
bool intersect(const SkRect &r)