SVGFEDistantLightElement.h (1890B)
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/. */ 6 7 #ifndef DOM_SVG_SVGFEDISTANTLIGHTELEMENT_H_ 8 #define DOM_SVG_SVGFEDISTANTLIGHTELEMENT_H_ 9 10 #include "SVGAnimatedNumber.h" 11 #include "mozilla/dom/SVGFilters.h" 12 13 nsresult NS_NewSVGFEDistantLightElement( 14 nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo); 15 16 namespace mozilla::dom { 17 18 using SVGFEDistantLightElementBase = SVGFELightElement; 19 20 class SVGFEDistantLightElement final : public SVGFEDistantLightElementBase { 21 friend nsresult(::NS_NewSVGFEDistantLightElement( 22 nsIContent** aResult, 23 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)); 24 25 protected: 26 explicit SVGFEDistantLightElement( 27 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo) 28 : SVGFEDistantLightElementBase(std::move(aNodeInfo)) {} 29 JSObject* WrapNode(JSContext* aCx, 30 JS::Handle<JSObject*> aGivenProto) override; 31 32 public: 33 mozilla::gfx::LightType ComputeLightAttributes( 34 SVGFilterInstance* aInstance, nsTArray<float>& aFloatAttributes) override; 35 bool AttributeAffectsRendering(int32_t aNameSpaceID, 36 nsAtom* aAttribute) const override; 37 38 nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override; 39 40 // WebIDL 41 already_AddRefed<DOMSVGAnimatedNumber> Azimuth(); 42 already_AddRefed<DOMSVGAnimatedNumber> Elevation(); 43 44 protected: 45 NumberAttributesInfo GetNumberInfo() override; 46 47 enum { AZIMUTH, ELEVATION }; 48 SVGAnimatedNumber mNumberAttributes[2]; 49 static NumberInfo sNumberInfo[2]; 50 }; 51 52 } // namespace mozilla::dom 53 54 #endif // DOM_SVG_SVGFEDISTANTLIGHTELEMENT_H_