Flutter Impeller
typeface_skia.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef FLUTTER_IMPELLER_TYPOGRAPHER_BACKENDS_SKIA_TYPEFACE_SKIA_H_
6 #define FLUTTER_IMPELLER_TYPOGRAPHER_BACKENDS_SKIA_TYPEFACE_SKIA_H_
7 
8 #include "flutter/fml/macros.h"
11 #include "third_party/skia/include/core/SkRefCnt.h"
12 #include "third_party/skia/include/core/SkTypeface.h"
13 
14 namespace impeller {
15 
16 class TypefaceSkia final : public Typeface,
17  public BackendCast<TypefaceSkia, Typeface> {
18  public:
19  explicit TypefaceSkia(sk_sp<SkTypeface> typeface);
20 
21  ~TypefaceSkia() override;
22 
23  // |Typeface|
24  bool IsValid() const override;
25 
26  // |Comparable<Typeface>|
27  std::size_t GetHash() const override;
28 
29  // |Comparable<Typeface>|
30  bool IsEqual(const Typeface& other) const override;
31 
32  const sk_sp<SkTypeface>& GetSkiaTypeface() const;
33 
34  private:
35  sk_sp<SkTypeface> typeface_;
36 
37  TypefaceSkia(const TypefaceSkia&) = delete;
38 
39  TypefaceSkia& operator=(const TypefaceSkia&) = delete;
40 };
41 
42 } // namespace impeller
43 
44 #endif // FLUTTER_IMPELLER_TYPOGRAPHER_BACKENDS_SKIA_TYPEFACE_SKIA_H_
impeller::TypefaceSkia::IsEqual
bool IsEqual(const Typeface &other) const override
Definition: typeface_skia.cc:26
impeller::TypefaceSkia::GetHash
std::size_t GetHash() const override
Definition: typeface_skia.cc:18
impeller::TypefaceSkia::TypefaceSkia
TypefaceSkia(sk_sp< SkTypeface > typeface)
Definition: typeface_skia.cc:9
impeller::TypefaceSkia
Definition: typeface_skia.h:16
impeller::TypefaceSkia::GetSkiaTypeface
const sk_sp< SkTypeface > & GetSkiaTypeface() const
Definition: typeface_skia.cc:31
backend_cast.h
impeller::Typeface
A typeface, usually obtained from a font-file, on disk describes the intrinsic properties of the font...
Definition: typeface.h:20
typeface.h
impeller::BackendCast
Definition: backend_cast.h:11
impeller::TypefaceSkia::~TypefaceSkia
~TypefaceSkia() override
impeller::TypefaceSkia::IsValid
bool IsValid() const override
Definition: typeface_skia.cc:14
impeller
Definition: aiks_blur_unittests.cc:20