SVGFEFloodElement.h 2.0 KB

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