Skip to content

Commit

Permalink
Switched to OpenGL ES texture - removed GrGlInterface. Fixed blank ou…
Browse files Browse the repository at this point in the history
…tput for .png rendering for small image sizes
  • Loading branch information
kcleal committed Aug 23, 2024
1 parent e6c1427 commit ae9c337
Show file tree
Hide file tree
Showing 22 changed files with 3,042 additions and 318 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
pull_request:

env:
version: 1.0.2
version: 1.1.0

jobs:
mingw:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ libgw.so
/src/plot_commands.o
/src/ideogram.o
/.gw_session.ini
/lib/build_skia/
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ OBJECTS += $(patsubst %.c, %.o, $(wildcard ./lib/libBigWig/*.c))
debug: LDFLAGS += -fsanitize=address -fsanitize=undefined

$(TARGET): $(OBJECTS) # line 131
$(CXX) $(CXXFLAGS) $(OBJECTS) $(LDFLAGS) $(LDLIBS) -o $@
$(CXX) $(CXXFLAGS) ./include/glad.c $(OBJECTS) $(LDFLAGS) $(LDLIBS) -o $@


clean:
Expand Down
96 changes: 79 additions & 17 deletions build_skia.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,82 @@
#!/bin/bash

echo "Building skia\n"
v=m93-87e8842e8c
mkdir -p lib
cd lib
wget --no-check-certificate -O skia_build.zip https://github.com/JetBrains/skia-build/archive/refs/tags/${v}.zip && unzip -o skia_build.zip && rm skia_build.zip

cd skia-build-${v}
python3 script/checkout.py --version ${v}
python3 script/build.py
cd ../
NAME=${PWD}/lib/skia
echo "Skia out folder is: $NAME"

cd ./lib
mkdir -p ${NAME}
mkdir -p build_skia && cd build_skia

ARCH=$(uname -m)
if [ "$ARCH" = "x86_64" ]; then
EXTRA_CFLAGS='extra_cflags=["-mavx512f", "-mssse3", "-frtti"]'
else
#elif [ "$ARCH" = "arm64" ] || [ "$ARCH" = "aarch64" ]; then
EXTRA_CFLAGS=""
fi
echo "Extra flags: ${EXTRA_CFLAGS}"


git clone 'https://chromium.googlesource.com/chromium/tools/depot_tools.git'
export PATH="${PWD}/depot_tools:${PATH}"

# sudo npm install -g @bazel/bazelisk
# sudo apt-get install -y ninja-build libharfbuzz-dev libwebp-dev
#brew install bazelisk ninja harfbuzz webp

depot_tools/fetch skia

cd skia
VERSION=m93

python3 tools/git-sync-deps

REL=Release

mkdir -p skia
cp -rf skia-build-${v}/skia/out skia
cp -rf skia-build-${v}/skia/modules skia
cp -rf skia-build-${v}/skia/include skia
cp -rf skia-build-${v}/skia/src skia
rm -rf skia-build-${v}
echo "Building skia finished\n"

# Turn off all GPU backends
bin/gn gen out/${REL} --args="is_official_build=true skia_enable_egl=true skia_use_system_icu=false skia_use_system_zlib=false skia_use_system_expat=false skia_use_system_libjpeg_turbo=false skia_use_system_libpng=false skia_use_system_libwebp=false skia_use_system_harfbuzz=false skia_pdf_subset_harfbuzz=true skia_enable_skottie=true ${EXTRA_CFLAGS}"
bin/gn args out/${REL} --list
ninja -C out/${REL}


mkdir -p ${NAME}/out
mkdir -p ${NAME}/third_party/externals


cp -rf out/${REL}/* ${NAME}/out
cp -rf include ${NAME}
cp -rf modules ${NAME}
cp -rf src ${NAME}

libs=( "freetype" "harfbuzz" "icu" "libpng" "zlib" )

for l in "${libs[@]}"
do
echo $l
mkdir -p ${NAME}/third_party/externals/${l}
cp -rf third_party/externals/${l}/src ${NAME}/third_party/externals/${l}
cp -rf third_party/externals/${l}/include ${NAME}/third_party/externals/${l}
cp -rf third_party/externals/${l}/source ${NAME}/third_party/externals/${l}
cp third_party/externals/${l}/*.h ${NAME}/third_party/externals/${l}
done

cp -rf third_party/icu ${NAME}/third_party

# clean up
cd ${NAME}
rm -rf modules/skottie/tests
rm -rf out/${REL}/obj
rm -rf out/${REL}/gen
rm -rf out/${REL}/gcc_like_host
find . -name "*.clang-format" -type f -delete
find . -name "*.gitignore" -type f -delete
find . -name "*.md" -type f -delete
find . -name "*.gn" -type f -delete
find . -name "*.ninja" -type f -delete
find . -name "*.cpp" -type f -delete
find . -name "*.ninja.d" -type f -delete
find . -name "*BUILD*" -type f -delete
find . -name "*.txt" -type f -delete
find . -name "test*" -type d -exec rm -rv {} +
cd ../
2 changes: 1 addition & 1 deletion deps/gw.desktop
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Desktop Entry]
Encoding=UTF-8
Version=1.0.2
Version=1.1.0
Type=Application
Terminal=true
Exec=bash -c "/usr/bin/gw"
Expand Down
Loading

0 comments on commit ae9c337

Please sign in to comment.