commit | f9f26b588e0b30fb581097e2a430f5c80f33b692 | [log] [tgz] |
---|---|---|
author | Nicolas Pena <npm@chromium.org> | Fri Apr 21 15:37:42 2017 -0400 |
committer | Chromium commit bot <commit-bot@chromium.org> | Fri Apr 21 20:08:10 2017 +0000 |
tree | b313ba00d8ffe2e08d10cf22192f99915fc4d1af | |
parent | 6058730c73c78db9ec710f3b4165526acdf19e9f [diff] |
Revert "Compare to epsilon instead of 0 in CFX_Matrix::SetReverse" This reverts commit fbd9ea1db2f1bb7fa006e7304a1202afc683c142. Reason for revert: This check seems too strict BUG=chromium:714187 Original change's description: > Compare to epsilon instead of 0 in CFX_Matrix::SetReverse > > Since we are going to divide i by 0, it is better to compare it to epsilon > and avoid wonkiness from division by something too close to 0. > > BUG=chromium:702041 > > Change-Id: I8136d6063f8debd41cef37eaab7e4097b3f32f4b > Reviewed-on: https://pdfium-review.googlesource.com/3090 > Commit-Queue: Nicolás Peña <npm@chromium.org> > Reviewed-by: dsinclair <dsinclair@chromium.org> > TBR=tsepez@chromium.org,dsinclair@chromium.org,npm@chromium.org,pdfium-reviews@googlegroups.com # Not skipping CQ checks because original CL landed > 1 day ago. BUG=chromium:702041 Change-Id: Ia7d933fd3d8ce4957788341463866a04679d7f2b Reviewed-on: https://pdfium-review.googlesource.com/4432 Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
Get the chromium depot tools via the instructions at http://www.chromium.org/developers/how-tos/install-depot-tools (this provides the gclient utility needed below).
Also install Python, Subversion, and Git and make sure they're in your path.
PDFium uses a similar Windows toolchain as Chromium:
Visual Studio 2015 Update 2 or later is highly recommended.
Run set DEPOT_TOOLS_WIN_TOOLCHAIN=0
, or set that variable in your global environment.
Compilation is done through ninja, not Visual Studio.
The default architecture for Windows, Linux, and Mac is "x64
". On Windows, "x86
" is also supported. GN parameter "target_cpu = "x86"
" can be used to override the default value. If you specify Android build, the default CPU architecture will be "arm
".
Run: download_from_google_storage --config
and follow the authentication instructions. Note that you must authenticate with your @google.com credentials. Enter "0" if asked for a project-id.
Once you've done this, the toolchain will be installed automatically for you in the Generate the build files step below.
The toolchain will be in depot_tools\win_toolchain\vs_files\<hash>
, and windbg can be found in depot_tools\win_toolchain\vs_files\<hash>\win_sdk\Debuggers
.
If you want the IDE for debugging and editing, you will need to install it separately, but this is optional and not needed for building PDFium.
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 GN to generate the build files and Ninja to execute the build files. Both of these are included with the depot_tools checkout.
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.
Configuration is done by executing gn args <directory>
to configure the build. This will launch an editor in which you can set the following arguments.
use_goma = true # Googlers only. is_debug = true # Enable debugging features. pdf_use_skia = false # Set true to enable experimental skia backend. pdf_use_skia_paths = false # Set true to enable experimental skia backend (paths only). pdf_enable_xfa = true # Set false to remove XFA support (implies JS support). pdf_enable_v8 = true # Set false to remove Javascript support. pdf_is_standalone = true # Set for a non-embedded build. is_component_build = false # Disable component build (must be false) clang_use_chrome_plugins = false # Currently must be false. use_sysroot = false # Currently must be false on Linux, but entirely omitted on windows.
Note, you must set pdf_is_standalone = true
if you want the sample applications like pdfium_test
to build.
When complete the arguments will be stored in <directory>/args.gn
, and GN will automatically use the new arguments to generate build files. Should your files fail to generate, please double-check that you have set use_sysroot as indicated above.
You can build the sample program by: ninja -C <directory>/pdfium_test
You can build the entire product (which includes a few unit tests) by: ninja -C <directory>
.
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: <directory>/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 use 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: