Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
ImageFilterDAGSlide Class Reference
Inheritance diagram for ImageFilterDAGSlide:
Slide SkRefCnt SkRefCntBase

Public Member Functions

 ImageFilterDAGSlide ()
 
void draw (SkCanvas *canvas) override
 
SkISize getDimensions () const override
 
- Public Member Functions inherited from Slide
virtual SkISize getDimensions () const
 
virtual void gpuTeardown ()
 
virtual void draw (SkCanvas *canvas)=0
 
virtual bool animate (double nanos)
 
virtual void load (SkScalar winWidth, SkScalar winHeight)
 
virtual void resize (SkScalar winWidth, SkScalar winHeight)
 
virtual void unload ()
 
virtual bool onChar (SkUnichar c)
 
virtual bool onMouse (SkScalar x, SkScalar y, skui::InputState state, skui::ModifierKey modifiers)
 
virtual bool onGetControls (SkMetaData *)
 
virtual void onSetControls (const SkMetaData &)
 
const SkStringgetName ()
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Additional Inherited Members

- Protected Attributes inherited from Slide
SkString fName
 

Detailed Description

Definition at line 314 of file ImageFilterDAGSlide.cpp.

Constructor & Destructor Documentation

◆ ImageFilterDAGSlide()

ImageFilterDAGSlide::ImageFilterDAGSlide ( )
inline

Definition at line 316 of file ImageFilterDAGSlide.cpp.

316{ fName = "ImageFilterDAG"; }
SkString fName
Definition: Slide.h:54

Member Function Documentation

◆ draw()

void ImageFilterDAGSlide::draw ( SkCanvas canvas)
inlineoverridevirtual

Implements Slide.

Definition at line 318 of file ImageFilterDAGSlide.cpp.

318 {
319 // Make a large DAG
320 // /--- Color Filter <---- Blur <--- Offset
321 // Merge <
322 // \--- Blur <--- Drop Shadow
324 10.f, 5.f, 3.f, 3.f, SK_ColorBLACK, nullptr);
325 sk_sp<SkImageFilter> blur1 = SkImageFilters::Blur(2.f, 2.f, std::move(drop2));
326
327 sk_sp<SkImageFilter> offset3 = SkImageFilters::Offset(-5.f, -5.f, nullptr);
328 sk_sp<SkImageFilter> blur2 = SkImageFilters::Blur(4.f, 4.f, std::move(offset3));
331
332 sk_sp<SkImageFilter> merge0 = SkImageFilters::Merge(std::move(blur1), std::move(cf1));
333
334 draw_dag(canvas, merge0.get(), kFilterRect, kFilterSurfaceSize);
335 }
static float draw_dag(SkCanvas *canvas, SkSurface *nodeSurface, const FilterNode &node)
@ kModulate
r = s*d
constexpr SkColor SK_ColorGRAY
Definition: SkColor.h:113
constexpr SkColor SK_ColorBLACK
Definition: SkColor.h:103
static sk_sp< SkColorFilter > Blend(const SkColor4f &c, sk_sp< SkColorSpace >, SkBlendMode mode)
static sk_sp< SkImageFilter > ColorFilter(sk_sp< SkColorFilter > cf, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > DropShadow(SkScalar dx, SkScalar dy, SkScalar sigmaX, SkScalar sigmaY, SkColor color, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Merge(sk_sp< SkImageFilter > *const filters, int count, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Blur(SkScalar sigmaX, SkScalar sigmaY, SkTileMode tileMode, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Offset(SkScalar dx, SkScalar dy, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
T * get() const
Definition: SkRefCnt.h:303

◆ getDimensions()

SkISize ImageFilterDAGSlide::getDimensions ( ) const
inlineoverridevirtual

A slide may have a content dimensions that is independent of the current window size. An empty size indicates that the Slide's dimensions are equal to the window's dimensions.

Reimplemented from Slide.

Definition at line 339 of file ImageFilterDAGSlide.cpp.

339{ return kFilterSurfaceSize; }

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