/src/mozilla-central/dom/svg/SVGFETileElement.cpp
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 | | #include "mozilla/dom/SVGFETileElement.h" |
8 | | #include "mozilla/dom/SVGFETileElementBinding.h" |
9 | | #include "nsSVGFilterInstance.h" |
10 | | |
11 | | NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(FETile) |
12 | | |
13 | | using namespace mozilla::gfx; |
14 | | |
15 | | namespace mozilla { |
16 | | namespace dom { |
17 | | |
18 | | JSObject* |
19 | | SVGFETileElement::WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) |
20 | 0 | { |
21 | 0 | return SVGFETileElement_Binding::Wrap(aCx, this, aGivenProto); |
22 | 0 | } |
23 | | |
24 | | nsSVGElement::StringInfo SVGFETileElement::sStringInfo[2] = |
25 | | { |
26 | | { &nsGkAtoms::result, kNameSpaceID_None, true }, |
27 | | { &nsGkAtoms::in, kNameSpaceID_None, true } |
28 | | }; |
29 | | |
30 | | //---------------------------------------------------------------------- |
31 | | // nsINode methods |
32 | | |
33 | | |
34 | | NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFETileElement) |
35 | | |
36 | | already_AddRefed<SVGAnimatedString> |
37 | | SVGFETileElement::In1() |
38 | 0 | { |
39 | 0 | return mStringAttributes[IN1].ToDOMAnimatedString(this); |
40 | 0 | } |
41 | | |
42 | | void |
43 | | SVGFETileElement::GetSourceImageNames(nsTArray<nsSVGStringInfo>& aSources) |
44 | 0 | { |
45 | 0 | aSources.AppendElement(nsSVGStringInfo(&mStringAttributes[IN1], this)); |
46 | 0 | } |
47 | | |
48 | | //---------------------------------------------------------------------- |
49 | | // nsSVGElement methods |
50 | | |
51 | | FilterPrimitiveDescription |
52 | | SVGFETileElement::GetPrimitiveDescription(nsSVGFilterInstance* aInstance, |
53 | | const IntRect& aFilterSubregion, |
54 | | const nsTArray<bool>& aInputsAreTainted, |
55 | | nsTArray<RefPtr<SourceSurface>>& aInputImages) |
56 | 0 | { |
57 | 0 | return FilterPrimitiveDescription(AsVariant(TileAttributes())); |
58 | 0 | } |
59 | | |
60 | | bool |
61 | | SVGFETileElement::AttributeAffectsRendering(int32_t aNameSpaceID, |
62 | | nsAtom* aAttribute) const |
63 | 0 | { |
64 | 0 | return SVGFETileElementBase::AttributeAffectsRendering(aNameSpaceID, |
65 | 0 | aAttribute) || |
66 | 0 | (aNameSpaceID == kNameSpaceID_None && aAttribute == nsGkAtoms::in); |
67 | 0 | } |
68 | | |
69 | | //---------------------------------------------------------------------- |
70 | | // nsSVGElement methods |
71 | | |
72 | | nsSVGElement::StringAttributesInfo |
73 | | SVGFETileElement::GetStringInfo() |
74 | 0 | { |
75 | 0 | return StringAttributesInfo(mStringAttributes, sStringInfo, |
76 | 0 | ArrayLength(sStringInfo)); |
77 | 0 | } |
78 | | |
79 | | } // namespace dom |
80 | | } // namespace mozilla |