dependabot[bot]
e2b79f24e4
Bump elliptic from 6.5.2 to 6.5.4 in /examples/canvas_webgl_minimal/www
...
Bumps [elliptic](https://github.com/indutny/elliptic ) from 6.5.2 to 6.5.4.
- [Release notes](https://github.com/indutny/elliptic/releases )
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.2...v6.5.4 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-03-11 00:12:23 +00:00
bors-servo
953a1dab60
Auto merge of #404 - leroycep:minimal-example-rerendering, r=pcwalton
...
Make `canvas_minimal` example rerender on refresh
I'm not sure if this actually works, because the `canvas_minimal` example doesn't run on my computer.
2020-07-23 14:18:55 -04:00
Patrick Walton
cd129e81f3
Merge pull request #407 from servo/dependabot/npm_and_yarn/examples/canvas_webgl_minimal/www/lodash-4.17.19
...
Bump lodash from 4.17.15 to 4.17.19 in /examples/canvas_webgl_minimal/www
2020-07-22 20:13:17 -07:00
LeRoyce Pearson
263dc0ab15
Make canvas minimal render on first loop
2020-07-22 12:28:36 -06:00
Patrick Walton
d01bc5d002
Make the fields of `TextMetrics` lazily calculated, and add an API that
...
eliminates double layouts.
This adds an extension to the HTML canvas API that allows you to pass the
`TextMetrics` object returned by `measure_text()` to `fill_text()` and/or
`stroke_text()` to draw the measured text without laying it out again. It
improves performance on the `canvas_nanovg` demo.
2020-07-21 19:33:15 -07:00
dependabot[bot]
368418f61a
Bump lodash in /examples/canvas_webgl_minimal/www
...
Bumps [lodash](https://github.com/lodash/lodash ) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases )
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19 )
Signed-off-by: dependabot[bot] <support@github.com>
2020-07-21 10:03:01 +00:00
LeRoyce Pearson
5951b32ede
Make `canvas_minimal` example rerender on refresh
2020-07-17 16:40:04 -06:00
LeRoyce Pearson
f0ee329c05
Make `canvas_text` example render on expose
...
Before this change, the `canvas_text` example would become blank after
navigating to another workspace or being put beneath another window.
This change will listen for the SDL window exposed event, and will
render then instead of only at the beginning.
2020-07-17 14:55:37 -06:00
Patrick Walton
bb89f52d39
Cache images from frame to frame.
...
Images are cached for one frame; if they are not used the next frame, they're
freed.
2020-07-15 12:36:52 -07:00
Patrick Walton
e54e0e4760
Start a new `web_canvas` crate, for usage in the browser as a `<canvas>` replacement
2020-07-04 09:33:49 -07:00
Patrick Walton
5f8fcbeac2
Fix WebGL, and add a simple example of WebGL usage
2020-07-02 19:49:09 -07:00
Patrick Walton
42289eec6e
Fix Metal memory management and the `canvas_metal_minimal`, `canvas_nanovg`,
...
and `macos_app` examples.
`winit` does not create an autorelease pool, so the Metal backend had not taken
the presence of one into account. Now the Metal backend creates and flushes
autorelease pools as necessary.
Closes #334 .
Closes #376 .
2020-06-29 12:48:49 -07:00
Patrick Walton
a2d87a6624
Update the C canvas example
2020-06-23 13:31:53 -07:00
Patrick Walton
9ff46b39cd
Update examples
2020-06-23 13:31:53 -07:00
Patrick Walton
abecb697be
Quit the NanoVG demo when pressing Escape, not any key.
...
The previous setup was making it hard to take screenshots.
2020-05-15 19:14:32 -07:00
Patrick Walton
deee2436c1
Make the NanoVG demo use the filesystem resource loader.
...
The embedded resource loader doesn't have the needed fonts.
2020-05-15 19:14:08 -07:00
Corey Farwell
9f71feb545
Update main.rs
2020-05-09 12:49:43 -04:00
Corey Farwell
e1ec307b3f
Switch to the embedded loader for the examples.
2020-05-08 21:17:23 -04: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
41c0c5f071
Upgrade to the latest master surfman
2020-05-08 12:47:58 -07:00
Patrick Walton
90fb36f199
Switch to using surfman in X11 mode.
...
Partially addresses #310 .
2020-05-08 12:22:46 -07:00
Patrick Walton
da2f65ddf4
Fix `surfman` reference in `Cargo.toml`
2020-04-30 15:04:49 -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
0b43f629cd
Cache loaded fonts and glyph outlines.
...
Approximately a 70% CPU time improvement on the NanoVG demo.
2020-04-16 16:28:44 -07:00
Patrick Walton
83c05e9f77
Improve the fidelity of the NanoVG demo some more
2020-04-14 18:49:47 -07:00
Patrick Walton
b1d8e0526e
Make some shadow blurs match the original NanoVG demo better
2020-04-14 16:13:12 -07:00
Patrick Walton
39f84b287d
Make the paragraph color and line height in the NanoVG demo match the original
...
more
2020-04-14 15:21:01 -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
fda9b8b9e1
Make the clip example match the NanoVG example
2020-04-11 19:08:20 -07:00
Patrick Walton
3e9558957f
Add a shadow to the color wheel marker in the NanoVG demo
2020-04-11 19:08:00 -07:00
Patrick Walton
def7da5de2
Remove obsolete TODOs in the NanoVG demo
2020-04-11 19:07:50 -07:00
Patrick Walton
15101e90dd
Draw caret position in the NanoVG demo
2020-04-10 18:13:42 -07:00
Patrick Walton
ca0e9e9e14
Draw the paragraph gutter in the NanoVG demo
2020-04-10 16:00:25 -07:00
Patrick Walton
4f1d376fe5
Refactor paragraph layout in the NanoVG demo; fix BG/FG draw order
2020-04-10 15:30:12 -07:00
Patrick Walton
df08d76627
Make the color wheel animation in the NanoVG demo match NanoVG
2020-04-10 13:37:06 -07:00
Patrick Walton
ca36fed47b
Fix calculation of wallclock time in the NanoVG demo
2020-04-09 18:01:12 -07:00
Patrick Walton
47919db8f3
Fix frame time measurement in the GL backend, and add it to the NanoVG demo
2020-04-09 17:49:28 -07:00
Patrick Walton
19aa9c8e54
Only paint text backgrounds up to the appropriate width in the NanoVG demo
2020-04-09 12:33:16 -07:00
Patrick Walton
a196f1eff8
Fix spriting imperfections in the thumbnails in the NanoVG
2020-04-09 12:15:39 -07:00
Patrick Walton
895f73096e
Switch back to instanced drawing for tiles.
...
Improves tile build time by something around 2x in the NanoVG demo.
2020-04-08 17:16:54 -07:00
Patrick Walton
941abd202e
Add the tooltip to the NanoVG demo
2020-04-03 15:38:14 -07:00
Patrick Walton
b38f75a38d
Add line widths to the NanoVG demo
2020-04-03 14:51:37 -07:00
Patrick Walton
ad61b78e39
Remove box gradients from the NanoVG demo in favor of shadows
2020-04-03 14:33:00 -07:00
Patrick Walton
eb2b622615
Remove `draw_render_target()` in favor of the standard tile-based rendering
...
path
2020-04-03 13:05:53 -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
5d43eedf20
Replace a drop shadow with a box gradient
2020-04-02 11:59:35 -07:00
Patrick Walton
542d2c27fa
Add `translate`, `rotate`, and `scale` methods to `CanvasRenderingContext2D`.
2020-04-02 11:40:53 -07:00
Patrick Walton
8f2fabbc47
Add icons to the NanoVG demo from Noto Emoji
2020-04-01 20:20:32 -07:00
Patrick Walton
e05b5df562
Stop duplicating font names everywhere in the NanoVG demo
2020-04-01 17:31:16 -07:00
Patrick Walton
da9b944e77
Clean up a few uses of `RectF::contract()` and `RectF::dilate()`
2020-04-01 17:27:08 -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
40bd13aa5a
Add convenience color construction methods
2020-04-01 16:37:36 -07:00
Patrick Walton
ae97ccea5a
Improve ergonomics of the canvas font interface, and use the right fonts in the
...
NanoVG demo.
2020-04-01 16:25:13 -07:00
Patrick Walton
956b9020e8
Rename `overpass-regular.otf` to `Overpass-Regular.otf`
2020-04-01 13:22:29 -07:00
Patrick Walton
cedc5595db
Fix `canvas_moire`
2020-04-01 13:03:58 -07:00
Patrick Walton
bf6890b341
Fix `canvas_minimal`
2020-03-31 20:21:27 -07:00
Patrick Walton
7c5c43b50f
Use HiDPI and a larger window size in the NanoVG demo
2020-03-31 20:18:25 -07:00
Patrick Walton
bbcd371efc
Show the progress spinners behind thumbnail images in the NanoVG demo
2020-03-31 17:14:06 -07:00
Patrick Walton
2db4cfcfed
Uncomment round join code in the NanoVG demo now that it doesn't crash
2020-03-31 13:32:23 -07:00
Patrick Walton
93f5fbc6d2
Add convenience constructors: `vec2f`, `vec2i`, `Vector2F::zero()`,
...
`Vector2I::zero()`
2020-03-31 11:29:21 -07:00
Patrick Walton
4af74f225d
Add support to canvas for the commonly-used `textBaseline` values
2020-03-30 22:00:13 -07:00
Patrick Walton
9a0fbe1d11
Flesh out the NanoVG demo yet more
2020-03-30 21:33:20 -07:00
Patrick Walton
a1f0ae097a
Add thumbnail images to the NanoVG demo
2020-03-30 16:18:41 -07:00
Patrick Walton
257067e368
Flesh out the NanoVG example even more
2020-03-28 12:45:23 -07:00
Patrick Walton
ed2807eb84
Flesh out the NanoVG demo some more
2020-03-27 20:53:57 -07:00
Patrick Walton
9723fa441b
Update `image`, `glutin`, and `jni` crates.
...
From #277 .
2020-03-27 15:49:26 -07:00
Patrick Walton
55df287fec
Move radial gradients from the CPU to the GPU
2020-03-26 21:24:20 -07:00
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