51 friend void ::SkRegisterMatrixTransformImageFilterFlattenable();
55 MatrixCapability onGetCTMCapability()
const override {
return MatrixCapability::kComplex; }
64 std::optional<skif::LayerSpace<SkIRect>> onGetOutputLayerBounds(
107 SkMatrixTransformImageFilter::LegacyOffsetCreateProc);
109 SkMatrixTransformImageFilter::LegacyOffsetCreateProc);
122 buffer.readMatrix(&matrix);
128 return buffer.readSampling();
137 buffer.writeSampling(fSampling);
152SkRect SkMatrixTransformImageFilter::computeFastBounds(
const SkRect& src)
const {
153 SkRect bounds = this->getInput(0) ? this->getInput(0)->computeFastBounds(src) :
src;
154 return static_cast<const SkMatrix&
>(fTransform).mapRect(bounds);
163 if (!mapping.
paramToLayer(fTransform).inverseMapRect(desiredOutput, &requiredInput)) {
172 return requiredInput;
182 return this->getChildInputLayerBounds(0, mapping, requiredInput, contentBounds);
185std::optional<skif::LayerSpace<SkIRect>> SkMatrixTransformImageFilter::onGetOutputLayerBounds(
189 auto childOutput = this->getChildOutputLayerBounds(0, mapping, contentBounds);
191 return mapping.
paramToLayer(fTransform).mapRect(*childOutput);
#define SK_FLATTENABLE_HOOKS(type)
#define SK_REGISTER_FLATTENABLE(type)
#define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount)
static void Register(const char name[], Factory)
void flatten(SkWriteBuffer &) const override
static sk_sp< SkImageFilter > MatrixTransform(const SkMatrix &matrix, const SkSamplingOptions &sampling, sk_sp< SkImageFilter > input)
static sk_sp< SkImageFilter > Crop(const SkRect &rect, SkTileMode tileMode, sk_sp< SkImageFilter > input)
static sk_sp< SkImageFilter > Offset(SkScalar dx, SkScalar dy, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static SkMatrix Translate(SkScalar dx, SkScalar dy)
@ kMatrixImageFilterSampling_Version
static SkSamplingOptions FromFQ(SkLegacyFQ fq, SkMediumAs behavior=kNearest_SkMediumAs)
const LayerSpace< SkIRect > & desiredOutput() const
Context withNewDesiredOutput(const LayerSpace< SkIRect > &desiredOutput) const
const Mapping & mapping() const
FilterResult applyTransform(const Context &ctx, const LayerSpace< SkMatrix > &transform, const SkSamplingOptions &sampling) const
LayerSpace< T > paramToLayer(const ParameterSpace< T > ¶mGeometry) const
static const uint8_t buffer[]
unsigned useCenter Optional< SkMatrix > matrix
Optional< SkRect > bounds
SkSamplingOptions sampling
static SkColor4f transform(SkColor4f c, SkColorSpace *src, SkColorSpace *dst)