Use EGL instead of GLX, and remove duplicate font names
This commit is contained in:
parent
5e8016b504
commit
e4efb2e78d
5 changed files with 32 additions and 14 deletions
|
|
@ -286,7 +286,7 @@ if((NOT EMSCRIPTEN) AND (NOT APPLE))
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(infinipaint SDL3::SDL3 zstd::libzstd_static)
|
target_link_libraries(infinipaint zstd::libzstd_static)
|
||||||
|
|
||||||
if(EMSCRIPTEN)
|
if(EMSCRIPTEN)
|
||||||
add_subdirectory(deps/datachannel-wasm EXCLUDE_FROM_ALL)
|
add_subdirectory(deps/datachannel-wasm EXCLUDE_FROM_ALL)
|
||||||
|
|
@ -298,10 +298,9 @@ endif()
|
||||||
if(NO_CONAN_BUILD)
|
if(NO_CONAN_BUILD)
|
||||||
target_link_libraries(infinipaint ${SKIA_SVG_LIB} ${SKIA_RESOURCES_LIB} ${SKIA_LIB} ${SKIA_UNICODE_CORE_LIB} ${SKIA_UNICODE_ICU_LIB} ${SKIA_UNICODE_CORE_LIB} ${SKIA_PARAGRAPH_LIB} ${SKIA_SHAPER_LIB})
|
target_link_libraries(infinipaint ${SKIA_SVG_LIB} ${SKIA_RESOURCES_LIB} ${SKIA_LIB} ${SKIA_UNICODE_CORE_LIB} ${SKIA_UNICODE_ICU_LIB} ${SKIA_UNICODE_CORE_LIB} ${SKIA_PARAGRAPH_LIB} ${SKIA_SHAPER_LIB})
|
||||||
target_include_directories(infinipaint PRIVATE ${SKIA_INCLUDE})
|
target_include_directories(infinipaint PRIVATE ${SKIA_INCLUDE})
|
||||||
target_link_libraries(infinipaint ICU::uc Fontconfig::Fontconfig Freetype::Freetype PNG::PNG ZLIB::ZLIB)
|
target_link_libraries(infinipaint SDL3::SDL3 ICU::uc Fontconfig::Fontconfig Freetype::Freetype PNG::PNG ZLIB::ZLIB)
|
||||||
else()
|
else()
|
||||||
target_link_libraries(infinipaint skia::skia)
|
target_link_libraries(infinipaint skia::skia sdl::sdl icu::icu)
|
||||||
target_link_libraries(infinipaint icu::icu)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT EMSCRIPTEN)
|
if(NOT EMSCRIPTEN)
|
||||||
|
|
@ -309,7 +308,7 @@ if(NOT EMSCRIPTEN)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if((NOT (GRAPHICS_BACKEND STREQUAL "Vulkan")) AND (NOT EMSCRIPTEN) AND LINUX)
|
if((NOT (GRAPHICS_BACKEND STREQUAL "Vulkan")) AND (NOT EMSCRIPTEN) AND LINUX)
|
||||||
target_link_libraries(infinipaint OpenGL::GLX)
|
target_link_libraries(infinipaint OpenGL::EGL)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(GRAPHICS_BACKEND STREQUAL "Vulkan")
|
if(GRAPHICS_BACKEND STREQUAL "Vulkan")
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,7 @@ class ConanSkia(ConanFile):
|
||||||
"use_fontconfig" : [True, False],
|
"use_fontconfig" : [True, False],
|
||||||
"use_fonthost_mac" : [True, False],
|
"use_fonthost_mac" : [True, False],
|
||||||
"use_perfetto" : [True, False],
|
"use_perfetto" : [True, False],
|
||||||
|
"use_egl": [True, False],
|
||||||
# backend toggles
|
# backend toggles
|
||||||
"enable_ganesh" : [True, False],
|
"enable_ganesh" : [True, False],
|
||||||
"enable_graphite" : [True, False],
|
"enable_graphite" : [True, False],
|
||||||
|
|
@ -162,6 +163,7 @@ class ConanSkia(ConanFile):
|
||||||
"use_wuffs" : True,
|
"use_wuffs" : True,
|
||||||
"use_libavif" : False,
|
"use_libavif" : False,
|
||||||
"use_libjxl_decode" : False,
|
"use_libjxl_decode" : False,
|
||||||
|
"use_egl": False,
|
||||||
# backend toggles
|
# backend toggles
|
||||||
"enable_ganesh" : True,
|
"enable_ganesh" : True,
|
||||||
"enable_graphite" : False,
|
"enable_graphite" : False,
|
||||||
|
|
@ -269,6 +271,10 @@ class ConanSkia(ConanFile):
|
||||||
enabled = (os == "Linux")
|
enabled = (os == "Linux")
|
||||||
self.options.use_x11 = enabled
|
self.options.use_x11 = enabled
|
||||||
|
|
||||||
|
if self.options.use_egl == None:
|
||||||
|
enabled = (os == "Linux")
|
||||||
|
self.options.use_egl = enabled
|
||||||
|
|
||||||
if self.options.use_fontconfig == None:
|
if self.options.use_fontconfig == None:
|
||||||
enabled = (os == "Linux")
|
enabled = (os == "Linux")
|
||||||
self.options.use_fontconfig = enabled
|
self.options.use_fontconfig = enabled
|
||||||
|
|
@ -647,6 +653,16 @@ class ConanSkia(ConanFile):
|
||||||
args += f"skia_canvaskit_legacy_draw_vertices_blend_mode = false\n"
|
args += f"skia_canvaskit_legacy_draw_vertices_blend_mode = false\n"
|
||||||
args += f"skia_canvaskit_profile_build = false\n"
|
args += f"skia_canvaskit_profile_build = false\n"
|
||||||
|
|
||||||
|
if self.settings.os == "Linux" and self.options.use_egl == True:
|
||||||
|
args += f"skia_use_egl = true\n"
|
||||||
|
else:
|
||||||
|
args += f"skia_use_egl = false\n"
|
||||||
|
|
||||||
|
if self.settings.os == "Linux" and self.options.use_x11 == True:
|
||||||
|
args += f"skia_use_x11 = true\n"
|
||||||
|
else:
|
||||||
|
args += f"skia_use_x11 = false\n"
|
||||||
|
|
||||||
cflags = []
|
cflags = []
|
||||||
ldflags = []
|
ldflags = []
|
||||||
asmflags = []
|
asmflags = []
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,8 @@ class CompressorRecipe(ConanFile):
|
||||||
"use_system_libpng": False,
|
"use_system_libpng": False,
|
||||||
"use_system_libwebp": False,
|
"use_system_libwebp": False,
|
||||||
"use_system_zlib": False,
|
"use_system_zlib": False,
|
||||||
|
"use_x11": False,
|
||||||
|
"use_egl": True,
|
||||||
"enable_svg": True,
|
"enable_svg": True,
|
||||||
"enable_skottie": False,
|
"enable_skottie": False,
|
||||||
"enable_bentleyottmann": True # for some reason, setting this to False results in an error when creating the project
|
"enable_bentleyottmann": True # for some reason, setting this to False results in an error when creating the project
|
||||||
|
|
@ -56,6 +58,7 @@ class CompressorRecipe(ConanFile):
|
||||||
if self.settings.os == "Linux":
|
if self.settings.os == "Linux":
|
||||||
self.requires("sdl/3.2.26", options = {
|
self.requires("sdl/3.2.26", options = {
|
||||||
"wayland": False,
|
"wayland": False,
|
||||||
|
"x11": True,
|
||||||
"pulseaudio": False,
|
"pulseaudio": False,
|
||||||
"alsa": False,
|
"alsa": False,
|
||||||
"sndio": False,
|
"sndio": False,
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ modules:
|
||||||
buildsystem: simple
|
buildsystem: simple
|
||||||
build-commands:
|
build-commands:
|
||||||
- python3 tools/git-sync-deps
|
- python3 tools/git-sync-deps
|
||||||
- bin/gn gen out/Static --args='is_official_build=true skia_use_system_expat=false skia_use_system_freetype2=true skia_use_system_harfbuzz=true skia_use_system_icu=true skia_use_system_libjpeg_turbo=false skia_use_system_libpng=true skia_use_system_libwebp=false skia_use_system_zlib=true'
|
- bin/gn gen out/Static --args='is_official_build=true skia_use_system_expat=false skia_use_system_freetype2=true skia_use_system_harfbuzz=true skia_use_system_icu=true skia_use_system_libjpeg_turbo=false skia_use_system_libpng=true skia_use_system_libwebp=false skia_use_system_zlib=true skia_use_egl=true skia_use_x11=false'
|
||||||
- ninja -C out/Static skia svg skunicode_core skunicode_icu skparagraph skresources skshaper
|
- ninja -C out/Static skia svg skunicode_core skunicode_icu skparagraph skresources skshaper
|
||||||
- mkdir /app/Skia
|
- mkdir /app/Skia
|
||||||
- mv out /app/Skia
|
- mv out /app/Skia
|
||||||
|
|
|
||||||
|
|
@ -10,15 +10,15 @@
|
||||||
bool GUIStuff::FontPicker::update(UpdateInputData& io, std::string* fontName, GUIManager* gui) {
|
bool GUIStuff::FontPicker::update(UpdateInputData& io, std::string* fontName, GUIManager* gui) {
|
||||||
if(sortedFontList.empty()) {
|
if(sortedFontList.empty()) {
|
||||||
auto icu = SkUnicodes::ICU::Make();
|
auto icu = SkUnicodes::ICU::Make();
|
||||||
|
std::set<std::string> sortedFontSet;
|
||||||
|
|
||||||
for(int i = 0; i < io.textFontMgrLocal->countFamilies(); i++) {
|
for(int i = 0; i < io.textFontMgrLocal->countFamilies(); i++) {
|
||||||
SkString familyNameSkString;
|
SkString familyNameSkString;
|
||||||
io.textFontMgrLocal->getFamilyName(i, &familyNameSkString);
|
io.textFontMgrLocal->getFamilyName(i, &familyNameSkString);
|
||||||
if(familyNameSkString.isEmpty())
|
if(familyNameSkString.isEmpty())
|
||||||
continue;
|
continue;
|
||||||
std::string familyName(familyNameSkString.c_str(), familyNameSkString.size());
|
std::string familyName(familyNameSkString.c_str(), familyNameSkString.size());
|
||||||
sortedFontList.emplace_back(familyName);
|
sortedFontSet.emplace(familyName);
|
||||||
std::transform(familyName.begin(), familyName.end(), familyName.begin(), ::tolower);
|
|
||||||
sortedFontListLowercase.emplace_back(familyName);
|
|
||||||
}
|
}
|
||||||
for(int i = 0; i < io.textFontMgrFallback->countFamilies(); i++) {
|
for(int i = 0; i < io.textFontMgrFallback->countFamilies(); i++) {
|
||||||
SkString familyNameSkString;
|
SkString familyNameSkString;
|
||||||
|
|
@ -26,12 +26,12 @@ bool GUIStuff::FontPicker::update(UpdateInputData& io, std::string* fontName, GU
|
||||||
if(familyNameSkString.isEmpty())
|
if(familyNameSkString.isEmpty())
|
||||||
continue;
|
continue;
|
||||||
std::string familyName(familyNameSkString.c_str(), familyNameSkString.size());
|
std::string familyName(familyNameSkString.c_str(), familyNameSkString.size());
|
||||||
sortedFontList.emplace_back(familyName);
|
sortedFontSet.emplace(familyName);
|
||||||
std::transform(familyName.begin(), familyName.end(), familyName.begin(), ::tolower);
|
|
||||||
sortedFontListLowercase.emplace_back(familyName);
|
|
||||||
}
|
}
|
||||||
std::sort(sortedFontList.begin(), sortedFontList.end());
|
sortedFontList = std::vector<std::string>(sortedFontSet.begin(), sortedFontSet.end());
|
||||||
std::sort(sortedFontListLowercase.begin(), sortedFontListLowercase.end());
|
sortedFontListLowercase = sortedFontList;
|
||||||
|
for(std::string& s : sortedFontListLowercase)
|
||||||
|
std::transform(s.begin(), s.end(), s.begin(), ::tolower);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!fontName)
|
if(!fontName)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue