SVGFETurbulenceElement.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #ifndef mozilla_dom_SVGFETurbulenceElement_h
  6. #define mozilla_dom_SVGFETurbulenceElement_h
  7. #include "nsSVGEnum.h"
  8. #include "nsSVGFilters.h"
  9. #include "nsSVGNumber2.h"
  10. #include "nsSVGInteger.h"
  11. #include "nsSVGString.h"
  12. nsresult NS_NewSVGFETurbulenceElement(nsIContent **aResult,
  13. already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
  14. namespace mozilla {
  15. namespace dom {
  16. typedef nsSVGFE SVGFETurbulenceElementBase;
  17. class SVGFETurbulenceElement : public SVGFETurbulenceElementBase
  18. {
  19. friend nsresult (::NS_NewSVGFETurbulenceElement(nsIContent **aResult,
  20. already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
  21. protected:
  22. explicit SVGFETurbulenceElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
  23. : SVGFETurbulenceElementBase(aNodeInfo)
  24. {
  25. }
  26. virtual JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
  27. public:
  28. virtual bool SubregionIsUnionOfRegions() override { return false; }
  29. virtual FilterPrimitiveDescription
  30. GetPrimitiveDescription(nsSVGFilterInstance* aInstance,
  31. const IntRect& aFilterSubregion,
  32. const nsTArray<bool>& aInputsAreTainted,
  33. nsTArray<RefPtr<SourceSurface>>& aInputImages) override;
  34. virtual bool AttributeAffectsRendering(
  35. int32_t aNameSpaceID, nsIAtom* aAttribute) const override;
  36. virtual nsSVGString& GetResultImageName() override { return mStringAttributes[RESULT]; }
  37. virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override;
  38. // WebIDL
  39. already_AddRefed<SVGAnimatedNumber> BaseFrequencyX();
  40. already_AddRefed<SVGAnimatedNumber> BaseFrequencyY();
  41. already_AddRefed<SVGAnimatedInteger> NumOctaves();
  42. already_AddRefed<SVGAnimatedNumber> Seed();
  43. already_AddRefed<SVGAnimatedEnumeration> StitchTiles();
  44. already_AddRefed<SVGAnimatedEnumeration> Type();
  45. protected:
  46. virtual NumberAttributesInfo GetNumberInfo() override;
  47. virtual NumberPairAttributesInfo GetNumberPairInfo() override;
  48. virtual IntegerAttributesInfo GetIntegerInfo() override;
  49. virtual EnumAttributesInfo GetEnumInfo() override;
  50. virtual StringAttributesInfo GetStringInfo() override;
  51. enum { SEED }; // floating point seed?!
  52. nsSVGNumber2 mNumberAttributes[1];
  53. static NumberInfo sNumberInfo[1];
  54. enum { BASE_FREQ };
  55. nsSVGNumberPair mNumberPairAttributes[1];
  56. static NumberPairInfo sNumberPairInfo[1];
  57. enum { OCTAVES };
  58. nsSVGInteger mIntegerAttributes[1];
  59. static IntegerInfo sIntegerInfo[1];
  60. enum { TYPE, STITCHTILES };
  61. nsSVGEnum mEnumAttributes[2];
  62. static nsSVGEnumMapping sTypeMap[];
  63. static nsSVGEnumMapping sStitchTilesMap[];
  64. static EnumInfo sEnumInfo[2];
  65. enum { RESULT };
  66. nsSVGString mStringAttributes[1];
  67. static StringInfo sStringInfo[1];
  68. };
  69. } // namespace dom
  70. } // namespace mozilla
  71. #endif // mozilla_dom_SVGFETurbulenceElement_h