Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
impeller::TypefaceSkia Class Referencefinal

#include <typeface_skia.h>

Inheritance diagram for impeller::TypefaceSkia:
impeller::Typeface impeller::BackendCast< TypefaceSkia, Typeface > impeller::Comparable< Typeface > impeller::ComparableBase

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 ()
 

Additional Inherited Members

- Static Public Member Functions inherited from impeller::BackendCast< TypefaceSkia, Typeface >
static TypefaceSkiaCast (Typeface &base)
 
static const TypefaceSkiaCast (const Typeface &base)
 
static TypefaceSkiaCast (Typeface *base)
 
static const TypefaceSkiaCast (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 ( )
overridedefault

Member Function Documentation

◆ GetHash()

std::size_t impeller::TypefaceSkia::GetHash ( ) const
overridevirtual

Implements impeller::Comparable< Typeface >.

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}
bool IsValid() const override
T * get() const
Definition SkRefCnt.h:303

◆ GetSkiaTypeface()

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

Definition at line 31 of file typeface_skia.cc.

31 {
32 return typeface_;
33}

◆ IsEqual()

bool impeller::TypefaceSkia::IsEqual ( const Typeface other) const
overridevirtual

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}
TypefaceSkia(sk_sp< SkTypeface > typeface)

◆ IsValid()

bool impeller::TypefaceSkia::IsValid ( ) const
overridevirtual

Implements impeller::Typeface.

Definition at line 14 of file typeface_skia.cc.

14 {
15 return !!typeface_;
16}

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