SVGFEMergeElement.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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_SVGFEMergeElement_h
  6. #define mozilla_dom_SVGFEMergeElement_h
  7. #include "nsSVGFilters.h"
  8. nsresult NS_NewSVGFEMergeElement(nsIContent **aResult,
  9. already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
  10. namespace mozilla {
  11. namespace dom {
  12. typedef nsSVGFE SVGFEMergeElementBase;
  13. class SVGFEMergeElement : public SVGFEMergeElementBase
  14. {
  15. friend nsresult (::NS_NewSVGFEMergeElement(nsIContent **aResult,
  16. already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
  17. protected:
  18. explicit SVGFEMergeElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
  19. : SVGFEMergeElementBase(aNodeInfo)
  20. {
  21. }
  22. virtual JSObject* WrapNode(JSContext *cx, JS::Handle<JSObject*> aGivenProto) override;
  23. public:
  24. virtual FilterPrimitiveDescription
  25. GetPrimitiveDescription(nsSVGFilterInstance* aInstance,
  26. const IntRect& aFilterSubregion,
  27. const nsTArray<bool>& aInputsAreTainted,
  28. nsTArray<RefPtr<SourceSurface>>& aInputImages) override;
  29. virtual nsSVGString& GetResultImageName() override { return mStringAttributes[RESULT]; }
  30. virtual void GetSourceImageNames(nsTArray<nsSVGStringInfo>& aSources) override;
  31. // nsIContent
  32. virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override;
  33. protected:
  34. virtual StringAttributesInfo GetStringInfo() override;
  35. enum { RESULT };
  36. nsSVGString mStringAttributes[1];
  37. static StringInfo sStringInfo[1];
  38. };
  39. } // namespace dom
  40. } // namespace mozilla
  41. #endif // mozilla_dom_SVGFEMergeElement_h