Bug 27711 - SVG Filter need feColorMatrix implementation
Summary: SVG Filter need feColorMatrix implementation
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: Dirk Schulze
URL:
Keywords:
Depends on:
Blocks: 68469 26389
  Show dependency treegraph
 
Reported: 2009-07-27 06:54 PDT by Dirk Schulze
Modified: 2014-05-12 05:54 PDT (History)
4 users (show)

See Also:


Attachments
SVG feColorMatrix-implementation (5.79 KB, patch)
2009-07-27 07:05 PDT, Dirk Schulze
oliver: review-
Details | Formatted Diff | Diff
SVG feColorMatrix-implementation (6.58 KB, patch)
2009-08-04 00:37 PDT, Dirk Schulze
eric: review+
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-27 06:54:07 PDT
SVG Filter need feColorMatrix implementation
Comment 1 Dirk Schulze 2009-07-27 07:05:23 PDT
Created attachment 33543 [details]
SVG feColorMatrix-implementation

This is the implementation  of feColorMatrix.
Comment 2 Oliver Hunt 2009-07-28 11:41:49 PDT
Comment on attachment 33543 [details]
SVG feColorMatrix-implementation

Woo!  alas, the double casts here:
double red = (double)r, green = (double)g, blue = (double)b, alpha = (double)a;

are unnecessary

And I don't like having that switch in the middle of the main processing loop -- i'm not entirely sure what can be done to improve it short of something involving templates ;)
Comment 3 Eric Seidel (no email) 2009-07-28 11:48:01 PDT
The switch could be pulled out into a wrapper and a const function pointer used instead.  The compiler should be able to optimize the jump with a const function pointer, no?
Comment 4 Oliver Hunt 2009-07-28 11:52:30 PDT
I think not with gcc i don't think :D, i was thinking of templating on the operation type
Comment 5 Dirk Schulze 2009-08-04 00:37:42 PDT
Created attachment 34041 [details]
SVG feColorMatrix-implementation

SVG feColorMatrix-implementation with templates.
Comment 6 Eric Seidel (no email) 2009-08-06 19:54:56 PDT
Comment on attachment 34041 [details]
SVG feColorMatrix-implementation

Sigh.  We totally need Color accessors to:
127         srcPixelArray->get(pixelByteOffset, r);
 128         srcPixelArray->get(pixelByteOffset + 1, g);
 129         srcPixelArray->get(pixelByteOffset + 2, b);
 130         srcPixelArray->get(pixelByteOffset + 3, a);

Sigh.  I still think function pointers would be cleaner than templates.

I'll r+ this, but I definitely would prefer function pointers for this sort of thing.  Modern compilers should be able to handle the jump prediction.
Comment 7 Adam Barth 2009-08-07 17:49:58 PDT
Assigned to krit for landing.
Comment 8 Dirk Schulze 2009-08-08 13:40:29 PDT
landed in r46958.