Migrate to Skia m96 API

This commit is contained in:
David Capello 2021-11-09 11:07:18 -03:00
parent a713a88845
commit f93b33f248
10 changed files with 39 additions and 7 deletions

View File

@ -277,8 +277,18 @@ include_directories(${FREETYPE_INCLUDE_DIRS})
if(USE_SHARED_HARFBUZZ) if(USE_SHARED_HARFBUZZ)
find_package(HarfBuzz) find_package(HarfBuzz)
else() else()
set(HARFBUZZ_LIBRARIES harfbuzz) if(LAF_BACKEND STREQUAL "skia")
set(HARFBUZZ_INCLUDE_DIRS ${HARFBUZZ_DIR}/src) # Use the Skia harfbuzz (it's a modified version with C++11
# mutexes).
add_definitions(-DHAVE_CONFIG_OVERRIDE_H=1)
set(HARFBUZZ_LIBRARIES ${SKIA_HARFBUZZ_LIBRARY})
set(HARFBUZZ_INCLUDE_DIRS
${SKIA_DIR}/third_party/harfbuzz
${SKIA_DIR}/third_party/externals/harfbuzz/src)
else()
set(HARFBUZZ_LIBRARIES harfbuzz)
set(HARFBUZZ_INCLUDE_DIRS ${HARFBUZZ_DIR}/src)
endif()
endif() endif()
include_directories(${HARFBUZZ_INCLUDE_DIRS}) include_directories(${HARFBUZZ_INCLUDE_DIRS})

2
laf

@ -1 +1 @@
Subproject commit 6eefcb859bfbf00a3d993d7bac6a44af93e00bd9 Subproject commit aa613ed84cc9d896e4aef8beea836376a39e8875

View File

@ -391,8 +391,10 @@ void App::run()
rf.includeDataDir(fmt::format("icons/ase{0}.png", size).c_str()); rf.includeDataDir(fmt::format("icons/ase{0}.png", size).c_str());
if (rf.findFirst()) { if (rf.findFirst()) {
os::SurfaceRef surf = os::instance()->loadRgbaSurface(rf.filename().c_str()); os::SurfaceRef surf = os::instance()->loadRgbaSurface(rf.filename().c_str());
if (surf) if (surf) {
surf->setImmutable();
icons.push_back(surf); icons.push_back(surf);
}
} }
} }

View File

@ -340,6 +340,7 @@ void SkinTheme::loadSheet()
m_sheet = newSheet; m_sheet = newSheet;
if (m_sheet) if (m_sheet)
m_sheet->applyScale(guiscale()); m_sheet->applyScale(guiscale());
m_sheet->setImmutable();
// Reset sprite sheet and font of all layer styles (to avoid // Reset sprite sheet and font of all layer styles (to avoid
// dangling pointers to os::Surface or os::Font). // dangling pointers to os::Surface or os::Font).
@ -756,6 +757,7 @@ os::SurfaceRef SkinTheme::sliceSheet(os::SurfaceRef sur, const gfx::Rect& bounds
os::SurfaceLock lockSrc(m_sheet.get()); os::SurfaceLock lockSrc(m_sheet.get());
os::SurfaceLock lockDst(sur.get()); os::SurfaceLock lockDst(sur.get());
m_sheet->blitTo(sur.get(), bounds.x, bounds.y, 0, 0, bounds.w, bounds.h); m_sheet->blitTo(sur.get(), bounds.x, bounds.y, 0, 0, bounds.w, bounds.h);
sur->setImmutable();
} }
else { else {
ASSERT(!sur); ASSERT(!sur);

View File

@ -948,6 +948,8 @@ void Tabs::createFloatingOverlay(Tab* tab)
drawTab(&g, g.getClipBounds(), tab, 0, true, true); drawTab(&g, g.getClipBounds(), tab, 0, true, true);
} }
surface->setImmutable();
m_floatingOverlay = base::make_ref<ui::Overlay>( m_floatingOverlay = base::make_ref<ui::Overlay>(
surface, gfx::Point(), surface, gfx::Point(),
(ui::Overlay::ZOrder)(Overlay::MouseZOrder-1)); (ui::Overlay::ZOrder)(Overlay::MouseZOrder-1));

View File

