Roll third_party/skia/ 77aeee3b8..8e9e16841 (187 commits)

https://skia.googlesource.com/skia.git/+log/77aeee3b81a5..8e9e168418a0

$ git log 77aeee3b8..8e9e16841 --date=short --no-merges --format='%ad %ae %s'
2023-11-17 skia-autoroll Roll vulkan-deps from a0360cfd7fd5 to b5f778a99583 (6 revisions)
2023-11-17 skia-autoroll Roll ANGLE from c5eb810b941f to 8ae36a93bedc (8 revisions)
2023-11-16 lovisolo [bazel] Housekeeper-PerCommit-GoLinters: Add errcheck step.
2023-11-16 lovisolo [bazel] New task: Housekeeper-PerCommit-GoLinters.
2023-11-13 jlavrova Emoji font resolution fix
2023-11-16 skia-autoroll Roll vulkan-deps from 8fa1b1b67aa7 to a0360cfd7fd5 (6 revisions)
2023-11-16 bungeman Add GIT_SYNC_DEPS_SHALLOW_CLONE to git-sync-deps
2023-11-15 lovisolo Reland "Reland: [bazel] Housekeeper-PerCommit-CheckGeneratedFiles: Add "go generate", Gazelle and Buildifier steps."
2023-11-16 kschmi Expose default SK_GAMMA_CONTRAST values in SkTypes
2023-11-16 skia-autoroll Roll SK Tool from 14160bee80f4 to bc5a26ce9f2b
2023-11-16 skia-autoroll Roll skottie-base from ba1e7f5c1e82 to f23b91844a05
2023-11-15 kjlubick Fix up fuzzers implicit dependency on default SkFontMgr
2023-11-16 kjlubick Add option to skip emsdk sync
2023-11-16 jvanverth [graphite] Improvement to image sampling performance.
2023-11-16 robertphillips [graphite] Allow creation of Protected Devices
2023-10-24 lehoangquyen GraphiteDawn: cache uniform buffers' bind groups.
2023-11-16 skia-autoroll Roll vulkan-deps from 13dd63c18adf to 8fa1b1b67aa7 (8 revisions)
2023-11-16 skia-autoroll Roll ANGLE from a982e241b362 to c5eb810b941f (4 revisions)
2023-11-16 skia-autoroll Roll Dawn from 99672e2bf1ed to 85b15b0b132e (18 revisions)
2023-11-14 hitawala Graphite: Relax wgpu::TextureAspect validation
2023-11-15 bungeman Make SkFontMetrics::operator== const
2023-11-15 michaelludwig Set fill style and remove path effects on saveLayer restore paint
2023-11-15 johnstiles Fix minor errors in gn_to_bp.
2023-11-15 bungeman Check for empty glyphs in last resort fallback
2023-11-15 skia-autoroll Roll skottie-base from 1f5289c9db82 to ba1e7f5c1e82
2023-11-15 johnstiles Fix typo in YUV cubic filter.
2023-11-14 johnstiles Add Haswell and Skylake support to skcms gn/bazel build files.
2023-11-15 skia-autoroll Roll vulkan-deps from 4aadd727887d to 13dd63c18adf (9 revisions)
2023-11-15 johnstiles Remove switch from bitmap_text_coverage_fn.
2023-11-15 skia-autoroll Roll SK Tool from d3983fb3caec to 14160bee80f4
2023-11-15 robertphillips Avoid memoryless attachments w/ protected rendering
2023-11-14 robertphillips [graphite] Add ManagedGraphiteTexture::ReleaseProc
2023-11-14 robertphillips [graphite] Attach internal protected elements together
2023-11-15 kjlubick Add gni filegroups for chromium fuzzers
2023-11-15 kjlubick Revert^3 "Reland: [bazel] Housekeeper-PerCommit-CheckGeneratedFiles: Add "go generate", Gazelle and Buildifier steps."
2023-11-15 kjlubick Export DirectWrite typeface via SK_SPI
2023-11-15 nicolettep Revert^2 "Reland: [bazel] Housekeeper-PerCommit-CheckGeneratedFiles: Add "go generate", Gazelle and Buildifier steps."
2023-11-15 kjlubick Revert "Reland: [bazel] Housekeeper-PerCommit-CheckGeneratedFiles: Add "go generate", Gazelle and Buildifier steps."
2023-11-15 lovisolo Reland: [bazel] Housekeeper-PerCommit-CheckGeneratedFiles: Add "go generate", Gazelle and Buildifier steps.
2023-11-15 skia-autoroll Roll ANGLE from b12d4867b1fb to a982e241b362 (7 revisions)
2023-11-15 skia-autoroll Roll vulkan-deps from fa2349933b89 to 4aadd727887d (5 revisions)
2023-11-15 skia-autoroll Roll Dawn from ba1fc4223d17 to 99672e2bf1ed (13 revisions)
2023-11-14 kjlubick Revert "[bazel] Housekeeper-PerCommit-CheckGeneratedFiles: Add "go generate", Gazelle and Buildifier steps."
2023-11-14 kjlubick Remove dependency from TestFontCollection to default SkFontMgr
2023-11-14 lovisolo [bazel] Housekeeper-PerCommit-CheckGeneratedFiles: Add "go generate", Gazelle and Buildifier steps.
2023-11-14 johnstiles Reland "Create separate skcms build rules for the various submodules."
2023-11-14 johnstiles Revert "Create separate skcms build rules for the various submodules."
2023-11-14 kjlubick Add buffet rule for png encoding and fontconfig SkFontMgr
2023-11-13 johnstiles Add shader text and errors to the failure message.
2023-11-14 skia-autoroll Roll SK Tool from c397c94283b7 to 35defa8f1ef1
(...)
2023-11-08 skia-autoroll Roll debugger-app-base from 78b8bb631267 to 48e35a606e12
2023-11-08 nicolettep [graphite] Add label to YCbCr sampler conversion resource instantiation
2023-11-08 johnstiles Fix rewrite_includes errors.
2023-11-08 michaelludwig GrBlurUtils: Subset on low-res pixel boundary, not float coords
2023-11-08 jvanverth Force coloremoji GM to have a small multitexture atlas.
2023-11-08 mike Add build-flag to enable smaller/slower mipmap builder
2023-11-08 egdaniel [Graphite] Add initial support for Resource labels.
2023-11-07 herb Tighten up image and empty tracking for SkGlyph
2023-11-08 skia-autoroll Roll SK Tool from 4da518531bee to 6a90ad65ed95
2023-11-08 nicolettep [graphite] Add sampler YCbCr conversion class, info struct; share utilities w/ ganesh
2023-11-08 nicolettep [graphite] VulkanResourceProvider findOrCreate method improvements
2023-11-08 johnstiles Change resizing strategy for empty TArrays.
2023-11-08 skia-autoroll Roll vulkan-deps from 969da898b476 to 6fff5ad7622c (1 revision)
2023-11-08 brianosman Remove rgf32 stages from RP
2023-11-08 johnstiles Use STArray for SkMesh child array.
2023-11-08 johnstiles Remove reference to skcms_internal.h
2023-11-08 skia-autoroll Roll ANGLE from 0584ffd8fbdd to a494c1d6c813 (6 revisions)
2023-11-08 skia-autoroll Roll SwiftShader from 5c95af798ba4 to 4a62a93e27d9 (1 revision)
2023-11-07 sunnyps graphite: Fixes for enabling storage buffers for Dawn backend
2023-11-07 skia-autoroll Roll vulkan-deps from 565eac2306d8 to 969da898b476 (8 revisions)
2023-11-07 jvanverth Fix colorspace transform with multitexture color text.
2023-11-07 nscobie Revert "Migrate many direct and indirect uses of SkFontMgr to use TestFontMgr"
2023-11-07 skia-autoroll Roll SK Tool from e98bb78ac013 to 4da518531bee
2023-11-03 egdaniel [Graphite] Add support for SkTraceMemoryDump for gpu Resources.
2023-11-06 michaelludwig [graphite] Skip calling getMostRecentDraw() for draws that don't need it for sorting
2023-11-03 kjlubick Migrate many direct and indirect uses of SkFontMgr to use TestFontMgr
2023-11-07 jamesgk [viewer] Add angle mtl backend
2023-11-07 robertphillips [graphite] Add ProtectedUtils for Graphite
2023-11-06 michaelludwig [graphite] Add upper bound to grid size for Grid/HybridBoundsManagers
2023-11-07 skia-autoroll Roll skcms from e9cc5993398f to b60ffc00fe5c (2 revisions)
2023-11-07 robertphillips [graphite] Expand Backend[TextureImage|Surface] Factories
2023-11-07 robertphillips [graphite] Split ManagedGraphiteTexture creation in two
2023-11-06 johnstiles Fix skcms roll issues with IWYU.
2023-11-07 skia-autoroll Roll vulkan-deps from 8390e1121511 to 565eac2306d8 (12 revisions)
2023-11-07 skia-autoroll Roll ANGLE from ae3af8ee0c58 to 0584ffd8fbdd (11 revisions)
2023-11-06 skia-autoroll Roll ANGLE from 9f9c35f347ef to ae3af8ee0c58 (8 revisions)
2023-11-06 skia-autoroll Roll skcms from 42030a771244 to e9cc5993398f (2 revisions)
2023-11-04 skia-autoroll Roll vulkan-deps from 122ddb782c61 to 8390e1121511 (1 revision)
2023-11-06 jamesgk [ganesh] Fix dashed circle calculations near 2*pi
2023-11-06 skia-autoroll Roll debugger-app-base from 1747ffa9b114 to 78b8bb631267
2023-11-04 skia-autoroll Roll SK Tool from f9ad0db84cbc to e98bb78ac013
2023-11-03 drott [Fontations] Roll Fontations libraries
2023-10-24 ccameron SkExif: Add support for common tags
2023-11-05 skia-recreate-skps Update SKP version
2023-11-05 skia-autoroll Roll skcms from d0d3db899486 to 42030a771244 (2 revisions)
2023-11-06 skia-autoroll Roll skottie-base from f97385e8c26a to 65712802736e
2023-11-06 skia-autoroll Roll shaders-base from 445a3a5c87f5 to acfbe8ab8855
2023-11-06 fmalita [skottie] Use the specified locale for font iteration
2023-11-06 skia-autoroll Roll Dawn from 558f0dfed768 to 46e9e4cbfdfc (21 revisions)
2023-11-03 egdaniel Check for failed buffer creation before removing scratch key.

