forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_font_selector.h
42 lines (28 loc) · 1.11 KB
/
test_font_selector.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_RUNTIME_TEST_FONT_SELECTOR_H_
#define FLUTTER_RUNTIME_TEST_FONT_SELECTOR_H_
#include "flutter/sky/engine/platform/fonts/FontSelector.h"
#include "flutter/sky/engine/wtf/RefPtr.h"
#include "lib/ftl/macros.h"
#include "third_party/skia/include/core/SkTypeface.h"
namespace blink {
class TestFontSelector : public FontSelector {
public:
static void Install();
~TestFontSelector() override;
PassRefPtr<FontData> getFontData(const FontDescription&,
const AtomicString& familyName) override;
void willUseFontData(const FontDescription&,
const AtomicString& familyName,
UChar32) override;
unsigned version() const override;
void fontCacheInvalidated() override;
private:
sk_sp<SkTypeface> test_typeface_;
TestFontSelector();
FTL_DISALLOW_COPY_AND_ASSIGN(TestFontSelector);
};
} // namespace blink
#endif // FLUTTER_RUNTIME_TEST_FONT_SELECTOR_H_