commit | b6853cfe4fd1ee089dfdd0cb09bbc4063532ef82 | [log] [tgz] |
---|---|---|
author | tsepez <tsepez@chromium.org> | Mon Apr 25 11:23:43 2016 -0700 |
committer | Commit bot <commit-bot@chromium.org> | Mon Apr 25 11:23:43 2016 -0700 |
tree | 1404031e845c8b4b09d5a68fd81f09a7d2865d59 | |
parent | 2a8a20cde4c8e2294f6868bb097fe450960a709f [diff] |
Pass CFX_*StringCs to FX_HashCode_GETA and _GETW hash functions. Too many calls were of the form fn(x.c_str(), x.GetLength()) which is an anti-pattern given the StringC classes which tie these together. There are a few places where explicit CFX_*StringCs are constructed, but this can be avoided by changing the args to these functions in the same manner. Removed String_ from name of functions since it added little value. Also removed default argument. Review URL: https://codereview.chromium.org/1919563002
As of 2016-02-04, the XFA branch is deprecated. Instead, see the section on configuration below.
Get the chromium depot tools via the instructions at http://www.chromium.org/developers/how-tos/install-depot-tools (this provides the gclient utilty needed below).
Also install Python, Subversion, and Git and make sure they're in your path.
The name of the top-level directory does not matter. In our examples, we use "repo". This directory must not have been used before by gclient config
as each directory can only house a single gclient configuration.
mkdir repo cd repo gclient config --unmanaged https://pdfium.googlesource.com/pdfium.git gclient sync cd pdfium
We use the GYP library to generate the build files.
At this point, you have two options. The first option is to use the [Ninja] (http://martine.github.io/ninja/) build system (also included with the depot_tools checkout). This is the default as of mid-September, 2015. Previously, the second option (platform-specific build files) was the default. Most PDFium developers use Ninja, as does our [continuous build system] (http://build.chromium.org/p/client.pdfium/).
build_gyp\gyp_pdfium
build_gyp/gyp_pdfium
The second option is to generate platform-specific build files, i.e. Makefiles on Linux, sln files on Windows, and xcodeproj files on Mac. To do so, set the GYP_GENERATORS environment variable appropriately (e.g. "make", "msvs", or "xcode") before running the above command.
PDFium may be built either with or without JavaScript support, and with or without XFA forms support. Both of these features are enabled by default. Also note that the XFA feature requires JavaScript.
To build without XFA, set pdf_enable_xfa=0
before running gyp_pdfium
. To build without JavaScript, set pdf_enable_v8=0 pdf_enable_xfa=0
before running gyp_pdfium
. For example
GYP_DEFINES='pdf_enable_v8=0 pdf_enable_xfa=0' build_gyp/gyp_pdfium
gives the smallest possible build configuration.
If you would like to build using goma, pass use_goma=1
to gyp_pdfium
. If you installed goma in a non-standard location, you will also need to set gomadir
. e.g.
build_gyp/gyp_pdfium -D use_goma=1 -D gomadir=path/to/goma
If you used Ninja, you can build the sample program by: ninja -C out/Debug pdfium_test
You can build the entire product (which includes a few unit tests) by: ninja -C out/Debug
.
If you're not using Ninja, then building is platform-specific.
make pdfium_test
open build_gyp/all.xcodeproj
The pdfium_test program supports reading, parsing, and rasterizing the pages of a .pdf file to .ppm or .png output image files (windows supports two other formats). For example: out/Debug/pdfium_test --ppm path/to/myfile.pdf
. Note that this will write output images to path/to/myfile.pdf.<n>.ppm
.
There are currently several test suites that can be run:
It is possible the tests in the testing
directory can fail due to font differences on the various platforms. These tests are reliable on the bots. If you see failures, it can be a good idea to run the tests on the tip-of-tree checkout to see if the same failures appear.
The current health of the source tree can be found at http://build.chromium.org/p/client.pdfium/console
There are several mailing lists that are setup:
Note, the Reviews and Bugs lists are typically read-only.
We will be using this bug tracker, but for security bugs, please use [Chromium's security bug template] (https://code.google.com/p/chromium/issues/entry?template=Security%20Bug) and add the "Cr-Internals-Plugins-PDF" label.
For contributing code, we will follow Chromium's process as much as possible. The main exceptions is:
Prior to 2016-02-04, there existed an actively developed origin/xfa branch. The origin/xfa branch is now an evolutionary dead-end. Everything you need to build either with or without the XFA feature is on origin/master.