Created with:
  roll-dep third_party/skia

Change-Id: I667ed30a85cf56b6415e2d55743f4ac4f4b393c5
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/113690
Reviewed-by: Ben Wagner <bungeman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
1 file changed
tree: beccfa0006e4c3278777054e84a410ace7323d04
  1. build_overrides/
  2. constants/
  3. core/
  4. docs/
  5. fpdfsdk/
  6. fxbarcode/
  7. fxjs/
  8. public/
  9. samples/
  10. skia/
  11. testing/
  12. third_party/
  13. tools/
  14. xfa/
  15. .clang-format
  16. .gitattributes
  17. .gitignore
  18. .gn
  19. .style.yapf
  20. .vpython3
  21. AUTHORS
  22. BUILD.gn
  23. codereview.settings
  24. CONTRIBUTING.md
  25. DEPS
  26. DIR_METADATA
  27. LICENSE
  28. navbar.md
  29. OWNERS
  30. pdfium.gni
  31. PRESUBMIT.py
  32. PRESUBMIT_test.py
  33. PRESUBMIT_test_mocks.py
  34. README.md
README.md

PDFium

Prerequisites

PDFium uses the same build tooling as Chromium. See the platform-specific Chromium build instructions to get started, but replace Chromium's “Get the code” instructions with PDFium's.

CPU Architectures supported

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”.

It is expected that there are still some places lurking in the code which will not function properly on big-endian architectures. Bugs and/or patches are welcome, however providing this support is not a priority at this time.

Google employees

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.

Get the code

The name of the top-level directory does not matter. In the following example, the directory name is “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

On Linux, additional build dependencies need to be installed by running the following from the pdfium directory.

./build/install-build-deps.sh

Generate the build files

PDFium uses GN to generate the build files and Ninja to execute the build files. Both of these are included with the depot_tools checkout.

Selecting build configuration

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. By convention, <directory> should be named out/foo, and some tools / test support code only works if one follows this convention. A typical <directory> name is out/Debug.

use_goma = false  # Googlers only. Ensure goma is installed and running first.
is_debug = true  # Enable debugging features.

# Set true to enable experimental Skia backend.
pdf_use_skia = false

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 (Though it should work)

For sample applications like pdfium_test to build, one must set pdf_is_standalone = true.

By default, the entire project builds with C++20.

By default, PDFium expects to build with a clang compiler that provides additional chrome plugins. To build against a vanilla one lacking these, one must set clang_use_chrome_plugins = false.

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.

Building the code

You can build the sample program by running: ninja -C <directory> pdfium_test You can build the entire product (which includes a few unit tests) by running: ninja -C <directory> pdfium_all.

