Skip to content

Commit

Permalink
Merge pull request #20 from fonttools/update-skia
Browse files Browse the repository at this point in the history
Update to latest skia library
  • Loading branch information
anthrotype authored Oct 22, 2019
2 parents 839a19e + af113f0 commit 2872710
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 52 deletions.
25 changes: 4 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
env:
global:
- DOCKER_IMAGE=tstenner/manylinux:gcc9.1.0
# directory containing the project source
- REPO_DIR=.
# pip dependencies to _test_ project
Expand All @@ -25,46 +26,28 @@ matrix:
- os: linux
env:
- MB_PYTHON_VERSION=2.7
- os: linux
env:
- MB_PYTHON_VERSION=2.7
- UNICODE_WIDTH=16
- os: linux
env:
- MB_PYTHON_VERSION=2.7
- PLAT=i686
- os: linux
env:
- MB_PYTHON_VERSION=2.7
- PLAT=i686
- UNICODE_WIDTH=16
- os: linux
env:
- MB_PYTHON_VERSION=3.6
- BUILD_SDIST=true
- os: linux
env:
- MB_PYTHON_VERSION=3.6
- PLAT=i686
- os: linux
env:
- MB_PYTHON_VERSION=3.7
- os: linux
env:
- MB_PYTHON_VERSION=3.7
- PLAT=i686
- os: osx
language: generic
env:
- MB_PYTHON_VERSION=2.7
- MB_PYTHON_OSX_VER=10.9
- os: osx
language: generic
env:
- MB_PYTHON_VERSION=3.6
- MB_PYTHON_OSX_VER=10.9
- os: osx
language: generic
env:
- MB_PYTHON_VERSION=3.7
- MB_PYTHON_OSX_VER=10.9

before_install:
- source multibuild/common_utils.sh
Expand Down
18 changes: 6 additions & 12 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
image: Visual Studio 2017
platform: x64
configuration: Release

environment:
TOXENV: "py"
TWINE_USERNAME: "anthrotype"
TWINE_PASSWORD:
secure: 9L/DdqoIILlN7qCh0lotvA==
matrix:
- PYTHON: "C:\\Python27"
PYTHON_VERSION: "2.7"
PYTHON_ARCH: "32"
DISTUTILS_COMPILER: "mingw32"

- PYTHON: "C:\\Python36-x64"
PYTHON_VERSION: "3.6"
PYTHON_ARCH: "64"
Expand All @@ -25,11 +24,6 @@ environment:
PYTHON_VERSION: "3.6"
PYTHON_ARCH: "32"

- PYTHON: "C:\\Python27-x64"
PYTHON_VERSION: "2.7"
PYTHON_ARCH: "64"
DISTUTILS_COMPILER: "mingw32"


init:
- "ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH%"
Expand Down Expand Up @@ -60,13 +54,13 @@ install:
- pip --version

# upgrade setuptools and virtualenv
- pip install --upgrade setuptools virtualenv
- pip install --upgrade setuptools wheel virtualenv

# install tox to run test suite in a virtual environment
- pip install --upgrade tox

# build wheel
- tox -e wheel
- pip wheel --no-deps --wheel-dir dist .
# get the full path to the compiled wheel (ugly but works)
- dir /s /b dist\skia_pathops*.whl > wheel.pth
- set /p WHEEL_PATH=<wheel.pth
Expand Down
6 changes: 5 additions & 1 deletion config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
function pre_build {
# Any stuff that you need to do before you start building the wheels
# Runs in the root directory of this repository.
:
if [ -z "$IS_OSX" ]; then
export CFLAGS="-static-libstdc++"
export CC=/usr/local/gcc-9.1.0/bin/gcc-9.1.0
export CXX=/usr/local/gcc-9.1.0/bin/g++-9.1.0
fi
}

function run_tests {
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,6 @@ def build_libraries(self, libraries):
os.path.join(skia_dir, "src", "pathops", "SkPathOpsDebug.cpp"),
os.path.join(skia_dir, "src", "pathops", "SkPathOpsLine.cpp"),
os.path.join(skia_dir, "src", "pathops", "SkPathOpsOp.cpp"),
os.path.join(skia_dir, "src", "pathops", "SkPathOpsPoint.cpp"),
os.path.join(skia_dir, "src", "pathops", "SkPathOpsQuad.cpp"),
os.path.join(skia_dir, "src", "pathops", "SkPathOpsRect.cpp"),
os.path.join(skia_dir, "src", "pathops", "SkPathOpsSimplify.cpp"),
Expand Down Expand Up @@ -364,15 +363,16 @@ def build_libraries(self, libraries):
os.path.join(skia_dir, 'src', 'core'),
os.path.join(skia_dir, 'src', 'opts'),
os.path.join(skia_dir, 'src', 'shaders'),
os.path.join(skia_dir),
]

extra_compile_args = {
'': [
'-std=c++0x',
'-std=c++14',
] + ([
# extra flags needed on macOS for C++11
"-stdlib=libc++",
"-mmacosx-version-min=10.7",
"-mmacosx-version-min=10.9",
] if platform.system() == "Darwin" else []),
"msvc": [
"/EHsc",
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/skia
Submodule skia updated 6725 files
37 changes: 24 additions & 13 deletions tests/pathops_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,19 +168,30 @@ def test_resolve(self):
result = builder.resolve()

assert list(result.segments) == [
('moveTo', ((5316.0, 4590.0),)),
('lineTo', ((5220.0, 4590.0),)),
('lineTo', ((5220.0, 4866.92333984375),)),
('lineTo', ((5316.0, 4590.0),)),
('closePath', ()),
('moveTo', ((5688.0, 7425.0),)),
('lineTo', ((-225.0, 7425.0),)),
('lineTo', ((-225.0, 7425.0),)),
('lineTo', ((5.0, -225.0),)),
('lineTo', ((7425.0, -225.0),)),
('lineTo', ((7425.0, 7425.0),)),
('lineTo', ((5688.0, 7425.0),)),
('closePath', ())]
("moveTo", ((5316.0, 4590.0),)),
("lineTo", ((5220.0, 4590.0),)),
("lineTo", ((5220.0, 4866.92333984375),)),
("lineTo", ((5316.0, 4590.0),)),
("closePath", ()),
("moveTo", ((5192.18701171875, 4947.15283203125),)),
(
"curveTo",
(
(5171.5654296875, 4973.322265625),
(5160.0, 5005.9443359375),
(5160.0, 5040.00048828125),
),
),
("lineTo", ((5192.18701171875, 4947.15283203125),)),
("closePath", ()),
("moveTo", ((5688.0, 7425.0),)),
("lineTo", ((-225.0, 7425.0),)),
("lineTo", ((5.0, -225.0),)),
("lineTo", ((7425.0, -225.0),)),
("lineTo", ((7425.0, 7425.0),)),
("lineTo", ((5688.0, 7425.0),)),
("closePath", ()),
]


TEST_DATA = [
Expand Down

0 comments on commit 2872710

Please sign in to comment.