Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | Protected Member Functions | List of all members
SkSVGFeBlend Class Reference

#include <SkSVGFeBlend.h>

Inheritance diagram for SkSVGFeBlend:
SkSVGFe SkSVGHiddenContainer SkSVGContainer SkSVGTransformableNode SkSVGNode SkRefCnt SkRefCntBase

Public Types

enum class  Mode {
  kNormal , kMultiply , kScreen , kDarken ,
  kLighten
}
 

Static Public Member Functions

static sk_sp< SkSVGFeBlendMake ()
 
- Static Public Member Functions inherited from SkSVGFe
static bool IsFilterEffect (const sk_sp< SkSVGNode > &node)
 

Protected Member Functions

sk_sp< SkImageFilteronMakeImageFilter (const SkSVGRenderContext &, const SkSVGFilterContext &) const override
 
std::vector< SkSVGFeInputTypegetInputs () const override
 
bool parseAndSetAttribute (const char *, const char *) override
 
- Protected Member Functions inherited from SkSVGFe
 SkSVGFe (SkSVGTag t)
 
- Protected Member Functions inherited from SkSVGHiddenContainer
 SkSVGHiddenContainer (SkSVGTag t)
 
void onRender (const SkSVGRenderContext &) const final
 
- Protected Member Functions inherited from SkSVGContainer
 SkSVGContainer (SkSVGTag)
 
SkPath onAsPath (const SkSVGRenderContext &) const override
 
SkRect onObjectBoundingBox (const SkSVGRenderContext &) const override
 
bool hasChildren () const final
 
- Protected Member Functions inherited from SkSVGTransformableNode
 SkSVGTransformableNode (SkSVGTag)
 
bool onPrepareToRender (SkSVGRenderContext *) const override
 
void onSetAttribute (SkSVGAttribute, const SkSVGValue &) override
 
void mapToParent (SkPath *) const
 
void mapToParent (SkRect *) const
 
- Protected Member Functions inherited from SkSVGNode
 SkSVGNode (SkSVGTag)
 
virtual bool onAsPaint (const SkSVGRenderContext &, SkPaint *) const
 

Additional Inherited Members

- Public Member Functions inherited from SkSVGFe
sk_sp< SkImageFiltermakeImageFilter (const SkSVGRenderContext &ctx, const SkSVGFilterContext &fctx) const
 
SkRect resolveFilterSubregion (const SkSVGRenderContext &, const SkSVGFilterContext &) const
 
virtual SkSVGColorspace resolveColorspace (const SkSVGRenderContext &, const SkSVGFilterContext &) const
 
void applyProperties (SkSVGRenderContext *) const
 
- Public Member Functions inherited from SkSVGContainer
void appendChild (sk_sp< SkSVGNode >) override
 
- Public Member Functions inherited from SkSVGTransformableNode
void setTransform (const SkSVGTransformType &t)
 
- Public Member Functions inherited from SkSVGNode
 ~SkSVGNode () override
 
SkSVGTag tag () const
 
void render (const SkSVGRenderContext &) const
 
bool asPaint (const SkSVGRenderContext &, SkPaint *) const
 
SkPath asPath (const SkSVGRenderContext &) const
 
SkRect objectBoundingBox (const SkSVGRenderContext &) const
 
void setAttribute (SkSVGAttribute, const SkSVGValue &)
 
bool setAttribute (const char *attributeName, const char *attributeValue)
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 
- Static Protected Member Functions inherited from SkSVGNode
static SkMatrix ComputeViewboxMatrix (const SkRect &, const SkRect &, SkSVGPreserveAspectRatio)
 
- Protected Attributes inherited from SkSVGContainer
skia_private::STArray< 1, sk_sp< SkSVGNode >, true > fChildren
 

Detailed Description

Definition at line 14 of file SkSVGFeBlend.h.

Member Enumeration Documentation

◆ Mode

enum class SkSVGFeBlend::Mode
strong
Enumerator
kNormal 
kMultiply 
kScreen 
kDarken 
kLighten 

Definition at line 16 of file SkSVGFeBlend.h.

Member Function Documentation

◆ getInputs()

std::vector< SkSVGFeInputType > SkSVGFeBlend::getInputs ( ) const
inlineoverrideprotectedvirtual

Implements SkSVGFe.

Definition at line 33 of file SkSVGFeBlend.h.

33 {
34 return {this->getIn(), this->getIn2()};
35 }

◆ Make()

static sk_sp< SkSVGFeBlend > SkSVGFeBlend::Make ( )
inlinestatic

Definition at line 24 of file SkSVGFeBlend.h.

◆ onMakeImageFilter()

sk_sp< SkImageFilter > SkSVGFeBlend::onMakeImageFilter ( const SkSVGRenderContext ctx,
const SkSVGFilterContext fctx 
) const
overrideprotectedvirtual

Implements SkSVGFe.

Definition at line 39 of file SkSVGFeBlend.cpp.

40 {
41 const SkRect cropRect = this->resolveFilterSubregion(ctx, fctx);
42 const SkBlendMode blendMode = GetBlendMode(this->getMode());
43 const SkSVGColorspace colorspace = this->resolveColorspace(ctx, fctx);
44 const sk_sp<SkImageFilter> background = fctx.resolveInput(ctx, fIn2, colorspace);
45 const sk_sp<SkImageFilter> foreground = fctx.resolveInput(ctx, this->getIn(), colorspace);
46 return SkImageFilters::Blend(blendMode, background, foreground, cropRect);
47}
SkBlendMode
Definition SkBlendMode.h:38
static SkBlendMode GetBlendMode(SkSVGFeBlend::Mode mode)
SkSVGColorspace
Definition SkSVGTypes.h:719
static sk_sp< SkImageFilter > Blend(SkBlendMode mode, sk_sp< SkImageFilter > background, sk_sp< SkImageFilter > foreground=nullptr, const CropRect &cropRect={})
SkRect resolveFilterSubregion(const SkSVGRenderContext &, const SkSVGFilterContext &) const
Definition SkSVGFe.cpp:54
virtual SkSVGColorspace resolveColorspace(const SkSVGRenderContext &, const SkSVGFilterContext &) const
Definition SkSVGFe.cpp:84
sk_sp< SkImageFilter > resolveInput(const SkSVGRenderContext &, const SkSVGFeInputType &) const

◆ parseAndSetAttribute()

bool SkSVGFeBlend::parseAndSetAttribute ( const char *  name,
const char *  value 
)
overrideprotectedvirtual

Reimplemented from SkSVGFe.

Definition at line 16 of file SkSVGFeBlend.cpp.

16 {
18 this->setIn2(SkSVGAttributeParser::parse<SkSVGFeInputType>("in2", name, value)) ||
19 this->setMode(SkSVGAttributeParser::parse<SkSVGFeBlend::Mode>("mode", name, value));
20}
bool parseAndSetAttribute(const char *, const char *) override
Definition SkSVGFe.cpp:93
const char * name
Definition fuchsia.cc:50

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