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 mozilla_dom_SVGFEOffsetElement_h
8 #define mozilla_dom_SVGFEOffsetElement_h
10 #include "nsSVGFilters.h"
11 #include "nsSVGNumber2.h"
12 #include "nsSVGString.h"
14 nsresult
NS_NewSVGFEOffsetElement(nsIContent
**aResult
,
15 already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
);
20 typedef nsSVGFE SVGFEOffsetElementBase
;
22 class SVGFEOffsetElement
: public SVGFEOffsetElementBase
24 friend nsresult (::NS_NewSVGFEOffsetElement(nsIContent
**aResult
,
25 already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
));
27 explicit SVGFEOffsetElement(already_AddRefed
<mozilla::dom::NodeInfo
>& aNodeInfo
)
28 : SVGFEOffsetElementBase(aNodeInfo
)
31 virtual JSObject
* WrapNode(JSContext
* aCx
, JS::Handle
<JSObject
*> aGivenProto
) override
;
34 virtual FilterPrimitiveDescription
35 GetPrimitiveDescription(nsSVGFilterInstance
* aInstance
,
36 const IntRect
& aFilterSubregion
,
37 const nsTArray
<bool>& aInputsAreTainted
,
38 nsTArray
<RefPtr
<SourceSurface
>>& aInputImages
) override
;
39 virtual bool AttributeAffectsRendering(
40 int32_t aNameSpaceID
, nsAtom
* aAttribute
) const override
;
41 virtual nsSVGString
& GetResultImageName() override
{ return mStringAttributes
[RESULT
]; }
42 virtual void GetSourceImageNames(nsTArray
<nsSVGStringInfo
>& aSources
) override
;
44 virtual nsresult
Clone(mozilla::dom::NodeInfo
*aNodeInfo
, nsINode
**aResult
,
45 bool aPreallocateChildren
) const override
;
48 already_AddRefed
<SVGAnimatedString
> In1();
49 already_AddRefed
<SVGAnimatedNumber
> Dx();
50 already_AddRefed
<SVGAnimatedNumber
> Dy();
53 virtual NumberAttributesInfo
GetNumberInfo() override
;
54 virtual StringAttributesInfo
GetStringInfo() override
;
57 nsSVGNumber2 mNumberAttributes
[2];
58 static NumberInfo sNumberInfo
[2];
61 nsSVGString mStringAttributes
[2];
62 static StringInfo sStringInfo
[2];
66 } // namespace mozilla
68 #endif // mozilla_dom_SVGFEOffsetElement_h