Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/dom/SVGFEConvolveMatrixElement.h
Line
Count
Source (jump to first uncovered line)
1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
3
/* This Source Code Form is subject to the terms of the Mozilla Public
4
 * License, v. 2.0. If a copy of the MPL was not distributed with this
5
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
#ifndef mozilla_dom_SVGFEConvolveMatrixElement_h
8
#define mozilla_dom_SVGFEConvolveMatrixElement_h
9
10
#include "nsSVGBoolean.h"
11
#include "nsSVGEnum.h"
12
#include "nsSVGFilters.h"
13
#include "nsSVGInteger.h"
14
#include "nsSVGIntegerPair.h"
15
#include "nsSVGNumber2.h"
16
#include "nsSVGString.h"
17
#include "SVGAnimatedNumberList.h"
18
19
nsresult NS_NewSVGFEConvolveMatrixElement(nsIContent **aResult,
20
                                          already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
21
22
namespace mozilla {
23
class DOMSVGAnimatedNumberList;
24
25
namespace dom {
26
class SVGAnimatedBoolean;
27
28
typedef nsSVGFE SVGFEConvolveMatrixElementBase;
29
30
class SVGFEConvolveMatrixElement : public SVGFEConvolveMatrixElementBase
31
{
32
  friend nsresult (::NS_NewSVGFEConvolveMatrixElement(nsIContent **aResult,
33
                                                      already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
34
protected:
35
  explicit SVGFEConvolveMatrixElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
36
    : SVGFEConvolveMatrixElementBase(std::move(aNodeInfo))
37
0
  {
38
0
  }
39
  virtual JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
40
41
public:
42
  virtual FilterPrimitiveDescription
43
    GetPrimitiveDescription(nsSVGFilterInstance* aInstance,
44
                            const IntRect& aFilterSubregion,
45
                            const nsTArray<bool>& aInputsAreTainted,
46
                            nsTArray<RefPtr<SourceSurface>>& aInputImages) override;
47
  virtual bool AttributeAffectsRendering(
48
          int32_t aNameSpaceID, nsAtom* aAttribute) const override;
49
0
  virtual nsSVGString& GetResultImageName() override { return mStringAttributes[RESULT]; }
50
  virtual void GetSourceImageNames(nsTArray<nsSVGStringInfo>& aSources) override;
51
52
  virtual nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
53
54
  // WebIDL
55
  already_AddRefed<SVGAnimatedString> In1();
56
  already_AddRefed<SVGAnimatedInteger> OrderX();
57
  already_AddRefed<SVGAnimatedInteger> OrderY();
58
  already_AddRefed<DOMSVGAnimatedNumberList> KernelMatrix();
59
  already_AddRefed<SVGAnimatedInteger> TargetX();
60
  already_AddRefed<SVGAnimatedInteger> TargetY();
61
  already_AddRefed<SVGAnimatedEnumeration> EdgeMode();
62
  already_AddRefed<SVGAnimatedBoolean> PreserveAlpha();
63
  already_AddRefed<SVGAnimatedNumber> Divisor();
64
  already_AddRefed<SVGAnimatedNumber> Bias();
65
  already_AddRefed<SVGAnimatedNumber> KernelUnitLengthX();
66
  already_AddRefed<SVGAnimatedNumber> KernelUnitLengthY();
67
68
protected:
69
  virtual NumberAttributesInfo GetNumberInfo() override;
70
  virtual NumberPairAttributesInfo GetNumberPairInfo() override;
71
  virtual IntegerAttributesInfo GetIntegerInfo() override;
72
  virtual IntegerPairAttributesInfo GetIntegerPairInfo() override;
73
  virtual BooleanAttributesInfo GetBooleanInfo() override;
74
  virtual EnumAttributesInfo GetEnumInfo() override;
75
  virtual StringAttributesInfo GetStringInfo() override;
76
  virtual NumberListAttributesInfo GetNumberListInfo() override;
77
78
  enum { DIVISOR, BIAS };
79
  nsSVGNumber2 mNumberAttributes[2];
80
  static NumberInfo sNumberInfo[2];
81
82
  enum { KERNEL_UNIT_LENGTH };
83
  nsSVGNumberPair mNumberPairAttributes[1];
84
  static NumberPairInfo sNumberPairInfo[1];
85
86
  enum { TARGET_X, TARGET_Y };
87
  nsSVGInteger mIntegerAttributes[2];
88
  static IntegerInfo sIntegerInfo[2];
89
90
  enum { ORDER };
91
  nsSVGIntegerPair mIntegerPairAttributes[1];
92
  static IntegerPairInfo sIntegerPairInfo[1];
93
94
  enum { PRESERVEALPHA };
95
  nsSVGBoolean mBooleanAttributes[1];
96
  static BooleanInfo sBooleanInfo[1];
97
98
  enum { EDGEMODE };
99
  nsSVGEnum mEnumAttributes[1];
100
  static nsSVGEnumMapping sEdgeModeMap[];
101
  static EnumInfo sEnumInfo[1];
102
103
  enum { RESULT, IN1 };
104
  nsSVGString mStringAttributes[2];
105
  static StringInfo sStringInfo[2];
106
107
  enum { KERNELMATRIX };
108
  SVGAnimatedNumberList mNumberListAttributes[1];
109
  static NumberListInfo sNumberListInfo[1];
110
};
111
112
} // namespace dom
113
} // namespace mozilla
114
115
#endif // mozilla_dom_SVGFEConvolveMatrixElement_h