Install depot tools.
git clone 'https://chromium.googlesource.com/chromium/tools/depot_tools.git' export PATH="${PWD}/depot_tools:${PATH}"
Get Skia.
git clone 'https://skia.googlesource.com/skia' cd skia
Install Dependencies (may require sudo).
tools/install_dependencies.sh
Build.
bin/sync-and-gyp && ninja -C out/Debug
Run DM (the Skia test app) and SampleApp.
out/Debug/dm out/Debug/SampleApp
On a Ubuntu 12.04 (Precise) or Ubuntu 14.04 (Trusty) system, you can run tools/install_dependencies.sh
, which will install the needed packages. On Ubuntu 12.04, you will need to install theninja
build tool separately, which comes with Chromium's depot_tools
.
To contribute changes back to Skia, you will need git-cl
, which comes with Chromium's depot_tools
.
(If you use another Linux distribution, please consider contributing back instructions for installing the required packages — we can then incorporate that knowledge into the tools/install_dependencies.sh
tool.)
Make sure the following have been installed:
sudo apt-get install libfreetype6 libfreetype6-dev libfontconfig libfontconfig-dev
sudo apt-get install libpng12-0 libpng12-dev
sudo apt-get install libgif-dev
$ sudo apt-get install libgif4:i386
$ sudo ln -s /usr/lib/i386-linux-gnu/libgif.so.4 /usr/lib/i386-linux-gnu/libgif.so
Follow the instructions here for downloading the Skia source.
We use the open-source gyp tool to generate ninja files (and analogous build scripts on other platforms) from our multiplatform "gyp" files.
Generate the build files by running the following in your Skia home directory:
./gyp_skia
Or, you can just rely on it being run automatically by using make
instead of ninja
in examples shown below.
If you want to use Eclipse, see Creating an Eclipse Project after you have generated the makefiles.
On 32-bit Linux (when uname -m
is not x86_64
), you will have to explicitly specify the architecture:
GYP_DEFINES='skia_arch_type=x86' ./gyp_skia
ninja -C out/Debug dm out/Debug/dm
The usual mode you want for testing is Debug mode (SK_DEBUG
is defined, and debug symbols are included in the binary). If you would like to build the
ninja -C out/Release dm out/Release/dm
In this case, we will build with the "Release" configuration, since we are running performance tests.
ninja -C out/Release nanobench out/Release/nanobench [ --skps path/to/*.skp ]
This time we will add the -j
flag to fire up multiple threads during the build. (This can be used with the other targets too.)
make -j SampleApp out/Debug/SampleApp
When this launches, you should see a window with various graphical examples. To move through the sample app, use the following keypresses:
DM is Skia's unit/correctness test harness.
make -j dm out/Debug/dm
The GYP_DEFINES
environment variable can be used to change Skia's compile-time settings. For example, to disable the Skia GPU backend, run it as follows:
GYP_DEFINES='skia_gpu=0' make -j dm out/Debug/dm
Since bench tests performance, it usually makes more sense to run it in Release mode...
make -j bench BUILDTYPE=Release out/Release/bench
make -j tools out/Debug/skdiff
make clean