aboutsummaryrefslogtreecommitdiff
path: root/tests/FontMgrTest.cpp
diff options
context:
space:
mode:
authorKevin Lubick <kjlubick@google.com>2023-11-10 18:14:19 +0000
committerSkCQ <skcq-be@skia-corp.google.com.iam.gserviceaccount.com>2023-11-10 18:15:45 +0000
commit579809c387e8b80458961523d0e4ddc6fd433b5d (patch)
tree11594117be114e1c64a2b52bc3385e30dc2ca1d5 /tests/FontMgrTest.cpp
parente100c93f833ff39c9515f835f1f948066e90b7b0 (diff)
downloadskia-579809c387e8b80458961523d0e4ddc6fd433b5d.tar.gz
Revert "Reland "Migrate many direct and indirect uses of SkFontMgr to use TestFontMgr""
This reverts commit bea8af81c35eb402ceaf2a12b4aaaebcd97015a1. Reason for revert: MSAN and ChromeOS Perf failing Original change's description: > Reland "Migrate many direct and indirect uses of SkFontMgr to use TestFontMgr" > > This is a reland of commit 3258c98d2edf072073d0e98d79d59e3458b77089 > > It introduces SK_FONTMGR_*_AVAILABLE defines, such that FonToolUtils.cpp > (and our clients) can detect at compile time what GN or Bazel depends > on (by exporting those defines when depended upon). This avoids us > having to make opinionated decisions based on the target platform > (which was causing issues with ChromeOS and Android Framework). > > Original change's description: > > Migrate many direct and indirect uses of SkFontMgr to use TestFontMgr > > > > This removes most direct (e.g. SkFontMgr::RefDefault) or indirect > > (e.g. SkTypeface::MakeFromData) uses of the default SkFontMgr in Skia. > > > > There are a few other cases that impact public APIs or could impact > > current clients, which will be handled separately (e.g. Skottie) > > > > Suggested Reading Order: > > - tools/fonts/FontToolUtils.cpp to see that this absorbed > > tools/flags/CommonFlagsFontMgr.cpp and the two flags which > > controlled FontMgrs. Notice this no longer needs an initialization > > call, because the first call to ToolUtils::TestFontMgr() will > > lazily read and apply these flags. > > - tools/fiddle/* to see a new fontMgr global variable is made > > available, which is *always* the FontConfig one, due to the > > fact that fiddle only runs on Linux (and there are no plans > > to change that). > > - Remaining deleted files - these had bitrotting code related to > > fonts that was identified via grep and deemed not worth fixing > > since it is not being compiled anyway. > > - fuzz/ to see many of these now have a convenient function to > > call to explicitly set up the portable fontmgr. With this > > and the addition of ToolUtils::FontMgrIsGDI(), src/core/SkFontMgrPriv.h > > is no longer used (outside of the #define guarded, deprecated > > FontMgr Factory functions). > > - Other files in any order - these remaining changes were pretty > > mechanical. > > > > See also: > > - http://review.skia.org/772660 > > - http://review.skia.org/772903 > > > > Bug: b/305780908 > > Change-Id: I46a43750ebfd9f9dbe743931cb99a5fe70a0dc0c > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/772659 > > Commit-Queue: Kevin Lubick <kjlubick@google.com> > > Reviewed-by: Ben Wagner <bungeman@google.com> > > Bug: b/305780908 > Change-Id: I361ddaa56250f76a66104ddf8a8b29942d13838b > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/775996 > Reviewed-by: Ben Wagner <bungeman@google.com> Bug: b/305780908 Change-Id: Ib9b4a4271a5cfe292129ff9acc8154e08523b467 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/c/skia/+/777322 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Auto-Submit: Kevin Lubick <kjlubick@google.com> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Diffstat (limited to 'tests/FontMgrTest.cpp')
-rw-r--r--tests/FontMgrTest.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/FontMgrTest.cpp b/tests/FontMgrTest.cpp
index 48343bb099..1efc8b769b 100644
--- a/tests/FontMgrTest.cpp
+++ b/tests/FontMgrTest.cpp
@@ -77,14 +77,14 @@ DEF_TEST(FontMgr_AliasNames, reporter) {
};
for (size_t i = 0; i < std::size(inNames); ++i) {
- sk_sp<SkTypeface> first(ToolUtils::CreateTestTypeface(inNames[i], SkFontStyle()));
+ sk_sp<SkTypeface> first(SkTypeface::MakeFromName(inNames[i], SkFontStyle()));
if (nullptr == first.get()) {
continue;
}
SkString firstName;
first->getFamilyName(&firstName);
for (int j = 0; j < 10; ++j) {
- sk_sp<SkTypeface> face(ToolUtils::CreateTestTypeface(inNames[i], SkFontStyle()));
+ sk_sp<SkTypeface> face(SkTypeface::MakeFromName(inNames[i], SkFontStyle()));
SkString name;
face->getFamilyName(&name);
@@ -96,7 +96,7 @@ DEF_TEST(FontMgr_AliasNames, reporter) {
}
DEF_TEST(FontMgr_Iter, reporter) {
- sk_sp<SkFontMgr> fm(ToolUtils::TestFontMgr());
+ sk_sp<SkFontMgr> fm(SkFontMgr::RefDefault());
int count = fm->countFamilies();
for (int i = 0; i < count; ++i) {
@@ -154,13 +154,13 @@ DEF_TEST(FontMgr_Iter, reporter) {
}
DEF_TEST(FontMgr_Match, reporter) {
- sk_sp<SkFontMgr> fm(ToolUtils::TestFontMgr());
+ sk_sp<SkFontMgr> fm(SkFontMgr::RefDefault());
sk_sp<SkFontStyleSet> styleSet(fm->matchFamily(nullptr));
REPORTER_ASSERT(reporter, styleSet);
}
DEF_TEST(FontMgr_MatchFamilyStyle, reporter) {
- sk_sp<SkFontMgr> fm(ToolUtils::TestFontMgr());
+ sk_sp<SkFontMgr> fm(SkFontMgr::RefDefault());
sk_sp<SkFontStyleSet> styleSet(fm->matchFamily("Non Existing Family Name"));
REPORTER_ASSERT(reporter, styleSet);
@@ -795,7 +795,7 @@ DEF_TEST(FontMgr_MatchStyleCSS3, reporter) {
}
DEF_TEST(FontMgr_MatchCharacter, reporter) {
- sk_sp<SkFontMgr> fm(ToolUtils::TestFontMgr());
+ sk_sp<SkFontMgr> fm(SkFontMgr::RefDefault());
// 0xD800 <= codepoint <= 0xDFFF || 0x10FFFF < codepoint are invalid
fm->matchFamilyStyleCharacter("Blah", SkFontStyle::Normal(), nullptr, 0, 0x0);
fm->matchFamilyStyleCharacter("Blah", SkFontStyle::Normal(), nullptr, 0, 0xD800);