On a Ubuntu 12.04 (Precise) or Ubuntu 14.04 (Trusty) system, you can run
To contribute changes back to Skia, you will need
(If you use another Linux distribution, please consider contributing back instructions for installing the required packages — we can then incorporate that knowledge into the
Make sure the following have been installed:
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:
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.
Build and run tests from the command line
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 Release version instead:
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
When this launches, you should see a window with various graphical examples. To move through the sample app, use the following keypresses:
This will display the return value (0 = success) after running the tests...
make -j gm
You can also adjust the type used to represent SkScalar. By default, we use a float. To change that, run it as follows:
GYP_DEFINES="skia_scalar=fixed" make -j gm
Since bench tests performance, it usually makes more sense to run it in Release mode...
make -j bench BUILDTYPE=Release
make -j tools