| 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 #pragma once
6
7 #include "flutter/fml/macros.h"
8 #include "impeller/base/backend_cast.h"
9 #include "impeller/typographer/typeface.h"
10 #include "third_party/skia/include/core/SkRefCnt.h"
11 #include "third_party/skia/include/core/SkTypeface.h"
12
13 namespace impeller {
14
15 class TypefaceSkia final : public Typeface,
16 public BackendCast<TypefaceSkia, Typeface> {
17 public:
18 TypefaceSkia(sk_sp<SkTypeface> typeface);
19
20 ~TypefaceSkia() override;
21
22 // |Typeface|
23 bool IsValid() const override;
24
25 // |Comparable<Typeface>|
26 std::size_t GetHash() const override;
27
28 // |Comparable<Typeface>|
29 bool IsEqual(const Typeface& other) const override;
30
31 const sk_sp<SkTypeface>& GetSkiaTypeface() const;
32
33 private:
34 sk_sp<SkTypeface> typeface_;
35
36 FML_DISALLOW_COPY_AND_ASSIGN(TypefaceSkia);
37 };
38
39 } // namespace impeller
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:15
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:19
typeface.h
impeller::BackendCast
Definition: backend_cast.h:12
impeller::TypefaceSkia::~TypefaceSkia
~TypefaceSkia() override
impeller::TypefaceSkia::IsValid
bool IsValid() const override
Definition: typeface_skia.cc:14
impeller
Definition: aiks_context.cc:10