diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2020-03-10 12:43:45 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2020-03-18 10:47:49 +0100 |
commit | 076926cef97c685b3d9221510e7560c034ebd2ed (patch) | |
tree | 9a7bf0c33ceb68575bea9e5683b6c9d40fbefb1e /external | |
parent | 64c6c4279f70555511af2d2ba80bcd32cbc7a798 (diff) |
implement text rendering using directly Skia (X11)
The Cairo-based way reuses code that is used for OpenGL, but it's
needlessly complicated, given that Skia itself is capable of text
rendering as well.
This requires a small patch for Skia so that it uses the FcPattern*
we use for selecting a font.
The rendering with this commit is usable, but visually the result
is noticeably different, so this will need tweaks to the font
rendering (TBD).
Change-Id: I058c282307106c929ccc9faa7b2bddfabf0f0a2c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90580
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'external')
-rw-r--r-- | external/skia/UnpackedTarball_skia.mk | 1 | ||||
-rw-r--r-- | external/skia/fontconfig-get-typeface.patch.0 | 32 |
2 files changed, 33 insertions, 0 deletions
diff --git a/external/skia/UnpackedTarball_skia.mk b/external/skia/UnpackedTarball_skia.mk index 33fcf05b6a81..6ffde2006590 100644 --- a/external/skia/UnpackedTarball_skia.mk +++ b/external/skia/UnpackedTarball_skia.mk @@ -27,6 +27,7 @@ skia_patches := \ fix-gcc-x86.patch.1 \ msvc-vectorcall-sse.patch.1 \ clang11-flax-vector-conversion.patch.0 \ + fontconfig-get-typeface.patch.0 \ $(eval $(call gb_UnpackedTarball_set_patchlevel,skia,1)) diff --git a/external/skia/fontconfig-get-typeface.patch.0 b/external/skia/fontconfig-get-typeface.patch.0 new file mode 100644 index 000000000000..a7a82bfa07f4 --- /dev/null +++ b/external/skia/fontconfig-get-typeface.patch.0 @@ -0,0 +1,32 @@ +--- ./src/ports/SkFontMgr_fontconfig.cpp.sav 2020-01-20 16:42:51.322186451 +0100 ++++ ./src/ports/SkFontMgr_fontconfig.cpp 2020-03-13 11:25:15.793936659 +0100 +@@ -699,6 +699,7 @@ class SkFontMgr_fontconfig : public SkFo + /** Creates a typeface using a typeface cache. + * @param pattern a complete pattern from FcFontRenderPrepare. + */ ++public: + sk_sp<SkTypeface> createTypefaceFromFcPattern(FcPattern* pattern) const { + FCLocker::AssertHeld(); + SkAutoMutexExclusive ama(fTFCacheMutex); +@@ -1039,3 +1040,9 @@ protected: + SK_API sk_sp<SkFontMgr> SkFontMgr_New_FontConfig(FcConfig* fc) { + return sk_make_sp<SkFontMgr_fontconfig>(fc); + } ++ ++SK_API sk_sp<SkTypeface> SkFontMgr_createTypefaceFromFcPattern(const sk_sp<SkFontMgr>& mgr, FcPattern* pattern) ++{ ++ FCLocker lock; ++ return static_cast<SkFontMgr_fontconfig*>(mgr.get())->createTypefaceFromFcPattern(pattern); ++} +--- ./include/ports/SkFontMgr_fontconfig.h.sav 2019-09-19 11:38:00.943185323 +0200 ++++ ./include/ports/SkFontMgr_fontconfig.h 2020-03-13 11:31:48.025716543 +0100 +@@ -19,4 +19,9 @@ class SkFontMgr; + */ + SK_API sk_sp<SkFontMgr> SkFontMgr_New_FontConfig(FcConfig* fc); + ++struct _FcPattern; ++typedef struct _FcPattern FcPattern; ++class SkTypeface; ++SK_API sk_sp<SkTypeface> SkFontMgr_createTypefaceFromFcPattern(const sk_sp<SkFontMgr>& mgr, FcPattern* pattern); ++ + #endif // #ifndef SkFontMgr_fontconfig_DEFINED |