test_fonts_fuchsia_cfv2.cc 802 B

1234567891011121314151617181920212223
  1. // Copyright 2022 The Chromium 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. #include "skia/ext/test_fonts_fuchsia.h"
  5. #include <lib/sys/cpp/component_context.h>
  6. #include <lib/sys/cpp/service_directory.h>
  7. #include "base/fuchsia/process_context.h"
  8. namespace skia {
  9. fuchsia::fonts::ProviderHandle GetTestFontsProvider() {
  10. // //build/config/fuchsia/test/test_fonts.shard.test-cml must be in the
  11. // current test component's manifest. It configures a fonts.Provider to serve
  12. // fonts from the package's test_fonts directory for the test process.
  13. fuchsia::fonts::ProviderHandle provider;
  14. base::ComponentContextForProcess()->svc()->Connect(provider.NewRequest());
  15. return provider;
  16. }
  17. } // namespace skia