<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>32199</bug_id>
          
          <creation_ts>2009-12-06 12:24:21 -0800</creation_ts>
          <short_desc>feSpecularLighting is not implemented</short_desc>
          <delta_ts>2014-05-12 05:54:35 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>SVG</component>
          <version>525.x (Safari 3.1)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>32197</dependson>
          <blocked>68469</blocked>
    
    <blocked>26389</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Dirk Schulze">krit</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>jeffschiller</cc>
    
    <cc>zherczeg</cc>
    
    <cc>zimmermann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>169116</commentid>
    <comment_count>0</comment_count>
    <who name="Dirk Schulze">krit</who>
    <bug_when>2009-12-06 12:24:21 -0800</bug_when>
    <thetext>feSpecularLighting is not implemented</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>218989</commentid>
    <comment_count>1</comment_count>
    <who name="Zoltan Herczeg">zherczeg</who>
    <bug_when>2010-04-29 06:27:58 -0700</bug_when>
    <thetext>It seems to me it is still an unimplemented feature, and I think of pick up this task for myself. I am new on svg part of WebKit, and I want to make sure my approach is reasonable:

 - from an &lt;feSpecularLighting ...&gt; tag a FESpecularLighting object is created
   it contains one light source (It is unclear for me that multiple light
   sources are allowed or not)
 - I have to implement its &quot;void apply(Filter*)&quot; function
 - SVGFESpecularLightingElement is used only for visiting the nodes

Besides, why the filters are spread across multiple directories in WebKit?
 platform/graphics/filters, svg/graphics/filters ?

Ok the task itself (based on GaussianBlur):

void FESpecularLighting::apply(Filter*)
{
    m_in-&gt;apply(filter);
    if (!m_in-&gt;resultImage())
        return;

    if (!getEffectContext())
        return;

    setIsAlphaImage(m_in-&gt;isAlphaImage());

    IntRect effectDrawingRect = calculateDrawingIntRect(m_in-&gt;scaledSubRegion());
    RefPtr&lt;ImageData&gt; srcImageData(m_in-&gt;resultImage()-&gt;getPremultipliedImageData(effectDrawingRect));
    CanvasPixelArray* srcPixelArray(srcImageData-&gt;data());

    // Do the effect here
    // http://www.w3.org/TR/SVG/filters.html#feSpecularLighting

    resultImage()-&gt;putPremultipliedImageData(srcImageData.get(), imageRect, IntPoint());
}

Is this ok?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>219075</commentid>
    <comment_count>2</comment_count>
    <who name="Dirk Schulze">krit</who>
    <bug_when>2010-04-29 09:44:30 -0700</bug_when>
    <thetext>At first, there are two lighting filter effects, feSpecularLighting and feDiffuseLighting. Both can be combined with one of three light sources: feDistantLight, fePointLight, feSpotLight. To combine the lighting effect with a light source, just add the light source as a child to the lighting effect. There should be just one light source per lighting effect. For more detailed information, look at:

http://www.w3.org/TR/SVG/filters.html

For the implementation, you &apos;just&apos; need to write the apply function, thats correct. Some, not _that_ svg specific, effects are in platform/graphics/filters. The may or may not be used by CSS in the feature to implement CSS filter effects.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>219396</commentid>
    <comment_count>3</comment_count>
    <who name="Zoltan Herczeg">zherczeg</who>
    <bug_when>2010-04-30 00:54:31 -0700</bug_when>
    <thetext>One more question: FESpecularLighting has a virtual function called &quot;uniteEffectRect&quot;, which looks renamed to &quot;uniteChildEffectSubregions&quot;, isn&apos;t it?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>222325</commentid>
    <comment_count>4</comment_count>
    <who name="Nikolas Zimmermann">zimmermann</who>
    <bug_when>2010-05-07 06:41:07 -0700</bug_when>
    <thetext>Dirk, can you comment on Zoltans question?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>222388</commentid>
    <comment_count>5</comment_count>
    <who name="Dirk Schulze">krit</who>
    <bug_when>2010-05-07 08:25:30 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; One more question: FESpecularLighting has a virtual function called
&gt; &quot;uniteEffectRect&quot;, which looks renamed to &quot;uniteChildEffectSubregions&quot;, isn&apos;t
&gt; it?

FESpecularLighting should look simiular to FEDiffuseLighting. It&apos;s a mistake, if it doesn&apos;t look the same.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>224559</commentid>
    <comment_count>6</comment_count>
    <who name="Zoltan Herczeg">zherczeg</who>
    <bug_when>2010-05-12 06:08:25 -0700</bug_when>
    <thetext>Patch for #32197 (https://bugs.webkit.org/show_bug.cgi?id=32197) also resolved this bug.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>