2021-09-17 07:31:48 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2021, Ali Mohammad Pur <mpfard@serenityos.org>
|
2022-03-10 02:21:02 +00:00
|
|
|
* Copyright (c) 2022, Ben Maxwell <macdue@dueutil.tech>
|
2022-08-23 17:12:04 +00:00
|
|
|
* Copyright (c) 2022, Torsten Engelmann <engelTorsten@gmx.de>
|
2021-09-17 07:31:48 +00:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
2022-10-04 19:04:13 +00:00
|
|
|
#if defined(AK_COMPILER_GCC)
|
2022-04-10 16:43:39 +00:00
|
|
|
# pragma GCC optimize("O3")
|
|
|
|
#endif
|
|
|
|
|
2021-09-17 07:31:48 +00:00
|
|
|
#include <AK/Function.h>
|
2022-03-21 01:46:46 +00:00
|
|
|
#include <AK/NumericLimits.h>
|
2021-09-17 07:31:48 +00:00
|
|
|
#include <LibGfx/AntiAliasingPainter.h>
|
2024-07-05 08:40:29 +00:00
|
|
|
#include <LibGfx/DeprecatedPainter.h>
|
2022-08-23 17:12:04 +00:00
|
|
|
#include <LibGfx/Line.h>
|
2021-09-17 07:31:48 +00:00
|
|
|
|
2022-06-18 01:32:01 +00:00
|
|
|
namespace Gfx {
|
|
|
|
|
2024-08-08 08:22:03 +00:00
|
|
|
void AntiAliasingPainter::stroke_path(DeprecatedPath const& path, Color color, float thickness)
|
2021-09-17 07:31:48 +00:00
|
|
|
{
|
2023-07-16 15:22:56 +00:00
|
|
|
if (thickness <= 0)
|
|
|
|
return;
|
2023-06-05 20:44:26 +00:00
|
|
|
// FIXME: Cache this? Probably at a higher level such as in LibWeb?
|
|
|
|
fill_path(path.stroke_to_fill(thickness), color);
|
2021-09-17 14:12:30 +00:00
|
|
|
}
|
2022-03-10 02:21:02 +00:00
|
|
|
|
2024-08-08 08:22:03 +00:00
|
|
|
void AntiAliasingPainter::stroke_path(DeprecatedPath const& path, Gfx::PaintStyle const& paint_style, float thickness, float opacity)
|
2023-06-06 19:38:48 +00:00
|
|
|
{
|
2023-07-16 15:22:56 +00:00
|
|
|
if (thickness <= 0)
|
|
|
|
return;
|
2023-06-06 19:38:48 +00:00
|
|
|
// FIXME: Cache this? Probably at a higher level such as in LibWeb?
|
2023-06-11 13:04:32 +00:00
|
|
|
fill_path(path.stroke_to_fill(thickness), paint_style, opacity);
|
2023-06-06 19:38:48 +00:00
|
|
|
}
|
|
|
|
|
2022-06-18 01:32:01 +00:00
|
|
|
}
|