LCOV - code coverage report
Current view: top level - dom/svg - SVGFESpotLightElement.cpp (source / functions) Hit Total Coverage
Test: output.info Lines: 0 45 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 14 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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/SVGFESpotLightElement.h"
       8             : #include "mozilla/dom/SVGFESpotLightElementBinding.h"
       9             : #include "nsSVGFilterInstance.h"
      10             : 
      11           0 : NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(FESpotLight)
      12             : 
      13             : using namespace mozilla::gfx;
      14             : 
      15             : namespace mozilla {
      16             : namespace dom {
      17             : 
      18             : JSObject*
      19           0 : SVGFESpotLightElement::WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
      20             : {
      21           0 :   return SVGFESpotLightElementBinding::Wrap(aCx, this, aGivenProto);
      22             : }
      23             : 
      24             : nsSVGElement::NumberInfo SVGFESpotLightElement::sNumberInfo[8] =
      25             : {
      26             :   { &nsGkAtoms::x, 0, false },
      27             :   { &nsGkAtoms::y, 0, false },
      28             :   { &nsGkAtoms::z, 0, false },
      29             :   { &nsGkAtoms::pointsAtX, 0, false },
      30             :   { &nsGkAtoms::pointsAtY, 0, false },
      31             :   { &nsGkAtoms::pointsAtZ, 0, false },
      32             :   { &nsGkAtoms::specularExponent, 1, false },
      33             :   { &nsGkAtoms::limitingConeAngle, 0, false }
      34             : };
      35             : 
      36             : //----------------------------------------------------------------------
      37             : // nsIDOMNode methods
      38             : 
      39           0 : NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFESpotLightElement)
      40             : 
      41             : //----------------------------------------------------------------------
      42             : // nsFEUnstyledElement methods
      43             : 
      44             : bool
      45           0 : SVGFESpotLightElement::AttributeAffectsRendering(int32_t aNameSpaceID,
      46             :                                                  nsIAtom* aAttribute) const
      47             : {
      48           0 :   return aNameSpaceID == kNameSpaceID_None &&
      49           0 :          (aAttribute == nsGkAtoms::x ||
      50           0 :           aAttribute == nsGkAtoms::y ||
      51           0 :           aAttribute == nsGkAtoms::z ||
      52           0 :           aAttribute == nsGkAtoms::pointsAtX ||
      53           0 :           aAttribute == nsGkAtoms::pointsAtY ||
      54           0 :           aAttribute == nsGkAtoms::pointsAtZ ||
      55           0 :           aAttribute == nsGkAtoms::specularExponent ||
      56           0 :           aAttribute == nsGkAtoms::limitingConeAngle);
      57             : }
      58             : 
      59             : //----------------------------------------------------------------------
      60             : 
      61             : AttributeMap
      62           0 : SVGFESpotLightElement::ComputeLightAttributes(nsSVGFilterInstance* aInstance)
      63             : {
      64           0 :   Point3D lightPos, pointsAt;
      65             :   float specularExponent, limitingConeAngle;
      66           0 :   GetAnimatedNumberValues(&lightPos.x, &lightPos.y, &lightPos.z,
      67             :                           &pointsAt.x, &pointsAt.y, &pointsAt.z,
      68             :                           &specularExponent, &limitingConeAngle,
      69           0 :                           nullptr);
      70           0 :   if (!mNumberAttributes[SVGFESpotLightElement::LIMITING_CONE_ANGLE].IsExplicitlySet()) {
      71           0 :     limitingConeAngle = 90;
      72             :   }
      73             : 
      74           0 :   AttributeMap map;
      75           0 :   map.Set(eLightType, (uint32_t)eLightTypeSpot);
      76           0 :   map.Set(eSpotLightPosition, aInstance->ConvertLocation(lightPos));
      77           0 :   map.Set(eSpotLightPointsAt, aInstance->ConvertLocation(pointsAt));
      78           0 :   map.Set(eSpotLightFocus, specularExponent);
      79           0 :   map.Set(eSpotLightLimitingConeAngle, limitingConeAngle);
      80           0 :   return map;
      81             : }
      82             : 
      83             : already_AddRefed<SVGAnimatedNumber>
      84           0 : SVGFESpotLightElement::X()
      85             : {
      86           0 :   return mNumberAttributes[ATTR_X].ToDOMAnimatedNumber(this);
      87             : }
      88             : 
      89             : already_AddRefed<SVGAnimatedNumber>
      90           0 : SVGFESpotLightElement::Y()
      91             : {
      92           0 :   return mNumberAttributes[ATTR_Y].ToDOMAnimatedNumber(this);
      93             : }
      94             : 
      95             : already_AddRefed<SVGAnimatedNumber>
      96           0 : SVGFESpotLightElement::Z()
      97             : {
      98           0 :   return mNumberAttributes[ATTR_Z].ToDOMAnimatedNumber(this);
      99             : }
     100             : 
     101             : already_AddRefed<SVGAnimatedNumber>
     102           0 : SVGFESpotLightElement::PointsAtX()
     103             : {
     104           0 :   return mNumberAttributes[POINTS_AT_X].ToDOMAnimatedNumber(this);
     105             : }
     106             : 
     107             : already_AddRefed<SVGAnimatedNumber>
     108           0 : SVGFESpotLightElement::PointsAtY()
     109             : {
     110           0 :   return mNumberAttributes[POINTS_AT_Y].ToDOMAnimatedNumber(this);
     111             : }
     112             : 
     113             : already_AddRefed<SVGAnimatedNumber>
     114           0 : SVGFESpotLightElement::PointsAtZ()
     115             : {
     116           0 :   return mNumberAttributes[POINTS_AT_Z].ToDOMAnimatedNumber(this);
     117             : }
     118             : 
     119             : already_AddRefed<SVGAnimatedNumber>
     120           0 : SVGFESpotLightElement::SpecularExponent()
     121             : {
     122           0 :   return mNumberAttributes[SPECULAR_EXPONENT].ToDOMAnimatedNumber(this);
     123             : }
     124             : 
     125             : already_AddRefed<SVGAnimatedNumber>
     126           0 : SVGFESpotLightElement::LimitingConeAngle()
     127             : {
     128           0 :   return mNumberAttributes[LIMITING_CONE_ANGLE].ToDOMAnimatedNumber(this);
     129             : }
     130             : 
     131             : //----------------------------------------------------------------------
     132             : // nsSVGElement methods
     133             : 
     134             : nsSVGElement::NumberAttributesInfo
     135           0 : SVGFESpotLightElement::GetNumberInfo()
     136             : {
     137             :   return NumberAttributesInfo(mNumberAttributes, sNumberInfo,
     138           0 :                               ArrayLength(sNumberInfo));
     139             : }
     140             : 
     141             : } // namespace dom
     142             : } // namespace mozilla

Generated by: LCOV version 1.13