df208a341b
Added: - SkSVGFilter: This corresponds to a <filter> element. Also added some of the attributes of this element. - SkSVGFe: This will be the base class of all <fe*> elements. - SkSVGFilterContext: This will hold the contextual mapping of string id -> image filter result, for constructing pipelines. Bug: skia:10841 Change-Id: I15a29d39411a6255ab4e11f022baa10554b2bce6 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330618 Commit-Queue: Tyler Denniston <tdenniston@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
36 lines
930 B
C++
36 lines
930 B
C++
/*
|
|
* Copyright 2020 Google Inc.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
|
|
#ifndef SkSVGFe_DEFINED
|
|
#define SkSVGFe_DEFINED
|
|
|
|
#include "modules/svg/include/SkSVGHiddenContainer.h"
|
|
|
|
class SkImageFilter;
|
|
class SkSVGFilterContext;
|
|
|
|
class SkSVGFe : public SkSVGHiddenContainer {
|
|
public:
|
|
~SkSVGFe() override = default;
|
|
|
|
static bool IsFilterElement(const sk_sp<SkSVGNode>& node) { return false; }
|
|
|
|
sk_sp<SkImageFilter> makeImageFilter(const SkSVGRenderContext& ctx,
|
|
SkSVGFilterContext* fctx) const;
|
|
|
|
protected:
|
|
explicit SkSVGFe(SkSVGTag t) : INHERITED(t) {}
|
|
|
|
virtual sk_sp<SkImageFilter> onMakeImageFilter(const SkSVGRenderContext&,
|
|
const SkSVGFilterContext&) const = 0;
|
|
|
|
private:
|
|
using INHERITED = SkSVGHiddenContainer;
|
|
};
|
|
|
|
#endif // SkSVGFe_DEFINED
|