SVGFEColorMatrixElement.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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_SVGFEColorMatrixElement_h
  6. #define mozilla_dom_SVGFEColorMatrixElement_h
  7. #include "nsSVGEnum.h"
  8. #include "nsSVGFilters.h"
  9. #include "SVGAnimatedNumberList.h"
  10. nsresult NS_NewSVGFEColorMatrixElement(nsIContent **aResult,
  11. already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
  12. namespace mozilla {
  13. namespace dom {
  14. typedef nsSVGFE SVGFEColorMatrixElementBase;
  15. class SVGFEColorMatrixElement : public SVGFEColorMatrixElementBase
  16. {
  17. friend nsresult (::NS_NewSVGFEColorMatrixElement(nsIContent **aResult,
  18. already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
  19. protected:
  20. explicit SVGFEColorMatrixElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
  21. : SVGFEColorMatrixElementBase(aNodeInfo)
  22. {
  23. }
  24. virtual JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
  25. public:
  26. virtual FilterPrimitiveDescription
  27. GetPrimitiveDescription(nsSVGFilterInstance* aInstance,
  28. const IntRect& aFilterSubregion,
  29. const nsTArray<bool>& aInputsAreTainted,
  30. nsTArray<RefPtr<SourceSurface>>& aInputImages) override;
  31. virtual bool AttributeAffectsRendering(
  32. int32_t aNameSpaceID, nsIAtom* aAttribute) const override;
  33. virtual nsSVGString& GetResultImageName() override { return mStringAttributes[RESULT]; }
  34. virtual void GetSourceImageNames(nsTArray<nsSVGStringInfo>& aSources) override;
  35. virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override;
  36. // WebIDL
  37. already_AddRefed<SVGAnimatedString> In1();
  38. already_AddRefed<SVGAnimatedEnumeration> Type();
  39. already_AddRefed<DOMSVGAnimatedNumberList> Values();
  40. protected:
  41. virtual EnumAttributesInfo GetEnumInfo() override;
  42. virtual StringAttributesInfo GetStringInfo() override;
  43. virtual NumberListAttributesInfo GetNumberListInfo() override;
  44. enum { TYPE };
  45. nsSVGEnum mEnumAttributes[1];
  46. static nsSVGEnumMapping sTypeMap[];
  47. static EnumInfo sEnumInfo[1];
  48. enum { RESULT, IN1 };
  49. nsSVGString mStringAttributes[2];
  50. static StringInfo sStringInfo[2];
  51. enum { VALUES };
  52. SVGAnimatedNumberList mNumberListAttributes[1];
  53. static NumberListInfo sNumberListInfo[1];
  54. };
  55. } // namespace dom
  56. } // namespace mozilla
  57. #endif // mozilla_dom_SVGFEColorMatrixElement_h