@ -500,7 +500,10 @@ Widget* WidgetLoader::convertXmlElementToWidget(const TiXmlElement* elem, Widget
try { try {
os::SurfaceRef sur = os::instance()->loadRgbaSurface(rf.filename().c_str()); os::SurfaceRef sur = os::instance()->loadRgbaSurface(rf.filename().c_str());
widget = new ImageView(sur, 0); if (sur) {
sur->setImmutable();
widget = new ImageView(sur, 0);
}
} }
catch (...) { catch (...) {
throw base::Exception("Error loading %s file", file); throw base::Exception("Error loading %s file", file);

View File

@ -99,6 +99,7 @@ void Overlay::captureOverlappedArea(os::Surface* screen)
os::SurfaceLock lock(m_overlap.get()); os::SurfaceLock lock(m_overlap.get());
screen->blitTo(m_overlap.get(), m_pos.x, m_pos.y, 0, 0, screen->blitTo(m_overlap.get(), m_pos.x, m_pos.y, 0, 0,
m_overlap->width(), m_overlap->height()); m_overlap->width(), m_overlap->height());
m_overlap->setImmutable();
m_captured = screen; m_captured = screen;
} }

View File

@ -35,6 +35,15 @@ endif()
if(WITH_WEBP_SUPPORT) if(WITH_WEBP_SUPPORT)
set(WEBP_BUILD_EXTRAS OFF CACHE BOOL "Build extras.") set(WEBP_BUILD_EXTRAS OFF CACHE BOOL "Build extras.")
set(WEBP_BUILD_ANIM_UTILS OFF CACHE BOOL "Build animation utilities.")
set(WEBP_BUILD_CWEBP OFF CACHE BOOL "Build the cwebp command line tool.")
set(WEBP_BUILD_DWEBP OFF CACHE BOOL "Build the dwebp command line tool.")
set(WEBP_BUILD_GIF2WEBP OFF CACHE BOOL "Build the gif2webp conversion tool.")
set(WEBP_BUILD_IMG2WEBP OFF CACHE BOOL "Build the img2webp animation tool.")
set(WEBP_BUILD_VWEBP OFF CACHE BOOL "Build the vwebp viewer tool.")
set(WEBP_BUILD_WEBPINFO OFF CACHE BOOL "Build the webpinfo command line tool.")
set(WEBP_BUILD_WEBPMUX OFF CACHE BOOL "Build the webpmux command line tool.")
add_subdirectory(libwebp) add_subdirectory(libwebp)
if(NOT USE_SHARED_LIBPNG) if(NOT USE_SHARED_LIBPNG)
@ -113,7 +122,10 @@ add_subdirectory(json11)
set(ENABLE_WERROR OFF CACHE BOOL "Treat warnings as errors - default is ON for Debug, OFF otherwise.") set(ENABLE_WERROR OFF CACHE BOOL "Treat warnings as errors - default is ON for Debug, OFF otherwise.")
set(ENABLE_TEST OFF CACHE BOOL "Enable unit and regression tests") set(ENABLE_TEST OFF CACHE BOOL "Enable unit and regression tests")
set(ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage (GCC only, automatically sets ENABLE_TEST to ON)") set(ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage (GCC only, automatically sets ENABLE_TEST to ON)")
set(ENABLE_LZ4 OFF CACHE BOOL "Enable the use of the system LZ4 library if found")
set(ENABLE_LZO OFF CACHE BOOL "Enable the use of the system LZO library if found")
set(ENABLE_LZMA OFF CACHE BOOL "Enable the use of the system LZMA library if found") set(ENABLE_LZMA OFF CACHE BOOL "Enable the use of the system LZMA library if found")
set(ENABLE_ZSTD OFF CACHE BOOL "Enable the use of the system zstd library if found")
set(ENABLE_CNG OFF CACHE BOOL "Enable the use of CNG(Crypto Next Generation)") set(ENABLE_CNG OFF CACHE BOOL "Enable the use of CNG(Crypto Next Generation)")
set(ENABLE_BZip2 OFF CACHE BOOL "Enable the use of the system BZip2 library if found") set(ENABLE_BZip2 OFF CACHE BOOL "Enable the use of the system BZip2 library if found")
set(ENABLE_LIBXML2 OFF CACHE BOOL "Enable the use of the system libxml2 library if found") set(ENABLE_LIBXML2 OFF CACHE BOOL "Enable the use of the system libxml2 library if found")

@ -1 +1 @@
Subproject commit 2040a29984a1d47bc9dd309995bfc1d8d51238d3 Subproject commit a52c6df38a38c4e36ff991dfb4b7d92e48a44553

2
third_party/libwebp vendored

@ -1 +1 @@
Subproject commit 69776e3832fba9969cf9da2513330f500f94e101 Subproject commit 9ce5843dbabcfd3f7c39ec7ceba9cbeb213cbfdf