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
eb2b622615
Remove `draw_render_target()` in favor of the standard tile-based rendering
...
path
2020-04-03 13:05:53 -07:00
Patrick Walton
cd37791d72
Implement the `drawImage()` method on canvas.
...
Closes #223 .
2020-04-02 16:30:49 -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
Sebastian K
29c6a2e428
Transform paints by the render transform
2020-04-02 11:17:03 -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
93f5fbc6d2
Add convenience constructors: `vec2f`, `vec2i`, `Vector2F::zero()`,
...
`Vector2I::zero()`
2020-03-31 11:29:21 -07:00
Patrick Walton
7b53cc6731
Close all subpaths right before filling them.
...
Closes #269 .
2020-03-27 14:50:02 -07:00
Patrick Walton
55df287fec
Move radial gradients from the CPU to the GPU
2020-03-26 21:24:20 -07:00
Patrick Walton
a8f7438cd9
Remove transforms from paths.
...
Paints aren't scale-invariant when rendered into the texture atlas, so they
actually do need individual transforms.
2020-03-04 16:28:21 -08:00
Patrick Walton
d0f4579864
Move `RenderTargetId` out of the `pattern` module
2020-03-03 15:50:48 -08:00
Patrick Walton
2beb2bb126
Apply path transforms to paints
2020-03-03 14:26:38 -08:00
Patrick Walton
12574101e5
Add a transform field to `DrawPath`.
...
This is currently applied to the outline and should eventually be applied to
paints as well.
2020-03-03 11:18:01 -08:00
Adam Nemecek
3d39c5e9b7
trimmed whitespace
2020-02-27 08:13:14 -08:00
Patrick Walton
77b3555828
Separate opacity out from paint.
...
This allows `globalAlpha` to work on render targets.
2020-02-26 12:43:07 -08:00
Patrick Walton
67d12adb6c
Replace layers with render targets, which can be used as patterns.
...
This allows us to efficiently handle a lot of workloads that require multiple
HTML canvases, without CPU readback. For example, you can render paths to a
render target, then turn that render target into a repeating pattern that you
fill other paths with. Or you can render paths to a render target and then
composite that render target as a whole with a blend mode.
This introduces a new `DrawRenderTarget` render command that blits a render
target without any paths involved. This is basically just a hack that works
around the fact that our tiled renderer doesn't yet support effects that widen
the ink region (i.e. blurs). It can be removed once we have that support.
2020-02-21 22:14:18 -08:00
Patrick Walton
6acd2d91f7
Implement `clear_rect()` in the canvas front-end by introducing the concept of
...
per-path blend modes.
These should be useful for some canvas composite operations as well.
2020-02-20 15:52:40 -08:00
Patrick Walton
16a2de88df
Rename "postprocessing" to "effects" and start initial work on composite ops
2020-02-20 14:22:07 -08:00
Patrick Walton
d9e994e46d
Transition the existing postprocessing system to a layers system.
...
This is preparatory work for composite ops and blurs.
Closes #261 .
2020-02-20 11:21:45 -08:00
Patrick Walton
3ad1c25796
Implement the even-odd fill rule
2020-02-17 14:44:48 -08:00
Patrick Walton
496b55ee4e
Add front-end support for clip paths. They don't do anything yet.
2020-02-15 13:21:12 -08:00
Patrick Walton
fefa3c3cd3
Rename `PathObject` to `DrawPath` to differentiate it from a clip path
2020-02-15 12:39:15 -08:00
Patrick Walton
90445bac7e
Implement basic support for non-repeating image patterns.
2020-02-11 17:20:21 -08:00
Patrick Walton
5a21557a6d
Implement basic linear gradients.
...
This is not a very efficient implementation yet, but it seems to work.
2020-02-10 16:01:05 -08: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
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
Sebastian Köln
090c21a20a
Move all scene exports into the export crate.
...
SVG, PDF and PS can now be created with Scene::export.
2019-06-25 11:26:37 +03:00
Sebastian Köln
1ca35d8426
add PS export as well. also rename svg2pdf into convert and add PS export to it
2019-06-24 22:41:34 +03:00
Sebastian Köln
0a5c4007f9
merge with master
2019-06-24 18:31:13 +03: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
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
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
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
0deb12b3a2
Implement `fill-opacity` and `stroke-opacity` in SVG
2019-05-14 18:09:01 -07:00
Patrick Walton
7a02b78b3d
Explicitly specify color texture coordinates for alpha and solid tiles.
...
This is groundwork for gradients and images.
This commit also refactors the interface for vertex attributes to use named
parameters (via structs), for clarity.
2019-05-14 15:11:04 -07:00
Patrick Walton
a54378f931
Make the paint texture dynamically-sized on the GPU side
2019-05-14 11:38:48 -07:00
Patrick Walton
376a1c7165
Rename "fill colors" to "paint" in preparation for gradients and images
2019-05-14 11:33:52 -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
a5d373cb91
Rename "object" to "path" in preparation for image objects
2019-05-10 12:03:38 -07:00
Patrick Walton
54672f2089
Add "save as SVG" support to the demo.
...
This is intended to help diagnose rendering problems, by allowing export to a
format that can be minimized and in which issues can be reproduced.
2019-05-07 14:37:46 -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
5c5e4e9313
Factor the scene thread out of the demo and into the renderer proper.
...
This simplifies Pathfinder's API considerably. Now users get off-main-thread
scene building "for free".
2019-05-01 17:12:25 -07:00
Patrick Walton
db8eb1c97c
Run `rustfmt` on the renderer crate
2019-04-29 16:45:29 -07:00
Patrick Walton
6c31e1bc01
In VR mode, render one eye and then reproject to both eyes instead of rendering
...
twice.
This reduces both CPU and GPU time a lot in exchange for a small loss in
quality.
2019-04-26 17:22:54 -07:00
Patrick Walton
62a3fefca4
Reenable the tile and fill counts in the debug display
2019-04-18 15:09:37 -07:00
Patrick Walton
21563d9d7f
Move the Z-buffer over to the `DenseTileMap` abstraction
2019-04-11 19:38:31 -07:00
Patrick Walton
9e38da25e1
Remove the `TileObjectPrimitive` structure in favor of a flat list of
...
backdrops.
This reduces memory usage a bit and adds the infrastructure needed to support a
tile map.
2019-04-11 18:54:03 -07:00
Patrick Walton
3d4f8bd008
Pipeline between CPU and GPU at a more fine-grained level.
...
This makes us stop running one frame behind.
2019-04-09 17:06:43 -07:00
Patrick Walton
d090dd459b
Remove the layer of indirection between object indices and shaders
2019-04-03 11:58:45 -07:00
Patrick Walton
db3851d754
Get subpixel AA and gamma correction working in 2D
2019-03-25 16:20:34 -07:00
Patrick Walton
224c8e85b9
Create separate shaders for monochrome and multicolor tiles.
...
This is preparation for fixing subpixel AA.
2019-03-22 14:28:31 -07:00
Patrick Walton
6ca5dc5f62
Add basic barrel distortion support for VR
2019-03-20 13:41:04 -07:00
Patrick Walton
b80ab2ad25
Only show the "Text Effects" button when a monochrome SVG is loaded
2019-03-06 19:35:57 -08:00
Patrick Walton
9af3bac11f
Implement depth interpolation, not working yet
2019-02-18 13:42:30 -08:00
Patrick Walton
31f1fae951
Add a TODO about monotonic conversion
2019-02-12 08:57:49 -08:00
Patrick Walton
f04c000cae
Add a quick check to skip clipping when an outline is entirely inside or
...
outside the clip area
2019-02-09 19:24:30 -08:00
Patrick Walton
a81850a899
Add window resizing support to the demo
2019-02-06 18:09:37 -08:00
Patrick Walton
8771dd6789
wip: dilation not working yet
2019-02-05 20:10:20 -08:00
Patrick Walton
3d0463999c
Add a SIMD integer rect type
2019-02-05 10:55:01 -08:00
Patrick Walton
fe410e066f
Add a SIMD rect type
2019-02-05 10:03:20 -08:00
Patrick Walton
63b47f1abe
Move basic geometry primitives to the `pathfinder_geometry::basic` module
2019-02-04 20:20:32 -08:00
Patrick Walton
f25682f0f1
Add a defringing shader for subpixel antialiasing, untested as of yet
2019-02-04 16:04:13 -08:00
Patrick Walton
a5234e6695
Stop clipping 3D quads over and over
2019-02-02 13:53:04 -08:00
Patrick Walton
b0e91369e5
Do scene building just-in-time on a per-outline basis as part of tiling
2019-02-02 11:36:42 -08:00
Patrick Walton
df59fd9792
Rename `Point4DF32` to `Point3DF32`
2019-02-01 17:07:03 -08:00
Patrick Walton
6a286ab153
Remove `Point3DF32`
2019-02-01 17:05:35 -08:00
Patrick Walton
89244ba6cf
Do clipping in 3D homogeneous space
2019-01-31 15:29:13 -08:00
Patrick Walton
4801503dd8
Fix curve/edge intersection logic in clipping
2019-01-31 10:12:37 -08:00
Patrick Walton
e105bdb7c9
Display timing info in the demo
2019-01-30 14:42:06 -08:00
Patrick Walton
e3bf703105
Stop using 100% CPU; fix bug when splitting line segments at Y extrema
2019-01-29 15:35:07 -08:00
Patrick Walton
e958363872
Allow scenes to be dumped as SVG (untested) and make 3D mode optional in the demo
2019-01-29 14:50:15 -08:00
Patrick Walton
a9c1760de5
Clipping mostly works now
2019-01-28 14:58:57 -08:00
Patrick Walton
7e3365c481
wip
2019-01-28 12:57:15 -08:00
Patrick Walton
80db7155b8
wip
2019-01-25 17:07:37 -08:00
Patrick Walton
938bd30a78
wip
2019-01-25 14:28:53 -08:00
Patrick Walton
93ae7d3548
Basic perspective support
2019-01-16 16:53:10 -08:00
Patrick Walton
02928f295d
Basic rect clipping
2019-01-15 13:49:26 -08:00
Patrick Walton
0097ffab19
wip
2019-01-15 11:42:25 -08:00
Patrick Walton
821b54b8f4
Factor renderer and SVG code out into separate crates
2019-01-14 14:20:36 -08:00