Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
flutter::DlMatrixImageFilter Class Referencefinal

#include <dl_image_filter.h>

Inheritance diagram for flutter::DlMatrixImageFilter:
flutter::DlImageFilter flutter::DlAttribute< DlImageFilter, DlImageFilterType >

Public Member Functions

 DlMatrixImageFilter (const SkMatrix &matrix, DlImageSampling sampling)
 
 DlMatrixImageFilter (const DlMatrixImageFilter *filter)
 
 DlMatrixImageFilter (const DlMatrixImageFilter &filter)
 
std::shared_ptr< DlImageFiltershared () const override
 
DlImageFilterType type () const override
 
size_t size () const override
 
const SkMatrixmatrix () const
 
DlImageSampling sampling () const
 
const DlMatrixImageFilterasMatrix () const override
 
bool modifies_transparent_black () const override
 
SkRectmap_local_bounds (const SkRect &input_bounds, SkRect &output_bounds) const override
 
SkIRectmap_device_bounds (const SkIRect &input_bounds, const SkMatrix &ctm, SkIRect &output_bounds) const override
 
SkIRectget_input_device_bounds (const SkIRect &output_bounds, const SkMatrix &ctm, SkIRect &input_bounds) const override
 
- Public Member Functions inherited from flutter::DlImageFilter
virtual const DlBlurImageFilterasBlur () const
 
virtual const DlDilateImageFilterasDilate () const
 
virtual const DlErodeImageFilterasErode () const
 
virtual const DlMatrixImageFilterasMatrix () const
 
virtual const DlLocalMatrixImageFilterasLocalMatrix () const
 
virtual std::shared_ptr< DlImageFiltermakeWithLocalMatrix (const SkMatrix &matrix) const
 
virtual const DlComposeImageFilterasCompose () const
 
virtual const DlColorFilterImageFilterasColorFilter () const
 
virtual bool modifies_transparent_black () const =0
 
virtual SkRectmap_local_bounds (const SkRect &input_bounds, SkRect &output_bounds) const =0
 
virtual SkIRectmap_device_bounds (const SkIRect &input_bounds, const SkMatrix &ctm, SkIRect &output_bounds) const =0
 
virtual SkIRectget_input_device_bounds (const SkIRect &output_bounds, const SkMatrix &ctm, SkIRect &input_bounds) const =0
 
virtual MatrixCapability matrix_capability () const
 
- Public Member Functions inherited from flutter::DlAttribute< DlImageFilter, DlImageFilterType >
virtual DlImageFilterType type () const=0
 
virtual size_t size () const=0
 
virtual std::shared_ptr< DlImageFiltershared () const=0
 
bool operator== (DlImageFilter const &other) const
 
bool operator!= (DlImageFilter const &other) const
 
virtual ~DlAttribute ()=default
 

Static Public Member Functions

static std::shared_ptr< DlImageFilterMake (const SkMatrix &matrix, DlImageSampling sampling)
 

Protected Member Functions

bool equals_ (const DlImageFilter &other) const override
 
virtual bool equals_ (DlImageFilter const &other) const=0
 

Additional Inherited Members

- Public Types inherited from flutter::DlImageFilter
enum class  MatrixCapability { kTranslate , kScaleTranslate , kComplex }
 
- Static Protected Member Functions inherited from flutter::DlImageFilter
static SkVector map_vectors_affine (const SkMatrix &ctm, SkScalar x, SkScalar y)
 
static SkIRectinset_device_bounds (const SkIRect &input_bounds, SkScalar radius_x, SkScalar radius_y, const SkMatrix &ctm, SkIRect &output_bounds)
 
static SkIRectoutset_device_bounds (const SkIRect &input_bounds, SkScalar radius_x, SkScalar radius_y, const SkMatrix &ctm, SkIRect &output_bounds)
 

Detailed Description

Definition at line 422 of file dl_image_filter.h.

Constructor & Destructor Documentation

◆ DlMatrixImageFilter() [1/3]

flutter::DlMatrixImageFilter::DlMatrixImageFilter ( const SkMatrix matrix,
DlImageSampling  sampling 
)
inline

Definition at line 424 of file dl_image_filter.h.

425 : matrix_(matrix), sampling_(sampling) {}
const SkMatrix & matrix() const
DlImageSampling sampling() const

◆ DlMatrixImageFilter() [2/3]

flutter::DlMatrixImageFilter::DlMatrixImageFilter ( const DlMatrixImageFilter filter)
inlineexplicit

Definition at line 426 of file dl_image_filter.h.

427 : DlMatrixImageFilter(filter->matrix_, filter->sampling_) {}
DlMatrixImageFilter(const SkMatrix &matrix, DlImageSampling sampling)

◆ DlMatrixImageFilter() [3/3]

flutter::DlMatrixImageFilter::DlMatrixImageFilter ( const DlMatrixImageFilter filter)
inline

Definition at line 428 of file dl_image_filter.h.

429 : DlMatrixImageFilter(&filter) {}

Member Function Documentation

◆ asMatrix()

const DlMatrixImageFilter * flutter::DlMatrixImageFilter::asMatrix ( ) const
inlineoverridevirtual

Reimplemented from flutter::DlImageFilter.

Definition at line 449 of file dl_image_filter.h.

