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_SVGFEBLENDELEMENT_H_
8 #define DOM_SVG_SVGFEBLENDELEMENT_H_
10 #include "SVGAnimatedEnumeration.h"
11 #include "mozilla/dom/SVGFilters.h"
13 nsresult
NS_NewSVGFEBlendElement(
14 nsIContent
** aResult
, already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
);
18 using SVGFEBlendElementBase
= SVGFE
;
20 class SVGFEBlendElement
: public SVGFEBlendElementBase
{
21 friend nsresult(::NS_NewSVGFEBlendElement(
23 already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
));
26 explicit SVGFEBlendElement(
27 already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
)
28 : SVGFEBlendElementBase(std::move(aNodeInfo
)) {}
29 virtual JSObject
* WrapNode(JSContext
* cx
,
30 JS::Handle
<JSObject
*> aGivenProto
) override
;
33 virtual FilterPrimitiveDescription
GetPrimitiveDescription(
34 SVGFilterInstance
* aInstance
, const IntRect
& aFilterSubregion
,
35 const nsTArray
<bool>& aInputsAreTainted
,
36 nsTArray
<RefPtr
<SourceSurface
>>& aInputImages
) override
;
37 virtual bool AttributeAffectsRendering(int32_t aNameSpaceID
,
38 nsAtom
* aAttribute
) const override
;
39 virtual SVGAnimatedString
& GetResultImageName() override
{
40 return mStringAttributes
[RESULT
];
42 virtual void GetSourceImageNames(nsTArray
<SVGStringInfo
>& aSources
) override
;
44 virtual nsresult
Clone(dom::NodeInfo
*, nsINode
** aResult
) const override
;
47 already_AddRefed
<DOMSVGAnimatedString
> In1();
48 already_AddRefed
<DOMSVGAnimatedString
> In2();
49 already_AddRefed
<DOMSVGAnimatedEnumeration
> Mode();
52 virtual EnumAttributesInfo
GetEnumInfo() override
;
53 virtual StringAttributesInfo
GetStringInfo() override
;
56 SVGAnimatedEnumeration mEnumAttributes
[1];
57 static SVGEnumMapping sModeMap
[];
58 static EnumInfo sEnumInfo
[1];
60 enum { RESULT
, IN1
, IN2
};
61 SVGAnimatedString mStringAttributes
[3];
62 static StringInfo sStringInfo
[3];
66 } // namespace mozilla
68 #endif // DOM_SVG_SVGFEBLENDELEMENT_H_