1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef DOM_SVG_SVGFEMORPHOLOGYELEMENT_H_
8 #define DOM_SVG_SVGFEMORPHOLOGYELEMENT_H_
10 #include "SVGAnimatedEnumeration.h"
11 #include "SVGAnimatedNumberPair.h"
12 #include "SVGAnimatedString.h"
13 #include "mozilla/dom/SVGFilters.h"
15 nsresult
NS_NewSVGFEMorphologyElement(
16 nsIContent
** aResult
, already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
);
21 using SVGFEMorphologyElementBase
= SVGFE
;
23 class SVGFEMorphologyElement
: public SVGFEMorphologyElementBase
{
24 friend nsresult(::NS_NewSVGFEMorphologyElement(
26 already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
));
29 explicit SVGFEMorphologyElement(
30 already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
)
31 : SVGFEMorphologyElementBase(std::move(aNodeInfo
)) {}
32 virtual JSObject
* WrapNode(JSContext
* aCx
,
33 JS::Handle
<JSObject
*> aGivenProto
) override
;
36 virtual FilterPrimitiveDescription
GetPrimitiveDescription(
37 SVGFilterInstance
* aInstance
, const IntRect
& aFilterSubregion
,
38 const nsTArray
<bool>& aInputsAreTainted
,
39 nsTArray
<RefPtr
<SourceSurface
>>& aInputImages
) override
;
40 virtual bool AttributeAffectsRendering(int32_t aNameSpaceID
,
41 nsAtom
* aAttribute
) const override
;
42 virtual SVGAnimatedString
& GetResultImageName() override
{
43 return mStringAttributes
[RESULT
];
45 virtual void GetSourceImageNames(nsTArray
<SVGStringInfo
>& aSources
) override
;
47 virtual nsresult
Clone(dom::NodeInfo
*, nsINode
** aResult
) const override
;
50 already_AddRefed
<DOMSVGAnimatedString
> In1();
51 already_AddRefed
<DOMSVGAnimatedEnumeration
> Operator();
52 already_AddRefed
<DOMSVGAnimatedNumber
> RadiusX();
53 already_AddRefed
<DOMSVGAnimatedNumber
> RadiusY();
54 void SetRadius(float rx
, float ry
);
57 void GetRXY(int32_t* aRX
, int32_t* aRY
, const SVGFilterInstance
& aInstance
);
59 virtual NumberPairAttributesInfo
GetNumberPairInfo() override
;
60 virtual EnumAttributesInfo
GetEnumInfo() override
;
61 virtual StringAttributesInfo
GetStringInfo() override
;
64 SVGAnimatedNumberPair mNumberPairAttributes
[1];
65 static NumberPairInfo sNumberPairInfo
[1];
68 SVGAnimatedEnumeration mEnumAttributes
[1];
69 static SVGEnumMapping sOperatorMap
[];
70 static EnumInfo sEnumInfo
[1];
73 SVGAnimatedString mStringAttributes
[2];
74 static StringInfo sStringInfo
[2];
78 } // namespace mozilla
80 #endif // DOM_SVG_SVGFEMORPHOLOGYELEMENT_H_