Flutter Engine
The Flutter Engine
third_party
skia
tools
TestFontDataProvider.h
Go to the documentation of this file.
1
/*
2
* Copyright 2023 Google LLC
3
*
4
* Use of this source code is governed by a BSD-style license that can be
5
* found in the LICENSE file.
6
*/
7
8
#ifndef RasterTestData_DEFINED
9
#define RasterTestData_DEFINED
10
11
#include "
include/core/SkString.h
"
12
#include "
src/utils/SkJSON.h
"
13
14
#include <regex>
15
#include <string>
16
17
// Iterates over test data from the font tests CIPD, allows filtering for fonts and test samples
18
// languages using C++ regular expressions.
19
class
TestFontDataProvider
{
20
public
:
21
struct
LangSample
{
22
SkString
langTag
;
23
SkString
sampleShort
;
24
SkString
sampleLong
;
25
};
26
27
struct
TestSet
{
28
SkString
fontName
;
29
SkString
fontFilename
;
30
std::vector<LangSample>
langSamples
;
31
};
32
33
TestFontDataProvider
(
const
std::string& fontFilterRegexp,
const
std::string& langFilterRegexp);
34
35
bool
next
(
TestSet
*
testSet
);
36
37
void
rewind
();
38
39
private
:
40
std::vector<LangSample> getLanguageSamples(
const
skjson::ArrayValue
* languages);
41
std::regex
fFontFilter;
42
std::regex
fLangFilter;
43
size_t
fFontsIndex = 0;
44
std::unique_ptr<skjson::DOM> fJsonDom;
45
const
skjson::ArrayValue
* fFonts;
46
const
skjson::ObjectValue
* fSamples;
47
};
48
49
namespace
skiatest
{
50
51
/**
52
* Set font test data directory. Overrides the location of the extracted googlefonts_testdata CIPD
53
* archive.
54
*/
55
void
SetFontTestDataDirectory
();
56
57
}
// namespace skiatest
58
59
#endif
testSet
static const ConicPts testSet[]
Definition:
PathOpsConicIntersectionTest.cpp:28
SkJSON.h
SkString.h
SkString
Definition:
SkString.h:118
TestFontDataProvider
Definition:
TestFontDataProvider.h:19
TestFontDataProvider::next
bool next(TestSet *testSet)
Definition:
TestFontDataProvider.cpp:73
TestFontDataProvider::rewind
void rewind()
Definition:
TestFontDataProvider.cpp:94
TestFontDataProvider::TestFontDataProvider
TestFontDataProvider(const std::string &fontFilterRegexp, const std::string &langFilterRegexp)
Definition:
TestFontDataProvider.cpp:52
skjson::ArrayValue
Definition:
SkJSON.h:287
skjson::ObjectValue
Definition:
SkJSON.h:337
dart_profiler_symbols.regex
regex
Definition:
dart_profiler_symbols.py:61
skiatest
Definition:
DMGpuTestProcs.cpp:27
skiatest::SetFontTestDataDirectory
void SetFontTestDataDirectory()
Definition:
TestFontDataProvider.cpp:25
TestFontDataProvider::LangSample
Definition:
TestFontDataProvider.h:21
TestFontDataProvider::LangSample::sampleShort
SkString sampleShort
Definition:
TestFontDataProvider.h:23
TestFontDataProvider::LangSample::langTag
SkString langTag
Definition:
TestFontDataProvider.h:22
TestFontDataProvider::LangSample::sampleLong
SkString sampleLong
Definition:
TestFontDataProvider.h:24
TestFontDataProvider::TestSet
Definition:
TestFontDataProvider.h:27
TestFontDataProvider::TestSet::fontName
SkString fontName
Definition:
TestFontDataProvider.h:28
TestFontDataProvider::TestSet::langSamples
std::vector< LangSample > langSamples
Definition:
TestFontDataProvider.h:30
TestFontDataProvider::TestSet::fontFilename
SkString fontFilename
Definition:
TestFontDataProvider.h:29
Generated on Sun Jun 23 2024 21:56:51 for Flutter Engine by
1.9.4