Kevin Lubick 92bce6db0e Replace all calls to SkTypeface::Make with SkFontMgr ones (flutter/engine#48319)
Similar to https://github.com/flutter/engine/pull/48179, Flutter needs
to stop depending on the default font manager, which the
`SkTypeface::Make*` calls do implicitly

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide] and the [C++,
Objective-C, Java style guides].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I added new tests to check the change I am making or feature I am
adding, or the PR is [test-exempt]. See [testing the engine] for
instructions on writing and running engine tests.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I signed the [CLA].
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2023-11-28 07:08:35 -05:00

205 lines
5.2 KiB
Plaintext

# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//flutter/common/config.gni")
import("//flutter/testing/testing.gni")
source_set("test_font") {
sources = [
"test_font_data.cc",
"test_font_data.h",
]
deps = [
"//flutter/skia",
"//flutter/third_party/txt",
]
public_configs = [ "//flutter:config" ]
defines = []
if (flutter_runtime_mode == "debug" || current_toolchain == host_toolchain) {
# Though the test font data is small, we dont want to add to the binary size
# on the device (in profile and release modes). We only add the same on the
# host test shells and the debug device shell.
defines += [ "EMBED_TEST_FONT_DATA=1" ]
}
}
# Picks the libdart implementation based on the Flutter runtime mode.
group("libdart") {
public_deps = []
if (flutter_runtime_mode == "profile" || flutter_runtime_mode == "release") {
public_deps += [ "//third_party/dart/runtime:libdart_precompiled_runtime" ]
} else {
public_deps += [
"//flutter/lib/snapshot",
"//third_party/dart/runtime:libdart_jit",
]
}
}
source_set("dart_plugin_registrant") {
sources = [
"dart_plugin_registrant.cc",
"dart_plugin_registrant.h",
]
deps = [
"//flutter/fml",
"//flutter/third_party/tonic",
"//third_party/dart/runtime:dart_api",
]
}
source_set("runtime") {
sources = [
"dart_isolate.cc",
"dart_isolate.h",
"dart_isolate_group_data.cc",
"dart_isolate_group_data.h",
"dart_service_isolate.cc",
"dart_service_isolate.h",
"dart_snapshot.cc",
"dart_snapshot.h",
"dart_timestamp_provider.cc",
"dart_timestamp_provider.h",
"dart_vm.cc",
"dart_vm.h",
"dart_vm_data.cc",
"dart_vm_data.h",
"dart_vm_initializer.cc",
"dart_vm_initializer.h",
"dart_vm_lifecycle.cc",
"dart_vm_lifecycle.h",
"embedder_resources.cc",
"embedder_resources.h",
"isolate_configuration.cc",
"isolate_configuration.h",
"platform_data.cc",
"platform_data.h",
"ptrace_check.h",
"runtime_controller.cc",
"runtime_controller.h",
"runtime_delegate.cc",
"runtime_delegate.h",
"service_protocol.cc",
"service_protocol.h",
"skia_concurrent_executor.cc",
"skia_concurrent_executor.h",
]
if (is_ios && flutter_runtime_mode == "debug") {
# These contain references to private APIs and this TU must only be compiled in debug runtime modes.
sources += [ "ptrace_check.cc" ]
}
public_deps = [
"//flutter/lib/gpu",
"//flutter/lib/ui",
"//flutter/third_party/rapidjson",
]
public_configs = [ "//flutter:config" ]
deps = [
":dart_plugin_registrant",
":test_font",
"//flutter/assets",
"//flutter/common",
"//flutter/flow",
"//flutter/fml",
"//flutter/lib/io",
"//flutter/shell/common:display",
"//flutter/skia",
"//flutter/third_party/tonic",
"//flutter/third_party/txt",
"//third_party/dart/runtime:dart_api",
"//third_party/dart/runtime/bin:dart_io_api",
]
if (flutter_runtime_mode != "release" && !is_fuchsia) {
# Only link in Observatory in non-release modes on non-Fuchsia. Fuchsia
# instead puts Observatory into the runner's package.
deps += [
"//third_party/dart/runtime/observatory:embedded_observatory_archive",
]
}
}
if (enable_unittests) {
test_fixtures("runtime_fixtures") {
dart_main = "fixtures/runtime_test.dart"
}
executable("runtime_unittests") {
testonly = true
sources = [
"dart_isolate_unittests.cc",
"dart_lifecycle_unittests.cc",
"dart_service_isolate_unittests.cc",
"dart_vm_unittests.cc",
"type_conversions_unittests.cc",
]
public_configs = [ "//flutter:export_dynamic_symbols" ]
public_deps = [
":libdart",
":runtime",
":runtime_fixtures",
"//flutter/common",
"//flutter/fml",
"//flutter/lib/snapshot",
"//flutter/skia",
"//flutter/testing",
"//flutter/testing:dart",
"//flutter/testing:fixture_test",
"//flutter/third_party/tonic",
"//third_party/dart/runtime/bin:elf_loader",
]
}
test_fixtures("no_plugin_registrant") {
dart_main = "fixtures/no_dart_plugin_registrant_test.dart"
use_target_as_artifact_prefix = true
}
executable("no_dart_plugin_registrant_unittests") {
testonly = true
sources = [ "no_dart_plugin_registrant_unittests.cc" ]
public_configs = [ "//flutter:export_dynamic_symbols" ]
public_deps = [
":no_plugin_registrant",
"//flutter/fml",
"//flutter/lib/snapshot",
"//flutter/testing",
"//flutter/testing:fixture_test",
]
}
test_fixtures("plugin_registrant") {
dart_main = "fixtures/dart_tool/flutter_build/dart_plugin_registrant.dart"
use_target_as_artifact_prefix = true
}
executable("dart_plugin_registrant_unittests") {
testonly = true
sources = [ "dart_plugin_registrant_unittests.cc" ]
public_configs = [ "//flutter:export_dynamic_symbols" ]
public_deps = [
":plugin_registrant",
"//flutter/fml",
"//flutter/lib/snapshot",
"//flutter/runtime:dart_plugin_registrant",
"//flutter/testing",
"//flutter/testing:fixture_test",
]
}
}