RESOLVED FIXED 32199
feSpecularLighting is not implemented
https://bugs.webkit.org/show_bug.cgi?id=32199
Summary feSpecularLighting is not implemented
Dirk Schulze
Reported 2009-12-06 12:24:21 PST
feSpecularLighting is not implemented
Attachments
Zoltan Herczeg
Comment 1 2010-04-29 06:27:58 PDT
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*) { m_in->apply(filter); if (!m_in->resultImage()) return; if (!getEffectContext()) return; setIsAlphaImage(m_in->isAlphaImage()); 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?
Dirk Schulze
Comment 2 2010-04-29 09:44:30 PDT
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 '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.
Zoltan Herczeg
Comment 3 2010-04-30 00:54:31 PDT
One more question: FESpecularLighting has a virtual function called "uniteEffectRect", which looks renamed to "uniteChildEffectSubregions", isn't it?
Nikolas Zimmermann
Comment 4 2010-05-07 06:41:07 PDT
Dirk, can you comment on Zoltans question?
Dirk Schulze
Comment 5 2010-05-07 08:25:30 PDT
(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.
Zoltan Herczeg
Comment 6 2010-05-12 06:08:25 PDT
Patch for #32197 (https://bugs.webkit.org/show_bug.cgi?id=32197) also resolved this bug.
Note You need to log in before you can comment on or make changes to this bug.