servo / pathfinder

A fast, practical GPU rasterizer for fonts and vector graphics
Apache License 2.0
3.6k stars 201 forks source link

Implement more filter effects #400

Open Herschel opened 4 years ago

Herschel commented 4 years ago

Currently Pathfinder only supports blur. Pathfinder could support more of the filters from the SVG spec: https://www.w3.org/TR/SVG11/filters.html

Additionally, it'd be useful to support multiple filters simultaneously; currently Pattern only allows for a single filter. As a separate use case, Flash content allows for a color transform to be applied to any shape (mult * inColor + add) as well as various filter effects, such as blur and drop shadow. Multiple filters can be applied to a single object.

pcwalton commented 4 years ago

Which filters does Flash need that aren't already implemented?

Herschel commented 4 years ago

Here's a list of all the filter effects Flash supports, along with the SVG counterpart:

The most important are color transforms, which were not technically a filter in Flash land and exist in most Flash content. These could be implemented using feColorMatrix.

pcwalton commented 4 years ago

536cb4c0936cac9d3dcb03bee22335d8b5df257d implements color matrix.