Flutter Engine
The Flutter Engine
SkSVGFilterContext.h
Go to the documentation of this file.
1/*
2 * Copyright 2020 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef SkSVGFilterContext_DEFINED
9#define SkSVGFilterContext_DEFINED
10
11#include "include/core/SkRect.h"
15#include "src/core/SkTHash.h"
16
17class SkImageFilter;
20
22public:
25 : fFilterEffectsRegion(filterEffectsRegion)
26 , fPrimitiveUnits(primitiveUnits)
27 , fPreviousResult({nullptr, filterEffectsRegion, SkSVGColorspace::kSRGB}) {}
28
29 const SkRect& filterEffectsRegion() const { return fFilterEffectsRegion; }
30
32
33 const SkSVGObjectBoundingBoxUnits& primitiveUnits() const { return fPrimitiveUnits; }
34
36
38
40
42 const SkSVGFeInputType&) const;
43
45
47
48private:
49 struct Result {
50 sk_sp<SkImageFilter> fImageFilter;
51 SkRect fFilterSubregion;
52 SkSVGColorspace fColorspace;
53 };
54
55 const Result* findResultById(const SkSVGStringType&) const;
56
57 std::tuple<sk_sp<SkImageFilter>, SkSVGColorspace> getInput(const SkSVGRenderContext&,
58 const SkSVGFeInputType&) const;
59
60 SkRect fFilterEffectsRegion;
61
62 SkSVGObjectBoundingBoxUnits fPrimitiveUnits;
63
65
66 Result fPreviousResult;
67};
68
69#endif // SkSVGFilterContext_DEFINED
SkSVGColorspace
Definition: SkSVGTypes.h:719
SkSVGColorspace resolveInputColorspace(const SkSVGRenderContext &, const SkSVGFeInputType &) const
const SkRect & filterEffectsRegion() const
void registerResult(const SkSVGStringType &, const sk_sp< SkImageFilter > &, const SkRect &, SkSVGColorspace)
SkSVGFilterContext(const SkRect &filterEffectsRegion, const SkSVGObjectBoundingBoxUnits &primitiveUnits)
sk_sp< SkImageFilter > resolveInput(const SkSVGRenderContext &, const SkSVGFeInputType &) const
void setPreviousResult(const sk_sp< SkImageFilter > &, const SkRect &, SkSVGColorspace)
bool previousResultIsSourceGraphic() const
const SkSVGObjectBoundingBoxUnits & primitiveUnits() const
const SkRect & filterPrimitiveSubregion(const SkSVGFeInputType &) const