Flutter Engine
The Flutter Engine
Classes | Public Member Functions | List of all members
SkSVGFilterContext Class Reference

#include <SkSVGFilterContext.h>

Public Member Functions

 SkSVGFilterContext (const SkRect &filterEffectsRegion, const SkSVGObjectBoundingBoxUnits &primitiveUnits)
 
const SkRectfilterEffectsRegion () const
 
const SkRectfilterPrimitiveSubregion (const SkSVGFeInputType &) const
 
const SkSVGObjectBoundingBoxUnitsprimitiveUnits () const
 
void registerResult (const SkSVGStringType &, const sk_sp< SkImageFilter > &, const SkRect &, SkSVGColorspace)
 
void setPreviousResult (const sk_sp< SkImageFilter > &, const SkRect &, SkSVGColorspace)
 
bool previousResultIsSourceGraphic () const
 
SkSVGColorspace resolveInputColorspace (const SkSVGRenderContext &, const SkSVGFeInputType &) const
 
sk_sp< SkImageFilterresolveInput (const SkSVGRenderContext &, const SkSVGFeInputType &) const
 
sk_sp< SkImageFilterresolveInput (const SkSVGRenderContext &, const SkSVGFeInputType &, SkSVGColorspace) const
 

Detailed Description

Definition at line 21 of file SkSVGFilterContext.h.

Constructor & Destructor Documentation

◆ SkSVGFilterContext()

SkSVGFilterContext::SkSVGFilterContext ( const SkRect filterEffectsRegion,
const SkSVGObjectBoundingBoxUnits primitiveUnits 
)
inline

Definition at line 23 of file SkSVGFilterContext.h.

25 : fFilterEffectsRegion(filterEffectsRegion)
26 , fPrimitiveUnits(primitiveUnits)
27 , fPreviousResult({nullptr, filterEffectsRegion, SkSVGColorspace::kSRGB}) {}
const SkRect & filterEffectsRegion() const
const SkSVGObjectBoundingBoxUnits & primitiveUnits() const

Member Function Documentation

◆ filterEffectsRegion()

const SkRect & SkSVGFilterContext::filterEffectsRegion ( ) const
inline

Definition at line 29 of file SkSVGFilterContext.h.

29{ return fFilterEffectsRegion; }

◆ filterPrimitiveSubregion()

const SkRect & SkSVGFilterContext::filterPrimitiveSubregion ( const SkSVGFeInputType input) const

Definition at line 56 of file SkSVGFilterContext.cpp.

56 {
57 const Result* res = nullptr;
59 res = fResults.find(input.id());
60 } else if (input.type() == SkSVGFeInputType::Type::kUnspecified) {
61 res = &fPreviousResult;
62 }
63 return res ? res->fFilterSubregion : fFilterEffectsRegion;
64}
const SkString & id() const
Definition: SkSVGTypes.h:658
Type type() const
Definition: SkSVGTypes.h:663

◆ previousResultIsSourceGraphic()

bool SkSVGFilterContext::previousResultIsSourceGraphic ( ) const

Definition at line 80 of file SkSVGFilterContext.cpp.

80 {
81 return fPreviousResult.fImageFilter == nullptr;
82}

◆ primitiveUnits()

const SkSVGObjectBoundingBoxUnits & SkSVGFilterContext::primitiveUnits ( ) const
inline

Definition at line 33 of file SkSVGFilterContext.h.

33{ return fPrimitiveUnits; }

◆ registerResult()

void SkSVGFilterContext::registerResult ( const SkSVGStringType id,
const sk_sp< SkImageFilter > &  result,
const SkRect subregion,
SkSVGColorspace  resultColorspace 
)

Definition at line 66 of file SkSVGFilterContext.cpp.

69 {
70 SkASSERT(!id.isEmpty());
71 fResults[id] = {result, subregion, resultColorspace};
72}
#define SkASSERT(cond)
Definition: SkAssert.h:116
GAsyncResult * result
const uintptr_t id

◆ resolveInput() [1/2]

sk_sp< SkImageFilter > SkSVGFilterContext::resolveInput ( const SkSVGRenderContext ctx,
const SkSVGFeInputType inputType 
) const

Definition at line 145 of file SkSVGFilterContext.cpp.

146 {
147 return std::get<0>(this->getInput(ctx, inputType));
148}
const myers::Point & get< 0 >(const myers::Segment &s)
Definition: Myers.h:80

◆ resolveInput() [2/2]

sk_sp< SkImageFilter > SkSVGFilterContext::resolveInput ( const SkSVGRenderContext ctx,
const SkSVGFeInputType inputType,
SkSVGColorspace  colorspace 
) const

Definition at line 150 of file SkSVGFilterContext.cpp.

152 {
153 auto [result, inputCS] = this->getInput(ctx, inputType);
154 return ConvertFilterColorspace(std::move(result), inputCS, colorspace);
155}

◆ resolveInputColorspace()

SkSVGColorspace SkSVGFilterContext::resolveInputColorspace ( const SkSVGRenderContext ctx,
const SkSVGFeInputType inputType 
) const

Definition at line 140 of file SkSVGFilterContext.cpp.

141 {
142 return std::get<1>(this->getInput(ctx, inputType));
143}
const myers::Point & get< 1 >(const myers::Segment &s)
Definition: Myers.h:81

◆ setPreviousResult()

void SkSVGFilterContext::setPreviousResult ( const sk_sp< SkImageFilter > &  result,
const SkRect subregion,
SkSVGColorspace  resultColorspace 
)

Definition at line 74 of file SkSVGFilterContext.cpp.

76 {
77 fPreviousResult = {result, subregion, resultColorspace};
78}

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