mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:57: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:
parent
b1a72d66f6
commit
a425b6f772
5 changed files with 122 additions and 103 deletions
|
@ -27,7 +27,6 @@
|
|||
#include <AK/Utf32View.h>
|
||||
#include <AK/Utf8View.h>
|
||||
#include <LibGfx/CharacterBitmap.h>
|
||||
#include <LibGfx/FillPathImplementation.h>
|
||||
#include <LibGfx/Palette.h>
|
||||
#include <LibGfx/Path.h>
|
||||
#include <LibGfx/Quad.h>
|
||||
|
@ -2390,20 +2389,6 @@ void Painter::stroke_path(Path const& path, Color color, int thickness)
|
|||
}
|
||||
}
|
||||
|
||||
void Painter::fill_path(Path const& path, Color color, WindingRule winding_rule)
|
||||
{
|
||||
VERIFY(scale() == 1); // FIXME: Add scaling support.
|
||||
Detail::fill_path<Detail::FillPathMode::PlaceOnIntGrid>(*this, path, color, winding_rule);
|
||||
}
|
||||
|
||||
void Painter::fill_path(Path const& path, PaintStyle const& paint_style, Painter::WindingRule rule)
|
||||
{
|
||||
VERIFY(scale() == 1); // FIXME: Add scaling support.
|
||||
paint_style.paint(enclosing_int_rect(path.bounding_box()), [&](PaintStyle::SamplerFunction sampler) {
|
||||
Detail::fill_path<Detail::FillPathMode::PlaceOnIntGrid>(*this, path, move(sampler), rule);
|
||||
});
|
||||
}
|
||||
|
||||
void Painter::blit_disabled(IntPoint location, Gfx::Bitmap const& bitmap, IntRect const& rect, Palette const& palette)
|
||||
{
|
||||
auto bright_color = palette.threed_highlight();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue