1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:17:35 +00:00

LibGfx: Make all fill_path() code member functions and move into .cpp

This makes all the code for fill_path() member functions of the painter,
and moves them into a new FillPathImplementation.cpp. This allows us
to avoid polluting Painter.h with implementation details, and makes
the edit, compile, retry loop much shorter.
This commit is contained in:
MacDue 2023-03-11 16:50:54 +00:00 committed by Linus Groh
parent b1a72d66f6
commit a425b6f772
5 changed files with 122 additions and 103 deletions

View file

@ -10,7 +10,6 @@
# pragma GCC optimize("O3")
#endif
#include "FillPathImplementation.h"
#include <AK/Function.h>
#include <AK/NumericLimits.h>
#include <LibGfx/AntiAliasingPainter.h>
@ -213,14 +212,12 @@ void AntiAliasingPainter::draw_line(FloatPoint actual_from, FloatPoint actual_to
void AntiAliasingPainter::fill_path(Path const& path, Color color, Painter::WindingRule rule)
{
Detail::fill_path<Detail::FillPathMode::AllowFloatingPoints>(m_underlying_painter, path, color, rule, m_transform.translation());
m_underlying_painter.antialiased_fill_path(path, color, rule, m_transform.translation());
}
void AntiAliasingPainter::fill_path(Path const& path, PaintStyle const& paint_style, Painter::WindingRule rule)
{
paint_style.paint(enclosing_int_rect(path.bounding_box()), [&](PaintStyle::SamplerFunction sampler) {
Detail::fill_path<Detail::FillPathMode::AllowFloatingPoints>(m_underlying_painter, path, move(sampler), rule, m_transform.translation());
});
m_underlying_painter.antialiased_fill_path(path, paint_style, rule, m_transform.translation());
}
void AntiAliasingPainter::stroke_path(Path const& path, Color color, float thickness)