Patrick Walton
1a37b7f819
Merge pull request #327 from pcwalton/glfw-c-example
...
Add an example showing how to use the Pathfinder C API with GLFW
2020-05-08 16:53:06 -07:00
Patrick Walton
feb6cca419
Merge pull request #326 from pcwalton/c-font-context-docs
...
Document `PFCanvasFontContextCreateWithFonts()`.
2020-05-08 15:10:07 -07:00
Patrick Walton
bbf4c88d0d
Add an example showing how to use the Pathfinder C API with GLFW
...
Closes #258 .
2020-05-08 15:09:21 -07:00
Patrick Walton
b669cc7087
Document `PFCanvasFontContextCreateWithFonts()`.
...
Closes #247 .
2020-05-08 14:27:41 -07:00
Patrick Walton
9998fe49bd
Provide a placeholder definition of `CAMetalLayer` in the C API.
...
Closes #260 .
2020-05-08 14:07:06 -07:00
Patrick Walton
2421de6616
Enable compute shader by default if the OpenGL version is high enough.
2020-05-08 12:16:31 -07:00
Patrick Walton
ac83f79d94
Add a compute shader path, optimize GPU memory management, and switch from SDL
...
to `surfman`.
This is a large commit; explanations of each change follow.
This adds an optional compute shader path, off by default, for rendering fills
to alpha masks. It usually does not improve performance at present, but it
provides a good baseline for further optimizations. Later improvements will
likely aim to avoid writes to the mask texture entirely. Supporting
infrastructure for compute shader has been added to `pathfinder_gpu` for the
OpenGL and Metal backends.
The Metal backend has been optimized to avoid unneccessary buffer allocations
and reflection. As part of this, argument buffers have been removed, as the
current SPIRV-Cross compiler no longer requires them.
The GPU renderer has been improved to avoid stalls. Now, separate buffers are
allocated for each fill batch and for each frame. This can be extended in the
future to allow for separate buffers for tile draw operations as well.
SDL usage has been removed in favor of the native Rust `surfman` and `winit`.
Because `surfman` allows for selection of the integrated GPU on multi-GPU
system, it is chosen by default. The demo supports a new
`--high-performance-gpu` option to opt into the discrete GPU.
2020-04-30 13:33:29 -07:00
Patrick Walton
5efdf2a04a
Implement the missing pieces of `TextMetrics` for canvas.
...
This required a `font-kit` upgrade, and with it a `skribo` upgrade.
2020-04-14 15:01:30 -07:00
Patrick Walton
ba7fe4be39
Add the ability to merge scenes together, and expose it to the canvas API.
...
Closes #268 .
2020-04-02 14:04:58 -07:00
Patrick Walton
542d2c27fa
Add `translate`, `rotate`, and `scale` methods to `CanvasRenderingContext2D`.
2020-04-02 11:40:53 -07:00
Patrick Walton
794dd55038
Add some implicit conversions between scalars and vectors where appropriate
2020-04-01 17:20:32 -07: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
3ad1c25796
Implement the even-odd fill rule
2020-02-17 14:44:48 -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
2d2bc14e5c
Remove unused import
2020-02-06 08:45:14 +01:00
Patrick Walton
706b6dbd1d
Add an API for gradients to the canvas frontend, not implemented yet
2020-02-05 20:01:11 -08: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
Atul Varma
84b4d1a5a8
Add canvas save and restore methods to C API.
2019-07-13 19:41:30 -04:00
Atul Varma
d72e61d60b
Add PFCanvasSetCurrentTransform, PFCanvasResetTransform.
2019-07-13 19:38:58 -04:00
Patrick Walton
bcac119324
Rename `Transform2DF` to `Transform2F` and `Transform3DF` to `Transform4F`
2019-07-11 14:59:10 -07:00
Patrick Walton
6785ba0623
Flesh out the Metal C API more
2019-06-24 22:55:55 -07:00
Patrick Walton
a8d20cb37f
Add transform support to the C API, and fix build problems
2019-06-24 14:03:26 -07:00
Patrick Walton
82171088c5
Expose text alignment in the C API
2019-06-24 12:06:05 -07:00
Patrick Walton
2c49a3360e
Add Metal support to the C API
2019-06-21 13:37:17 -07:00
Patrick Walton
1c34b12948
Add some font functions to the C API
2019-06-21 13:17:11 -07:00
Patrick Walton
1caad35b46
Use `cbindgen` instead of hand-writing a header file
2019-06-21 11:35:18 -07:00
Patrick Walton
9107f21966
wip
2019-06-21 10:40:32 -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
0012f09eeb
Fix examples
2019-06-20 21:43:57 -07:00
Patrick Walton
3f601be08c
Add C bindings to fill and stroke styles
2019-06-20 16:57:20 -07:00
Patrick Walton
36db39883c
Add C bindings to the canvas text APIs
2019-06-20 16:07:38 -07:00
Patrick Walton
2129e4f2e1
Add missing path methods to the C API
2019-06-20 15:51:25 -07:00
Patrick Walton
d2fbb23031
Expose more stroke features in the C API
2019-06-20 13:01:54 -07: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
Atul Varma
6d41cb4dad
Mention PFCanvasCreate() consumes the font context
2019-06-04 18:00:22 -04:00
Patrick Walton
e3112d1a84
Add `PFCanvasFontContextClone()`
2019-06-04 14:55:59 -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
eeaf51ce72
Expose line cap features to C
2019-05-30 21:28:52 -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
e04cc273ee
Add enough C bindings to recreate `canvas_minimal` in C.
...
Closes #12 .
2019-05-25 20:21:38 -07:00