Bug 27768 - SVG feComponentTransfer needs to be implemented
Summary: SVG feComponentTransfer needs to be implemented
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 68469 26389
  Show dependency treegraph
 
Reported: 2009-07-28 09:41 PDT by Dirk Schulze
Modified: 2014-05-12 05:54 PDT (History)
2 users (show)

See Also:


Attachments
SVG Filter feComponentTransfer (6.35 KB, patch)
2009-07-28 13:02 PDT, Dirk Schulze
eric: review-
Details | Formatted Diff | Diff
SVG Filter feComponentTransfer (7.80 KB, patch)
2009-08-09 11:27 PDT, Dirk Schulze
no flags Details | Formatted Diff | Diff
SVG Filter feComponentTransfer (5.62 KB, patch)
2009-08-19 02:20 PDT, Dirk Schulze
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.