Bug 27768

Summary: SVG feComponentTransfer needs to be implemented
Product: WebKit Reporter: Dirk Schulze <krit>
Component: SVGAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: eric, jeffschiller
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Bug Depends on:    
Bug Blocks: 68469, 26389    
Attachments:
Description Flags
SVG Filter feComponentTransfer
eric: review-
SVG Filter feComponentTransfer
none
SVG Filter feComponentTransfer none

Description Dirk Schulze 2009-07-28 09:41:49 PDT
SVG feComponentTransfer needs to be implemented
Comment 1 Dirk Schulze 2009-07-28 13:02:50 PDT
Created attachment 33662 [details]
SVG Filter feComponentTransfer

Implementation with look-up-table. This is a dramaticly speed up of feComponentTransfer.
Comment 2 Eric Seidel (no email) 2009-07-31 15:24:11 PDT
Comment on attachment 33662 [details]
SVG Filter feComponentTransfer

Hum... I still think function pointers or templates would allow us to share much more code.  Do we know that function pointers would be a slowdown?
Comment 3 Eric Seidel (no email) 2009-08-06 19:24:04 PDT
Comment on attachment 33662 [details]
SVG Filter feComponentTransfer

Sad that we don't have a Color based get/set:
5         srcPixelArray->get(pixelByteOffset, r);
 196         srcPixelArray->get(pixelByteOffset + 1, g);
 197         srcPixelArray->get(pixelByteOffset + 2, b);
 198         srcPixelArray->get(pixelByteOffset + 3, a);

This should just be an array of these function pointers:
168         switch (channel) {
 169             case 0:
 170                 transferFunction = redFunction();
 171                 break;
 172             case 1:
 173                 transferFunction = greenFunction();
 174                 break;
 175             case 2:
 176                 transferFunction = blueFunction();
 177                 break;
 178             case 3:
 179                 transferFunction = alphaFunction();
 180                 break;
 181             default:
 182                 break;
 183         }

probably quicker than a switch, and much, much less code. :)

We need to find a way to share more of these for loops.

I think that we should use function pointers indexed in an array by transferFunction.type.
Comment 4 Dirk Schulze 2009-08-09 11:27:27 PDT
Created attachment 34427 [details]
SVG Filter feComponentTransfer

with use of function pointer
Comment 5 Dirk Schulze 2009-08-13 00:35:28 PDT
Comment on attachment 34427 [details]
SVG Filter feComponentTransfer

clearing review tag. I'll upload a more efficient version after the patch on bug 28133 is ready.
Comment 6 Dirk Schulze 2009-08-19 02:20:01 PDT
Created attachment 35111 [details]
SVG Filter feComponentTransfer

Make use of some recently added methods in FilterEffect and CanvasPixelArray.
Comment 7 Eric Seidel (no email) 2009-08-19 15:34:01 PDT
Comment on attachment 35111 [details]
SVG Filter feComponentTransfer

Clearing flags on attachment: 35111

Committed r47529: <http://trac.webkit.org/changeset/47529>
Comment 8 Eric Seidel (no email) 2009-08-19 15:34:07 PDT
All reviewed patches have been landed.  Closing bug.