mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:37:44 +00:00
LibGfx: Speed up filling solid colors in path rasterizer
For solid color fills (with alpha = 255), the rasterizer now tracks spans of solid colors within a scanline and fills the entire span with a single call to fast_u32_fill(). This gave up to a 1.5x speedup drawing the Ghostscript Tiger within SerenityOS.
This commit is contained in:
parent
2fa488cfa9
commit
096bdb142b
2 changed files with 106 additions and 34 deletions
|
@ -167,10 +167,17 @@ private:
|
|||
|
||||
void fill_internal(Painter&, Path const&, auto color_or_function, Painter::WindingRule, FloatPoint offset);
|
||||
Detail::Edge* plot_edges_for_scanline(int scanline, auto plot_edge, EdgeExtent&, Detail::Edge* active_edges = nullptr);
|
||||
void accumulate_even_odd_scanline(Painter&, int scanline, EdgeExtent, auto& color_or_function);
|
||||
void accumulate_non_zero_scanline(Painter&, int scanline, EdgeExtent, auto& color_or_function);
|
||||
|
||||
template<Painter::WindingRule>
|
||||
void write_scanline(Painter&, int scanline, EdgeExtent, auto& color_or_function);
|
||||
Color scanline_color(int scanline, int offset, u8 alpha, auto& color_or_function);
|
||||
void write_pixel(Painter&, int scanline, int offset, SampleType sample, auto& color_or_function);
|
||||
void fast_fill_solid_color_span(Painter&, int scanline, int start, int end, Color color);
|
||||
|
||||
template<Painter::WindingRule, typename Callback>
|
||||
void accumulate_scanline(EdgeExtent, Callback);
|
||||
void accumulate_even_odd_scanline(EdgeExtent, auto sample_callback);
|
||||
void accumulate_non_zero_scanline(EdgeExtent, auto sample_callback);
|
||||
|
||||
struct WindingCounts {
|
||||
// NOTE: This only allows up to 256 winding levels. Increase this if required (i.e. to an i16).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue