SVGFETileElement.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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_SVGFETileElement_h
  6. #define mozilla_dom_SVGFETileElement_h
  7. #include "nsSVGFilters.h"
  8. nsresult NS_NewSVGFETileElement(nsIContent **aResult,
  9. already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
  10. namespace mozilla {
  11. namespace dom {
  12. typedef nsSVGFE SVGFETileElementBase;
  13. class SVGFETileElement : public SVGFETileElementBase
  14. {
  15. friend nsresult (::NS_NewSVGFETileElement(nsIContent **aResult,
  16. already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
  17. protected:
  18. explicit SVGFETileElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
  19. : SVGFETileElementBase(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 bool AttributeAffectsRendering(
  31. int32_t aNameSpaceID, nsIAtom* aAttribute) const override;
  32. virtual nsSVGString& GetResultImageName() override { return mStringAttributes[RESULT]; }
  33. virtual void GetSourceImageNames(nsTArray<nsSVGStringInfo>& aSources) override;
  34. virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override;
  35. // WebIDL
  36. already_AddRefed<SVGAnimatedString> In1();
  37. protected:
  38. virtual StringAttributesInfo GetStringInfo() override;
  39. enum { RESULT, IN1 };
  40. nsSVGString mStringAttributes[2];
  41. static StringInfo sStringInfo[2];
  42. };
  43. } // namespace dom
  44. } // namespace mozilla
  45. #endif // mozilla_dom_SVGFETileElement_h