Running the sample program

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. Run pdfium_test --help to see all the options.

Testing

There are currently several test suites that can be run:

  • pdfium_unittests
  • pdfium_embeddertests
  • testing/tools/run_corpus_tests.py
  • testing/tools/run_javascript_tests.py
  • testing/tools/run_pixel_tests.py

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.

Pixel Tests

If your change affects rendering, a pixel test should be added. Simply add a .in or .pdf file in testing/resources/pixel and the pixel runner will pick it up at the next run.

Make sure that your test case doesn't have any copyright issues. It should also be a minimal test case focusing on the bug that renders the same way in many PDF viewers. Try to avoid binary data in streams by using the ASCIIHexDecode simply because it makes the PDF more readable in a text editor.

To try out your new test, you can call the run_pixel_tests.py script:

$ ./testing/tools/run_pixel_tests.py your_new_file.in

To generate the expected image, you can use the make_expected.sh script:

$ ./testing/tools/make_expected.sh your_new_file.pdf

Please make sure to have optipng installed which optimized the file size of the resulting png.

.in files

.in files are PDF template files. PDF files contain many byte offsets that have to be kept correct or the file won't be valid. The template makes this easier by replacing the byte offsets with certain keywords.

This saves space and also allows an easy way to reduce the test case to the essentials as you can simply remove everything that is not necessary.

A simple example can be found here.

To transform this into a PDF, you can use the fixup_pdf_template.py tool:

$ ./testing/tools/fixup_pdf_template.py your_file.in

This will create a your_file.pdf in the same directory as your_file.in.

There is no official style guide for the .in file, but a consistent style is preferred simply to help with readability. If possible, object numbers should be consecutive and /Type and /SubType should be on top of a dictionary to make object identification easier.

Embedding PDFium in your own projects

The public/ directory contains header files for the APIs available for use by embedders of PDFium. The PDFium project endeavors to keep these as stable as possible.

Outside of the public/ directory, code may change at any time, and embedders should not directly call these routines.

Code Coverage

Code coverage reports for PDFium can be generated in Linux development environments. Details can be found here.

Chromium provides code coverage reports for PDFium here. PDFium is located in third_party/pdfium in Chromium‘s source code. This includes code coverage from PDFium’s fuzzers.

Waterfall

The current health of the source tree can be found here.

Community

There are several mailing lists that are setup:

Note, the Reviews and Bugs lists are typically read-only.

Bugs

PDFium uses this bug tracker, but for security bugs, please use Chromium's security bug template and add the “Cr-Internals-Plugins-PDF” label.

Contributing code

See the CONTRIBUTING document for more information on contributing to the PDFium project.