Commit Graph

207 Commits

Author SHA1 Message Date
Patrick Walton f607b607b0 Composite render targets using tiles, taking the Z-buffer into account.
We can do more tile-based optimization, but this should be enough to ensure a
correct rendering.

This temporarily breaks subpixel AA, but it should be fixable by modifying
`blur.fs.glsl`.

Closes #271.
2020-03-02 20:10:10 -08:00
Patrick Walton 0f35d9c817 Add an embedded resource loader that places resources directly in the binary.
This is useful for WebGL and for downstream crates.io use.
2020-02-28 17:10:53 -08:00
Patrick Walton 5421525eaa Implement the HSL filters (called "non-separable blend modes" in the spec).
These cannot be implemented with the standard OpenGL blending functions, so we
have to do them manually in a shader, which requires a good deal of machinery
to create intermediate framebuffers and so forth.
2020-02-24 15:37:44 -08:00
Patrick Walton 3245796445 Add support for multiple paint texture pages.
This avoids arbitrary limits on the number of images, gradients, etc. you can
have.
2020-02-21 14:46:10 -08:00
Patrick Walton 4933efb513 Add Lighten and Darken composite ops 2020-02-20 20:38:43 -08:00
Patrick Walton 25f9346160 Add an incomplete port of the NanoVG example app 2020-02-19 11:00:03 -08:00
Emmanuel Gil Peyrot 6ce416e77c Bump all outdated dependencies
I’m pleasantly surprised that none of these required any (visible) code
change, but tests pass so let’s go with that. :)
2020-02-06 09:39:50 +01:00
Emmanuel Gil Peyrot 03e3a9fded Bump glutin dependency in the example
The API of winit has changed quite a lot in their 0.20 release.
2020-02-06 09:39:50 +01:00
Emmanuel Gil Peyrot fb22aafada Update swf-related crates
swf-tree got renamed into swf-types for their 0.10 release.
2020-02-06 09:39:50 +01:00
Patrick Walton 2db43797c3 Split colors out into their own crate.
A lot of downstream consumers of `pathfinder_gpu` want to use colors without
the path stuff.
2020-01-31 09:17:04 +01:00
Patrick Walton 0662f6433f Allow any texture format to be uploaded; fix Metal compilation on newer rustcs 2019-12-20 11:48:51 -08:00
Kamal Ahmad 29713c5cd9 Bump lyon, font-kit and skribo versions to fix crashes 2019-11-20 22:51:03 +05:00
est31 3928e8d964 Rename the feature text → pf-text 2019-08-05 22:49:08 +02:00
est31 fa1a32bdbb Make text rendering optional in pathfinder_canvas 2019-07-27 06:13:02 +02:00
Patrick Walton 2c984de1ea Add convenience translation, rotation, and scaling methods to `Transform2D` 2019-07-12 11:34:48 -07:00
Patrick Walton 1eb28a5539 Fix incorrect definition of 2D transform multiplication 2019-07-12 11:26:09 -07:00
Patrick Walton bcac119324 Rename `Transform2DF` to `Transform2F` and `Transform3DF` to `Transform4F` 2019-07-11 14:59:10 -07:00
Patrick Walton 4d866f4a75 Move `svg2pdf` to `utils/` 2019-06-24 23:05:09 -07:00
Patrick Walton ad858564a9 Add a minimal macOS example app using the C Metal API 2019-06-24 23:03:37 -07:00
Patrick Walton a8d20cb37f Add transform support to the C API, and fix build problems 2019-06-24 14:03:26 -07:00
Sebastian Köln 0e08bc6696 fix warning 2019-06-24 20:20:15 +03:00
Sebastian Köln 0a5c4007f9 merge with master 2019-06-24 18:31:13 +03:00
Patrick Walton 2c49a3360e Add Metal support to the C API 2019-06-21 13:37:17 -07:00
Patrick Walton 1caad35b46 Use `cbindgen` instead of hand-writing a header file 2019-06-21 11:35:18 -07:00
Patrick Walton 431dcf3d2e Rename `pathfinder_geometry::basic` to simply `pathfinder_geometry`, and move
the remaining code in that crate to a new crate, `pathfinder_content`

