OLD | NEW |
(Empty) | |
| 1 Linux |
| 2 ===== |
| 3 |
| 4 Prerequisites |
| 5 ------------- |
| 6 |
| 7 On a Ubuntu 12.04 (Precise) or Ubuntu 14.04 (Trusty) system, you can run |
| 8 `tools/install_dependencies.sh`, which will install the needed packages. On |
| 9 Ubuntu 12.04, you will need to install the`ninja` build tool separately, which |
| 10 comes with Chromium's `depot_tools`. |
| 11 |
| 12 To contribute changes back to Skia, you will need `git-cl`, which comes with Chr
omium's `depot_tools`. |
| 13 |
| 14 (If you use another Linux distribution, please consider contributing back |
| 15 instructions for installing the required packages — we can then incorporate |
| 16 that knowledge into the `tools/install_dependencies.sh` tool.) |
| 17 |
| 18 Make sure the following have been installed: |
| 19 |
| 20 * Chromium depot_tools: http://www.chromium.org/developers/how-tos/depottools |
| 21 * A C++ compiler (typically gcc) |
| 22 * python 2.7.x |
| 23 * suggested Ubuntu packages: python2.7, python2.7-dev |
| 24 * The FreeType and Fontconfig font engines |
| 25 * suggested Ubuntu packages: libfreetype6, libfreetype6-dev , libfontconfig
, libfontconfig-dev e.g., `sudo apt-get install libfreetype6 libfreetype6-dev li
bfontconfig libfontconfig-dev` |
| 26 * libpng |
| 27 * suggested Ubuntu packages: libpng12-0, libpng12-dev e.g., `sudo apt-get in
stall libpng12-0 libpng12-dev` |
| 28 * libgif |
| 29 * suggested Ubuntu package: libgif-dev e.g., `sudo apt-get install libgif-de
v` |
| 30 * `$ sudo apt-get install libgif4:i386` |
| 31 * `$ sudo ln -s /usr/lib/i386-linux-gnu/libgif.so.4 /usr/lib/i386-linux-gnu/
libgif.so` |
| 32 * libglu1-mesa-dev |
| 33 * mesa-common-dev |
| 34 * GL |
| 35 * such as freeglut3-dev |
| 36 * Poppler PDF rendering library C++ development files |
| 37 * suggested Ubuntu package: libpoppler-cpp-dev |
| 38 |
| 39 Check out the source code |
| 40 ------------------------- |
| 41 |
| 42 Follow the instructions [here](../download) for downloading the Skia source. |
| 43 |
| 44 |
| 45 Generate build files |
| 46 -------------------- |
| 47 |
| 48 We use the open-source gyp tool to generate ninja files (and analogous build |
| 49 scripts on other platforms) from our multiplatform "gyp" files. |
| 50 |
| 51 Generate the build files by running the following in your Skia home directory: |
| 52 |
| 53 ./gyp_skia |
| 54 |
| 55 Or, you can just rely on it being run automatically by using `make` instead of |
| 56 `ninja` in examples shown below. |
| 57 |
| 58 If you want to use Eclipse, see Creating an Eclipse Project after you have gener
ated the makefiles. |
| 59 |
| 60 Build and run tests from the command line |
| 61 ----------------------------------------- |
| 62 |
| 63 ninja -C out/Debug dm |
| 64 out/Debug/dm |
| 65 |
| 66 The usual mode you want for testing is Debug mode (`SK_DEBUG` is defined, and |
| 67 debug symbols are included in the binary). If you would like to build the |
| 68 |
| 69 Release version instead |
| 70 ----------------------- |
| 71 |
| 72 ninja -C out/Release dm |
| 73 out/Release/dm |
| 74 |
| 75 Build and run nanobench (performance tests) |
| 76 ------------------------------------------- |
| 77 |
| 78 In this case, we will build with the "Release" configuration, since we are |
| 79 running performance tests. |
| 80 |
| 81 ninja -C out/Release nanobench |
| 82 out/Release/nanobench [ --skps path/to/*.skp ] |
| 83 |
| 84 Build and run SampleApp |
| 85 ----------------------- |
| 86 |
| 87 This time we will add the `-j` flag to fire up multiple threads during the |
| 88 build. (This can be used with the other targets too.) |
| 89 |
| 90 make -j SampleApp |
| 91 out/Debug/SampleApp |
| 92 |
| 93 When this launches, you should see a window with various graphical examples. |
| 94 To move through the sample app, use the following keypresses: |
| 95 |
| 96 * right-arrow key: cycle through different test pages |
| 97 * left-arrow key: cycle through rendering methods for each test page |
| 98 * other keys are defined in SampleApp.cpp’s SampleWindow::onHandleKey() and Sa
mpleWindow::onHandleChar() methods |
| 99 |
| 100 Build and run gm ("golden master") tests |
| 101 ---------------------------------------- |
| 102 |
| 103 This will display the return value (0 = success) after running the tests... |
| 104 |
| 105 make -j gm |
| 106 out/Debug/gm -r gm/base-linux ; echo $? |
| 107 |
| 108 You can also adjust the type used to represent SkScalar. By default, we use a |
| 109 float. To change that, run it as follows: |
| 110 |
| 111 GYP_DEFINES="skia_scalar=fixed" make -j gm |
| 112 out/Debug/gm -r gm/base-linux-fixed ; echo $? |
| 113 |
| 114 Build and run bench (performance testbench) |
| 115 ------------------------------------------- |
| 116 |
| 117 Since bench tests performance, it usually makes more sense to run it in |
| 118 Release mode... |
| 119 |
| 120 make -j bench BUILDTYPE=Release |
| 121 out/Release/bench |
| 122 |
| 123 Build tools |
| 124 ----------- |
| 125 |
| 126 make -j tools |
| 127 out/Debug/skdiff |
| 128 |
| 129 Clean up all generated files |
| 130 ---------------------------- |
| 131 |
| 132 make clean |
OLD | NEW |