SVG Filter need feColorMatrix implementation
Created attachment 33543 [details]
This is the implementation of feColorMatrix.
Comment on attachment 33543 [details]
Woo! alas, the double casts here:
double red = (double)r, green = (double)g, blue = (double)b, alpha = (double)a;
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 ;)
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?
I think not with gcc i don't think :D, i was thinking of templating on the operation type
Created attachment 34041 [details]
SVG feColorMatrix-implementation with templates.
Comment on attachment 34041 [details]
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.
Assigned to krit for landing.
landed in r46958.