| Flutter Impeller |

Public Member Functions | List of all members
impeller::TypefaceSkia Class Referencefinal

`#include <typeface_skia.h>`

Inheritance diagram for impeller::TypefaceSkia:

## Public Member Functions
| TypefaceSkia (sk_sp< SkTypeface > typeface)
| ~TypefaceSkia () override
bool | IsValid () const override
std::size_t | GetHash () const override
bool | IsEqual (const Typeface &other) const override
const sk_sp< SkTypeface > & | GetSkiaTypeface () const
Public Member Functions inherited from impeller::Typeface
| Typeface ()
virtual | ~Typeface ()
Public Member Functions inherited from impeller::Comparable< Typeface >
virtual std::size_t | GetHash () const=0

## Additional Inherited Members
Static Public Member Functions inherited from impeller::BackendCast< TypefaceSkia, Typeface >
static TypefaceSkia & | Cast (Typeface &base)
static const TypefaceSkia & | Cast (const Typeface &base)
static TypefaceSkia * | Cast (Typeface *base)
static const TypefaceSkia * | Cast (const Typeface *base)

## Detailed Description

Definition at line 16 of file typeface_skia.h.

## Constructor & Destructor Documentation

## ◆ TypefaceSkia()

impeller::TypefaceSkia::TypefaceSkia | ( | sk_sp< SkTypeface > | typeface | ) |
| explicit

Definition at line 9 of file typeface_skia.cc.

10 : typeface_(std::move(typeface)) {}

## ◆ ~TypefaceSkia()

impeller::TypefaceSkia::~TypefaceSkia | ( |  | ) |
| override default

## Member Function Documentation

## ◆ GetHash()

std::size_t impeller::TypefaceSkia::GetHash | ( |  | ) | const
| override

Definition at line 18 of file typeface_skia.cc.

18 {
19 if (!IsValid()) {
20 return 0u;
21 }
22
23 return reinterpret_cast<size_t>(typeface_.get());
24 }

References IsValid().

## ◆ GetSkiaTypeface()

const sk_sp< SkTypeface > & impeller::TypefaceSkia::GetSkiaTypeface | ( |  | ) | const

Definition at line 31 of file typeface_skia.cc.

31 {
32 return typeface_;
33 }

Referenced by impeller::DrawGlyph().

## ◆ IsEqual()

bool impeller::TypefaceSkia::IsEqual | ( | const Typeface & | other | ) | const
| override virtual

Implements impeller::Comparable< Typeface >.

Definition at line 26 of file typeface_skia.cc.

26 {
27 auto sk_other = reinterpret_cast<const TypefaceSkia*>(&other);
28 return sk_other->typeface_ == typeface_;
29 }

## ◆ IsValid()

bool impeller::TypefaceSkia::IsValid | ( |  | ) | const
| override virtual

Implements impeller::Typeface.

Definition at line 14 of file typeface_skia.cc.

14 {
15 return !!typeface_;
16 }

Referenced by GetHash().

The documentation for this class was generated from the following files:

- impeller/typographer/backends/skia/typeface_skia.h
- impeller/typographer/backends/skia/typeface_skia.cc

impeller::TypefaceSkia::TypefaceSkia
TypefaceSkia(sk_sp< SkTypeface > typeface)
Definition: typeface_skia.cc:9
impeller::TypefaceSkia::IsValid
bool IsValid() const override
Definition: typeface_skia.cc:14