ladybird/Userland/Libraries/LibGfx/Font/ScaledFontSkia.cpp
Aliaksandr Kalenik 1bd0871ed8 LibWeb+LibGfx: Use Skia for text rasterization
The main incentive is much better performance. We could have gone a bit
further in optimizing the Skia painter to blit glyphs produced by LibGfx
more efficiently from the glyph atlas, but eventually, we also want Skia
to improve correctness.

This change does not completely replace LibGfx in text handling. It's
still used at all stages, including layout, up until display list
replaying.
2024-07-27 08:18:54 +02:00

21 lines
421 B
C++

/*
* Copyright (c) 2024, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#define AK_DONT_REPLACE_STD
#include <core/SkFont.h>
#include <LibGfx/Font/ScaledFont.h>
namespace Gfx {
SkFont ScaledFont::skia_font(float scale) const
{
auto const& typeface = this->typeface().skia_typeface();
return SkFont { sk_ref_sp(typeface.ptr()), pixel_size() * scale };
}
}