mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-27 02:20:17 +00:00
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.
21 lines
421 B
C++
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 };
|
|
}
|
|
|
|
}
|