mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibGfx: Add fast_is<T> optimization for Typeface and TypefaceSkia
This commit is contained in:
parent
bc368110ab
commit
4eca3781c7
|
|
@ -55,6 +55,11 @@ public:
|
|||
|
||||
hb_face_t* harfbuzz_typeface() const;
|
||||
|
||||
template<typename T>
|
||||
bool fast_is() const = delete;
|
||||
|
||||
virtual bool is_skia() const { return false; }
|
||||
|
||||
protected:
|
||||
Typeface();
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ private:
|
|||
|
||||
explicit TypefaceSkia(NonnullOwnPtr<Impl>, ReadonlyBytes, int ttc_index = 0);
|
||||
|
||||
virtual bool is_skia() const override { return true; }
|
||||
|
||||
ReadonlyBytes m_buffer;
|
||||
unsigned m_ttc_index { 0 };
|
||||
|
||||
|
|
@ -57,4 +59,7 @@ private:
|
|||
void populate_glyph_page(GlyphPage&, size_t page_index) const;
|
||||
};
|
||||
|
||||
template<>
|
||||
inline bool Typeface::fast_is<TypefaceSkia>() const { return is_skia(); }
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user