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_SVGFECOLORMATRIXELEMENT_H_
8 #define DOM_SVG_SVGFECOLORMATRIXELEMENT_H_
10 #include "SVGAnimatedNumberList.h"
11 #include "SVGAnimatedEnumeration.h"
12 #include "mozilla/dom/SVGFilters.h"
14 nsresult
NS_NewSVGFEColorMatrixElement(
15 nsIContent
** aResult
, already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
);
17 namespace mozilla::dom
{
19 class DOMSVGAnimatedNumberList
;
21 using SVGFEColorMatrixElementBase
= SVGFilterPrimitiveElement
;
23 class SVGFEColorMatrixElement final
: public SVGFEColorMatrixElementBase
{
24 friend nsresult(::NS_NewSVGFEColorMatrixElement(
26 already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
));
29 explicit SVGFEColorMatrixElement(
30 already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
)
31 : SVGFEColorMatrixElementBase(std::move(aNodeInfo
)) {}
32 JSObject
* WrapNode(JSContext
* aCx
,
33 JS::Handle
<JSObject
*> aGivenProto
) override
;
36 FilterPrimitiveDescription
GetPrimitiveDescription(
37 SVGFilterInstance
* aInstance
, const IntRect
& aFilterSubregion
,
38 const nsTArray
<bool>& aInputsAreTainted
,
39 nsTArray
<RefPtr
<SourceSurface
>>& aInputImages
) override
;
40 bool AttributeAffectsRendering(int32_t aNameSpaceID
,
41 nsAtom
* aAttribute
) const override
;
42 SVGAnimatedString
& GetResultImageName() override
{
43 return mStringAttributes
[RESULT
];
45 void GetSourceImageNames(nsTArray
<SVGStringInfo
>& aSources
) override
;
47 nsresult
Clone(dom::NodeInfo
*, nsINode
** aResult
) const override
;
49 nsresult
BindToTree(BindContext
& aCtx
, nsINode
& aParent
) override
;
52 already_AddRefed
<DOMSVGAnimatedString
> In1();
53 already_AddRefed
<DOMSVGAnimatedEnumeration
> Type();
54 already_AddRefed
<DOMSVGAnimatedNumberList
> Values();
57 EnumAttributesInfo
GetEnumInfo() override
;
58 StringAttributesInfo
GetStringInfo() override
;
59 NumberListAttributesInfo
GetNumberListInfo() override
;
62 SVGAnimatedEnumeration mEnumAttributes
[1];
63 static SVGEnumMapping sTypeMap
[];
64 static EnumInfo sEnumInfo
[1];
67 SVGAnimatedString mStringAttributes
[2];
68 static StringInfo sStringInfo
[2];
71 SVGAnimatedNumberList mNumberListAttributes
[1];
72 static NumberListInfo sNumberListInfo
[1];
75 } // namespace mozilla::dom
77 #endif // DOM_SVG_SVGFECOLORMATRIXELEMENT_H_