Bug 32199 - feSpecularLighting is not implemented
: feSpecularLighting is not implemented
: WebKit
: 525.x (Safari 3.1)
: PC Mac OS X 10.5
: P2 Normal
Assigned To:
: 32197
: 26389
  Show dependency treegraph
Reported: 2009-12-06 12:24 PST by
Modified: 2010-05-12 06:08 PST (History)



You need to log in before you can comment on or make changes to this bug.

Description From 2009-12-06 12:24:21 PST
feSpecularLighting is not implemented
------- Comment #1 From 2010-04-29 06:27:58 PST -------
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 <feSpecularLighting ...> 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 "void apply(Filter*)" 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*)
    if (!m_in->resultImage())

    if (!getEffectContext())


    IntRect effectDrawingRect = calculateDrawingIntRect(m_in->scaledSubRegion());
    RefPtr<ImageData> srcImageData(m_in->resultImage()->getPremultipliedImageData(effectDrawingRect));
    CanvasPixelArray* srcPixelArray(srcImageData->data());

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

    resultImage()->putPremultipliedImageData(srcImageData.get(), imageRect, IntPoint());

Is this ok?
------- Comment #2 From 2010-04-29 09:44:30 PST -------
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:


For the implementation, you 'just' 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.
------- Comment #3 From 2010-04-30 00:54:31 PST -------
One more question: FESpecularLighting has a virtual function called "uniteEffectRect", which looks renamed to "uniteChildEffectSubregions", isn't it?
------- Comment #4 From 2010-05-07 06:41:07 PST -------
Dirk, can you comment on Zoltans question?
------- Comment #5 From 2010-05-07 08:25:30 PST -------
(In reply to comment #3)
> One more question: FESpecularLighting has a virtual function called
> "uniteEffectRect", which looks renamed to "uniteChildEffectSubregions", isn't
> it?

FESpecularLighting should look simiular to FEDiffuseLighting. It's a mistake, if it doesn't look the same.
------- Comment #6 From 2010-05-12 06:08:25 PST -------
Patch for #32197 (https://bugs.webkit.org/show_bug.cgi?id=32197) also resolved this bug.