fontmgr_default_fuchsia.cc 709 B

12345678910111213141516171819202122
  1. // Copyright 2018 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/fontmgr_default.h"
  5. #include <fuchsia/fonts/cpp/fidl.h>
  6. #include <lib/sys/cpp/component_context.h>
  7. #include "base/fuchsia/process_context.h"
  8. #include "third_party/skia/include/core/SkFontMgr.h"
  9. #include "third_party/skia/include/ports/SkFontMgr_fuchsia.h"
  10. namespace skia {
  11. SK_API sk_sp<SkFontMgr> CreateDefaultSkFontMgr() {
  12. fuchsia::fonts::ProviderSyncPtr provider;
  13. base::ComponentContextForProcess()->svc()->Connect(provider.NewRequest());
  14. return SkFontMgr_New_Fuchsia(std::move(provider));
  15. }
  16. } // namespace skia