OLD | NEW |
(Empty) | |
| 1 NaCl (Experimental) |
| 2 =================== |
| 3 |
| 4 Important Notes |
| 5 --------------- |
| 6 |
| 7 * This process has only been verified to work on Linux |
| 8 * Skia for NaCl is new and currently under development. Therefore, some featu
res are not (yet) supported: |
| 9 * GPU backend |
| 10 * Fonts - Currently, NaCl has no way to access system fonts. This means |
| 11 that text drawn in Skia will not display. A Pepper font API is in the |
| 12 works and should be available in the near future, but for now your best |
| 13 bet is to either package font data with your nexe or to send font data |
| 14 from javascript to your plugin at runtime. Note that this will be the |
| 15 case with any graphics library in NaCl until the font API is finished. |
| 16 |
| 17 Prerequisites |
| 18 ------------- |
| 19 |
| 20 Execute the following commands in whatever directory you want to hold the NaCl S
DK directory: |
| 21 |
| 22 wget http://storage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/nacl_sd
k.zip |
| 23 unzip nacl_sdk.zip |
| 24 rm nacl_sdk.zip |
| 25 nacl_sdk/naclsdk update pepper_32 |
| 26 export NACL_SDK_ROOT=/path/to/nacl_sdk |
| 27 |
| 28 Check out the Skia source |
| 29 ------------------------- |
| 30 |
| 31 We use the "gclient" script (part of the depot_tools toolkit) to manage the |
| 32 Skia source code. Follow the instructions at |
| 33 http://www.chromium.org/developers/how-tos/depottools to get the gclient |
| 34 script from depot_tools. |
| 35 |
| 36 Instead of checking out trunk directly you will use gclient to checkout the |
| 37 nacl directory, which will automatically pull the trunk directory for you. |
| 38 Execute the following commands in whatever directory you want to be the root |
| 39 for your Skia on NaCl development: |
| 40 |
| 41 gclient config https://skia.googlesource.com/skia.git |
| 42 gclient sync |
| 43 |
| 44 Building the Skia libraries for NaCl |
| 45 ------------------------------------ |
| 46 |
| 47 The nacl_make script is used to compile Skia targets for NaCl. It sets the |
| 48 appropriate environment variables, calls GYP to generate makefiles, and runs |
| 49 Make to build both 32 and 64-bit targets as required by NaCl. To build the |
| 50 Skia libraries, run the following from the trunk directory: |
| 51 |
| 52 platform_tools/nacl/nacl_make skia_lib |
| 53 |
| 54 This will result in a set of static libraries being built into the out/nacl32 |
| 55 and out/nacl64 directories. You can use these libraries in external NaCl |
| 56 apps. |
| 57 |
| 58 Building and running Skia's Apps in NaCl (Experimental) |
| 59 ------------------------------------------------------- |
| 60 |
| 61 It is possible to run some of Skia's console apps in the browser. |
| 62 |
| 63 ### Skia Unit Tests |
| 64 |
| 65 Build Skia tests from the trunk directory: |
| 66 |
| 67 platform_tools/nacl/bin/nacl_make tests |
| 68 |
| 69 This will build the tests executable. We include a tiny HTTP server (borrowed |
| 70 from the NaCl SDK) in order to run the apps: |
| 71 |
| 72 cd platform_tools/nacl |
| 73 ./httpd.py |
| 74 |
| 75 The HTTP server runs on port 5103 by default. In Chrome, navigate to |
| 76 `http://localhost:5103/` and click on the link for "unit tests." After the |
| 77 module downloads, you should see the tests begin to run. |
| 78 |
| 79 ### Sample App |
| 80 |
| 81 The sample app relies on the GPU backend. Therefore, it will compile but will n
ot yet run. |
| 82 |
| 83 platform_tools/nacl/bin/nacl_make SampleApp |
| 84 |
| 85 You can access the sample app at http://localhost:5103/SampleApp. |
| 86 |
| 87 ### Debugger |
| 88 |
| 89 The debugger is currently in a partially-working state: |
| 90 |
| 91 platform_tools/nacl/bin/nacl_make debugger |
| 92 |
| 93 You can access it at http://localhost:5103/debugger. |
OLD | NEW |