forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add skia extension to allow setting default fontmgr on linux. Use it …
…to allow the linux blimp client to use android fonts BUG=617821 Review-Url: https://codereview.chromium.org/2500643002 Cr-Commit-Position: refs/heads/master@{#432023}
- Loading branch information
1 parent
f08f1e4
commit f6c1cd2
Showing
6 changed files
with
95 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2016 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "skia/ext/fontmgr_default_linux.h" | ||
|
||
#include "third_party/skia/include/ports/SkFontConfigInterface.h" | ||
#include "third_party/skia/include/ports/SkFontMgr.h" | ||
#include "third_party/skia/include/ports/SkFontMgr_FontConfigInterface.h" | ||
|
||
namespace { | ||
sk_sp<SkFontMgr> g_default_fontmgr; | ||
} // namespace | ||
|
||
void SetDefaultSkiaFactory(sk_sp<SkFontMgr> fontmgr) { | ||
g_default_fontmgr = fontmgr; | ||
} | ||
|
||
SK_API SkFontMgr* SkFontMgr::Factory() { | ||
if (g_default_fontmgr) { | ||
return SkRef(g_default_fontmgr.get()); | ||
} | ||
sk_sp<SkFontConfigInterface> fci(SkFontConfigInterface::RefGlobal()); | ||
return fci ? SkFontMgr_New_FCI(std::move(fci)) : nullptr; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright 2016 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef SKIA_EXT_FONTMGR_DEFAULT_LINUX_H_ | ||
#define SKIA_EXT_FONTMGR_DEFAULT_LINUX_H_ | ||
|
||
#include "third_party/skia/include/core/SkRefCnt.h" | ||
#include "third_party/skia/include/core/SkTypes.h" | ||
|
||
class SkFontMgr; | ||
|
||
void SK_API SetDefaultSkiaFactory(sk_sp<SkFontMgr> fontmgr); | ||
|
||
#endif // SKIA_EXT_FONTMGR_DEFAULT_LINUX_H_ |