LibGfx: Remove unused dpi_x/dpi_y params and m_x_scale/m_y_scale

This commit is contained in:
Aliaksandr Kalenik 2026-05-13 03:08:31 +02:00 committed by Alexander Kalenik
parent 0166f555eb
commit 22fc50e606
3 changed files with 3 additions and 9 deletions

View file

@ -25,7 +25,7 @@ namespace Gfx {
static Atomic<u64> s_next_id { 1 };
Font::Font(NonnullRefPtr<Typeface const> typeface, float point_width, float point_height, unsigned dpi_x, unsigned dpi_y, FontVariationSettings const variations, ShapeFeatures const& features)
Font::Font(NonnullRefPtr<Typeface const> typeface, float point_width, float point_height, FontVariationSettings const variations, ShapeFeatures const& features)
: m_id(s_next_id.fetch_add(1, AK::MemoryOrder::memory_order_relaxed))
, m_typeface(move(typeface))
, m_point_width(point_width)
@ -33,10 +33,6 @@ Font::Font(NonnullRefPtr<Typeface const> typeface, float point_width, float poin
, m_font_variation_settings(move(variations))
, m_shape_features(features)
{
float const units_per_em = m_typeface->units_per_em();
m_x_scale = (point_width * dpi_x) / (POINTS_PER_INCH * units_per_em);
m_y_scale = (point_height * dpi_y) / (POINTS_PER_INCH * units_per_em);
m_pixel_size = m_point_height * (DEFAULT_DPI / POINTS_PER_INCH);
auto const* sk_typeface = as<TypefaceSkia>(*m_typeface).sk_typeface();

View file

@ -51,7 +51,7 @@ constexpr float text_shaping_resolution = 64;
class Font : public AtomicRefCounted<Font> {
public:
Font(NonnullRefPtr<Typeface const>, float point_width, float point_height, unsigned dpi_x, unsigned dpi_y, FontVariationSettings const variations, ShapeFeatures const& features);
Font(NonnullRefPtr<Typeface const>, float point_width, float point_height, FontVariationSettings const variations, ShapeFeatures const& features);
~Font();
u64 id() const { return m_id; }
@ -99,8 +99,6 @@ private:
mutable TriState m_is_emoji_font { TriState::Unknown };
NonnullRefPtr<Typeface const> m_typeface;
float m_x_scale { 0.0f };
float m_y_scale { 0.0f };
float m_point_width { 0.0f };
float m_point_height { 0.0f };
FontVariationSettings const m_font_variation_settings;

View file

@ -70,7 +70,7 @@ NonnullRefPtr<Font> Typeface::font(float point_size, FontVariationSettings const
used_typeface = move(derived);
}
auto font = adopt_ref(*new Font(*used_typeface, point_size, point_size, DEFAULT_DPI, DEFAULT_DPI, variations, shape_features));
auto font = adopt_ref(*new Font(*used_typeface, point_size, point_size, variations, shape_features));
m_fonts.set(key, font);
return font;
}