LCOV - code coverage report
Current view: top level - dom/svg - SVGFEFloodElement.cpp (source / functions) Hit Total Coverage
Test: output.info Lines: 0 19 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 6 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/SVGFEFloodElement.h"
       8             : 
       9             : #include "FilterSupport.h"
      10             : #include "mozilla/dom/SVGFEFloodElementBinding.h"
      11             : #include "nsColor.h"
      12             : #include "nsIFrame.h"
      13             : 
      14           0 : NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(FEFlood)
      15             : 
      16             : using namespace mozilla::gfx;
      17             : 
      18             : namespace mozilla {
      19             : namespace dom {
      20             : 
      21             : JSObject*
      22           0 : SVGFEFloodElement::WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
      23             : {
      24           0 :   return SVGFEFloodElementBinding::Wrap(aCx, this, aGivenProto);
      25             : }
      26             : 
      27             : nsSVGElement::StringInfo SVGFEFloodElement::sStringInfo[1] =
      28             : {
      29             :   { &nsGkAtoms::result, kNameSpaceID_None, true }
      30             : };
      31             : 
      32             : //----------------------------------------------------------------------
      33             : // nsIDOMNode methods
      34             : 
      35           0 : NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEFloodElement)
      36             : 
      37             : FilterPrimitiveDescription
      38           0 : SVGFEFloodElement::GetPrimitiveDescription(nsSVGFilterInstance* aInstance,
      39             :                                            const IntRect& aFilterSubregion,
      40             :                                            const nsTArray<bool>& aInputsAreTainted,
      41             :                                            nsTArray<RefPtr<SourceSurface>>& aInputImages)
      42             : {
      43           0 :   FilterPrimitiveDescription descr(PrimitiveType::Flood);
      44           0 :   nsIFrame* frame = GetPrimaryFrame();
      45           0 :   if (frame) {
      46           0 :     nsStyleContext* style = frame->StyleContext();
      47           0 :     Color color(Color::FromABGR(style->StyleSVGReset()->mFloodColor));
      48           0 :     color.a *= style->StyleSVGReset()->mFloodOpacity;
      49           0 :     descr.Attributes().Set(eFloodColor, color);
      50             :   } else {
      51           0 :     descr.Attributes().Set(eFloodColor, Color());
      52             :   }
      53           0 :   return descr;
      54             : }
      55             : 
      56             : //----------------------------------------------------------------------
      57             : // nsIContent methods
      58             : 
      59             : NS_IMETHODIMP_(bool)
      60           0 : SVGFEFloodElement::IsAttributeMapped(const nsIAtom* name) const
      61             : {
      62             :   static const MappedAttributeEntry* const map[] = {
      63             :     sFEFloodMap
      64             :   };
      65             : 
      66           0 :   return FindAttributeDependence(name, map) ||
      67           0 :     SVGFEFloodElementBase::IsAttributeMapped(name);
      68             : }
      69             : 
      70             : //----------------------------------------------------------------------
      71             : // nsSVGElement methods
      72             : 
      73             : nsSVGElement::StringAttributesInfo
      74           0 : SVGFEFloodElement::GetStringInfo()
      75             : {
      76             :   return StringAttributesInfo(mStringAttributes, sStringInfo,
      77           0 :                               ArrayLength(sStringInfo));
      78             : }
      79             : 
      80             : } // namespace dom
      81             : } // namespace mozilla

Generated by: LCOV version 1.13