The old hierarchy was confusing.
2019-06-21 10:06:19 -07:00
Patrick Walton b16300bf02 Move the SWF assets into `resources/`. 2019-06-21 09:32:48 -07:00
Patrick Walton 336f2ca302 Rename `pathfinder_flash` to `pathfinder_swf` for consistency with other crates
in the Rust Flash ecosystem
2019-06-21 09:28:15 -07:00
Patrick Walton 82b0826407 Merge remote-tracking branch 'hardiesoft/swf_renderer' 2019-06-21 09:25:00 -07:00
Patrick Walton 0012f09eeb Fix examples 2019-06-20 21:43:57 -07:00
Jon Hardie 4d53ab60fc [WIP] Updating to master 2019-06-21 11:10:26 +12:00
Jon Hardie ba1ff45cb2 Merge branch 'master' of https://github.com/servo/pathfinder into swf_renderer 2019-06-21 10:58:52 +12:00
Patrick Walton 487577a11b Add Metal support.
This commit substantially reworks the `pathfinder_gpu` API to better support
modern APIs like Metal. It should open the door to `gfx-rs`, `wgpu`, Vulkan,
and D3D12 backends relatively straightforwardly.

A new example, `canvas_metal_minimal`, has been added.

Note that the new Metal shaders require a patched version of `spirv-cross` to
build properly. An upstream patch is forthcoming.
2019-06-20 11:47:22 -07:00
Sebastian Köln 4039658155 add a simple PDF export 2019-06-15 17:50:25 +03:00
Jon Hardie 96f0ed0926 Merge branch 'master' of https://github.com/servo/pathfinder into swf_renderer 2019-06-15 16:22:45 +12:00
Jon Hardie 5d698998e9 [WIP] Initial support for rendering graphic symbols from swf files. 2019-06-15 16:08:46 +12:00
Patrick Walton 5dfe14ebc4 Add a minimal `glutin` example 2019-06-12 10:50:24 -07:00
Patrick Walton a1b0df0a42 Rename `Point2DF` to `Vector2F`, `Point3DF` to `Vector4F`, and `LineSegmentF`
to `LineSegment2F`.

Straw poll on Twitter suggested that these names were preferred.
2019-06-03 12:39:29 -07:00
Patrick Walton 95f3337c6f Add the `ellipse` method to canvas paths 2019-05-30 17:24:12 -07:00
Patrick Walton 607a518544 Implement canvas text align 2019-05-30 15:08:15 -07:00
Patrick Walton 9138e1e0bb Pass in the font context to the canvas rendering context constructor so that it
can be reused.

