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

LibGfx: Move TTF::Rasterizer to its own files

The custom TTF path rasterizer is actually generic enough for it to be
used for other fonts. To make this more clear, it now lives on its own
in the "Font" directory.
This commit is contained in:
Julian Offenhäuser 2022-11-17 23:14:24 +01:00 committed by Andreas Kling
parent d444724d24
commit 0b6299849e
5 changed files with 179 additions and 151 deletions

View file

@ -0,0 +1,28 @@
/*
* Copyright (c) 2020, Srimanta Barua <srimanta.barua1@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Vector.h>
#include <LibGfx/Bitmap.h>
#include <LibGfx/Path.h>
namespace Gfx {
class PathRasterizer {
public:
PathRasterizer(Gfx::IntSize);
void draw_path(Gfx::Path&);
RefPtr<Gfx::Bitmap> accumulate();
private:
void draw_line(Gfx::FloatPoint, Gfx::FloatPoint);
Gfx::IntSize m_size;
Vector<float> m_data;
};
}