tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

SVGFEPointLightElement.h (1884B)


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