Creating a system font source can do I/O on some platforms, so obviously we
don't want to do it every frame.
2019-05-29 21:15:42 -07:00
Patrick Walton e1bcc11ace Change the `F32` and `I32` suffixes to `F` and `I` to match the C API.
They're shorter and less noisy.
2019-05-29 19:17:16 -07:00
Patrick Walton a75b635722 Implement round joins 2019-05-29 19:09:15 -07:00
Patrick Walton e04cc273ee Add enough C bindings to recreate `canvas_minimal` in C.
Closes #12.
2019-05-25 20:21:38 -07:00
Patrick Walton 8c4f05ce39 Initial rudimentary Lottie parsing code 2019-05-23 18:03:09 -07:00
Patrick Walton 6eab3fa2d8 Implement `globalAlpha` for canvas 2019-05-14 18:26:10 -07:00
Patrick Walton 7518fa65c0 Update dependencies 2019-05-13 18:47:19 -07:00
Patrick Walton 89ca998fa8 Add a convenience method for creating a scene proxy with an empty scene.
This makes animation rendering loops a bit easier for users.
2019-05-13 18:29:57 -07:00
Patrick Walton f24d93819b Add arc building methods and switch the Moiré demo to use them.
Also, stop taking points by reference in many methods, for consistency.
2019-05-13 12:42:13 -07:00
Patrick Walton 639a8f39e8 Add Moiré demo 2019-05-11 11:53:50 -07:00
Patrick Walton a078766dc6 Implement basic text rendering in canvas with `skribo` and `font-kit`.
Skribo currently writes some debugging info to standard output. A patch is
forthcoming to fix that.
2019-05-09 15:21:18 -07:00
Patrick Walton 9de7d95d33 Start a simple HTML canvas-like API, and add a minimal example to show how to
use it.
2019-05-03 14:15:38 -07:00
Patrick Walton 93c928bf5c Move Pathfinder to `pathfinder-classic` in preparation for Pathfinder 2 2017-06-27 14:13:11 -07:00
Patrick Walton b75cd9e5a9 Add an API allowing for custom vector paths 2017-03-03 13:32:51 -08:00
Patrick Walton 7862bec2bb Speed up `lorem-ipsum`, especially in debug builds 2017-02-28 21:47:17 -08:00
Patrick Walton 45ade674be Refactor `lorem-ipsum` 2017-02-28 12:33:42 -08:00
Patrick Walton 6d66cfc30a Begin to implement the interpreter 2017-02-26 12:12:34 -08:00
Patrick Walton 37736b27b9 Fix interpreter a bit; Arial fpgm now parses 2017-02-24 12:19:32 -08:00
Patrick Walton b86133a4ef Initial experimental support for subpixel antialiasing 2017-02-22 16:31:44 -08:00
Patrick Walton 5e9b8c9423 Implement basic support for WOFF 1.0 2017-02-22 14:19:27 -08:00
Patrick Walton 9490fa2d3b Split the `otf` module up into `containers` and `tables`.
Putting all container format parsing in `otf/mod.rs` won't scale as we add more, such as WOFF.
2017-02-22 10:22:14 -08:00
Patrick Walton 9fda8f6534 Move the subpixel positioning logic in `lorem-ipsum` to the Typesetter abstraction 2017-02-21 21:50:00 -08:00
Patrick Walton 68f5694b6b Factor out more code from `lorem-ipsum` into a new `GlyphStore` abstraction 2017-02-21 15:51:39 -08:00
Patrick Walton abacb5a4c9 Move some code from `lorem-ipsum` into a new `Typesetter` object so others can use it 2017-02-21 13:06:48 -08:00
Patrick Walton 49408b95cb Add support for subpixel offsets.
Closes #11.
2017-02-20 16:01:15 -08:00
Patrick Walton cd11deab46 Support RGBA atlases, needed for WebRender 2017-02-10 19:07:23 -08:00
Patrick Walton 959293839f Read shaders from disk instead of compiling them into the binary 2017-02-10 17:44:22 -08:00
Patrick Walton c4c19076c7 Allow the same glyph at different sizes to be rendered into the same atlas. 2017-02-10 17:20:05 -08:00
Patrick Walton d306ef01d1 Complete the documentation 2017-02-10 16:04:13 -08:00
Patrick Walton 6261c87b89 Read the OS/2 metrics to determine the right line spacing 2017-02-09 20:02:32 -08:00
Patrick Walton 1e50bf78ba Implement basic kerning via the 'kern' table 2017-02-08 17:10:49 -08:00
Patrick Walton a0b23592b5 Allow specific fonts in collections to be selected 2017-02-08 15:34:16 -08:00
Patrick Walton 428a91aefa Get things working on Windows 2017-02-08 13:55:36 -08:00
Patrick Walton 851b40ea6c Document the crate 2017-02-07 20:20:14 -08:00
Patrick Walton ccf17493e0 Rename `GlyphRanges` to `GlyphMapping` and document it 2017-02-07 20:02:10 -08:00
Patrick Walton dcd3eefa33 Refactor the API to consume builders 2017-02-07 19:32:32 -08:00
Patrick Walton 66d239cf2f Break at word boundaries 2017-02-07 14:40:03 -08:00
Patrick Walton 4be3938ab7 Reformat the lorem ipsum text 2017-02-06 18:13:58 -08:00
Patrick Walton 65153b65ee Fix subpixel positioning 2017-02-06 18:02:16 -08:00
Patrick Walton bc6efc9b62 Compute shelf height properly 2017-02-06 14:45:06 -08:00
Patrick Walton 23f7f88f43 Add support for composite glyphs 2017-02-06 11:44:26 -08:00
Patrick Walton 23fa035178 Rename "glyph buffer" to "outline", since "glyph" is ambiguous 2017-02-03 17:18:05 -08:00
Patrick Walton d5be9e1f16 Rename "batch" to "atlas" and "atlas" to "rect packer" 2017-02-03 17:04:57 -08:00
Patrick Walton da7c70f035 Handle glyph outlines in which the first point is off-curve correctly.
These show up in Helvetica.dfont and Times.dfont.
2017-02-03 15:18:07 -08:00
Patrick Walton ce383385df Add partial support for Mac `.dfont` suitcases 2017-02-03 13:13:54 -08:00
Patrick Walton 4418f5b07c Audit public members some 2017-02-02 17:00:37 -08:00
Patrick Walton 3fb592e05a Fix up examples and tests 2017-02-02 16:40:46 -08:00
Patrick Walton b7e9763e5a Update the benchmark 2017-02-02 16:06:36 -08:00
Patrick Walton 94406a1d62 Add a simple benchmarking tool. Only benchmarks GPU time, not CPU for
now.
2017-01-31 18:33:24 -08:00
Patrick Walton 6ae7601283 Add borders between glyphs in the atlas; allow the atlas to be dumped in the demo 2017-01-30 20:04:39 -08:00
Patrick Walton 5bccf88445 Make zooming work better; fix atlas sizing bugs 2017-01-30 18:33:44 -08:00
Patrick Walton a927294790 Add rudimentary support for TTC 2017-01-27 13:01:21 -08:00
Patrick Walton 8fbb875654 Stop leaking glyph buffers 2017-01-27 11:31:24 -08:00
Patrick Walton 04ae5651ec Add more text to the Lorem Ipsum demo and fix handling of empty glyphs
in the loca table
2017-01-26 20:56:14 -08:00
Patrick Walton 89a2bf54b0 Add a new example and a toy shaper 2017-01-26 18:53:50 -08:00
Patrick Walton 1deaf9136e Don't require users of the library to load OTF tables individually 2017-01-26 10:27:38 -08:00
Patrick Walton 30daf10cdd Fix syntax on Linux; drop GL version to 3.3 2017-01-25 20:25:54 -08:00
Patrick Walton 2f181f23aa Add a draft GLSL accumulation step, currently untested 2017-01-25 19:22:04 -08:00
Patrick Walton 1336bb790e Add a geometry-shader-based path for debugging.
This is useful for testing via llvmpipe or softpipe on Linux, because
no software Mesa backend supports tessellation shaders.
2017-01-25 18:53:11 -08:00
Patrick Walton d5b61e382e Get things basically working 2017-01-25 17:08:00 -08:00
Patrick Walton 50ad78db2a Draft end-to-end support for the new algorithm. Not working yet. 2017-01-24 15:30:14 -08:00
Patrick Walton 0569831969 Fix shader compilation errors; convert the coverage buffer to a texture 2017-01-23 19:39:51 -08:00
Patrick Walton bdf6ebab24 Draft complete end-to-end code. Not working yet. 2017-01-11 20:44:10 -08:00
Patrick Walton 7056a7632b Create buffers and create skeleton OpenCL shaders 2017-01-10 19:57:08 -08:00
Patrick Walton 941aaea676 Encode contours. 0.3-0.4 µs per glyph or so. 2017-01-09 19:49:00 -08:00
Patrick Walton abd8fb8e7b Parse enough of the OTF format to be able to dump outlines 2017-01-09 18:29:41 -08:00
Patrick Walton ce811c0e48 Implement the atlas 2017-01-07 11:52:45 -08:00
Patrick Walton 34cd1ef9b0 Initial commit 2017-01-06 23:49:45 -08:00