449{ return this; }

◆ equals_()

bool flutter::DlMatrixImageFilter::equals_ ( const DlImageFilter other) const
inlineoverrideprotectedvirtual

Implements flutter::DlAttribute< DlImageFilter, DlImageFilterType >.

Definition at line 493 of file dl_image_filter.h.

493 {
494 FML_DCHECK(other.type() == DlImageFilterType::kMatrix);
495 auto that = static_cast<const DlMatrixImageFilter*>(&other);
496 return (matrix_ == that->matrix_ && sampling_ == that->sampling_);
497 }
#define FML_DCHECK(condition)
Definition: logging.h:103

◆ get_input_device_bounds()

SkIRect * flutter::DlMatrixImageFilter::get_input_device_bounds ( const SkIRect output_bounds,
const SkMatrix ctm,
SkIRect input_bounds 
) const
inlineoverridevirtual

Implements flutter::DlImageFilter.

Definition at line 475 of file dl_image_filter.h.

477 {
478 SkMatrix matrix = SkMatrix::Concat(ctm, matrix_);
479 SkMatrix inverse;
480 if (!matrix.invert(&inverse)) {
481 input_bounds = output_bounds;
482 return nullptr;
483 }
484 inverse.postConcat(ctm);
486 bounds.set(output_bounds);
487 inverse.mapRect(&bounds);
488 input_bounds = bounds.roundOut();
489 return &input_bounds;
490 }
SkMatrix & postConcat(const SkMatrix &other)
Definition: SkMatrix.cpp:683
static SkMatrix Concat(const SkMatrix &a, const SkMatrix &b)
Definition: SkMatrix.h:1775
bool invert(SkMatrix *inverse) const
Definition: SkMatrix.h:1206
bool mapRect(SkRect *dst, const SkRect &src, SkApplyPerspectiveClip pc=SkApplyPerspectiveClip::kYes) const
Definition: SkMatrix.cpp:1141
Optional< SkRect > bounds
Definition: SkRecords.h:189

◆ Make()

static std::shared_ptr< DlImageFilter > flutter::DlMatrixImageFilter::Make ( const SkMatrix matrix,
DlImageSampling  sampling 
)
inlinestatic

Definition at line 431 of file dl_image_filter.h.

432 {
433 if (matrix.isFinite() && !matrix.isIdentity()) {
434 return std::make_shared<DlMatrixImageFilter>(matrix, sampling);
435 }
436 return nullptr;
437 }
bool isFinite() const
Definition: SkMatrix.h:1834
bool isIdentity() const
Definition: SkMatrix.h:223

◆ map_device_bounds()

SkIRect * flutter::DlMatrixImageFilter::map_device_bounds ( const SkIRect input_bounds,
const SkMatrix ctm,
SkIRect output_bounds 
) const
inlineoverridevirtual

Implements flutter::DlImageFilter.

Definition at line 459 of file dl_image_filter.h.

461 {
463 if (!ctm.invert(&matrix)) {
464 output_bounds = input_bounds;
465 return nullptr;
466 }
467 matrix.postConcat(matrix_);
468 matrix.postConcat(ctm);
469 SkRect device_rect;
470 matrix.mapRect(&device_rect, SkRect::Make(input_bounds));
471 output_bounds = device_rect.roundOut();
472 return &output_bounds;
473 }
static SkRect Make(const SkISize &size)
Definition: SkRect.h:669
void roundOut(SkIRect *dst) const
Definition: SkRect.h:1241

◆ map_local_bounds()

SkRect * flutter::DlMatrixImageFilter::map_local_bounds ( const SkRect input_bounds,
SkRect output_bounds 
) const
inlineoverridevirtual

Implements flutter::DlImageFilter.

Definition at line 453 of file dl_image_filter.h.

454 {
455 output_bounds = matrix_.mapRect(input_bounds);
456 return &output_bounds;
457 }

◆ matrix()

const SkMatrix & flutter::DlMatrixImageFilter::matrix ( ) const
inline

Definition at line 446 of file dl_image_filter.h.

446{ return matrix_; }

◆ modifies_transparent_black()

bool flutter::DlMatrixImageFilter::modifies_transparent_black ( ) const
inlineoverridevirtual

Implements flutter::DlImageFilter.

Definition at line 451 of file dl_image_filter.h.

451{ return false; }

◆ sampling()

DlImageSampling flutter::DlMatrixImageFilter::sampling ( ) const
inline

Definition at line 447 of file dl_image_filter.h.

447{ return sampling_; }

◆ shared()

std::shared_ptr< DlImageFilter > flutter::DlMatrixImageFilter::shared ( ) const
inlineoverridevirtual

Implements flutter::DlAttribute< DlImageFilter, DlImageFilterType >.

Definition at line 439 of file dl_image_filter.h.

439 {
440 return std::make_shared<DlMatrixImageFilter>(this);
441 }

◆ size()

size_t flutter::DlMatrixImageFilter::size ( ) const
inlineoverridevirtual

Implements flutter::DlAttribute< DlImageFilter, DlImageFilterType >.

Definition at line 444 of file dl_image_filter.h.

444{ return sizeof(*this); }

◆ type()

DlImageFilterType flutter::DlMatrixImageFilter::type ( ) const
inlineoverridevirtual

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