Commit graph

761 commits

Author SHA1 Message Date
Chad Brokaw eb8cc5275f Replace font backend
This replaces the old moscato font backend with one that has proper support for variable fonts.
2023-03-21 19:27:21 -04:00
Daniel McNab 17096ad878
Update for Bevy 0.10 and other dependencies (#290) 2023-03-16 15:44:10 +00:00
Daniel McNab fd6bfe91d6
Fix handling of interactivity (#295)
* Fix handling of interactivity

* Sort out silly mixup
2023-03-16 13:38:43 +00:00
Florian Köhler c503973739
Add space key for transform reset (#294)
Co-authored-by: Florian Köhler <power-unsealed>
2023-03-15 15:18:16 +00:00
Chad Brokaw f3d45fc01d
Merge pull request #293 from linebender/images
Let's add images
2023-03-15 08:37:36 -04:00
Chad Brokaw a6307a2520 predicate image loads on non-zero mask 2023-03-15 08:37:00 -04:00
Chad Brokaw 923c949e95 Remove some unused imports 2023-03-10 21:00:42 -05:00
Chad Brokaw 37f05b853c Address initial review feedback
* Add comment about naughty ptr2int cast
* Change Option to anyhow::Result in test scene ImageCache
* Replace magic constant with pixel stride from selected format
2023-03-10 15:14:34 -05:00
Markus Siglreithmaier dccd59a217
Merge pull request #292 from msiglreith/svg-transform
vello_svg: Use affine transformation
2023-03-10 12:36:39 +01:00
Chad Brokaw d12b711fe1 premultiply alpha before filtering 2023-03-10 02:04:21 -05:00
Chad Brokaw a8585781cd move atlas rect to info
Atlas offset and image size were originally stored in the ptcl but are not tile dependent. Moving these to info saves 8 bytes per image tile.
2023-03-10 01:42:50 -05:00
Chad Brokaw 165b3a083b Let's add images 2023-03-09 17:18:03 -05:00
msiglreith 6c4194848f improve code formatting 2023-03-09 18:45:56 +01:00
msiglreith 5aaf288d1c vello_svg: Use affine transformation instead of transforming the path data
Correctly apply the transformation for other parameters as well (e.g stroke width)
2023-03-08 19:22:16 +01:00
Chad Brokaw 2f268d4e0f
Merge pull request #284 from linebender/glyph-run
Glyph run API
2023-03-06 18:39:16 -05:00
Chad Brokaw 86b1a66af0 Address review feedback
* reorganize GlyphCache::get_or_insert() to use the HashMap entry API
* change DrawGlyphs::hint() parameter name from `yes` to `hint` for clarity
* change Layout::path_data() to return bytes instead of [f32; 2]. Path segments could be encoded as i16, making this incorrect
2023-03-06 18:29:43 -05:00
Chad Brokaw 69dd838d09 post rebase fixups 2023-03-06 11:41:12 -05:00
Chad Brokaw 5e06a4f1c1 update peniko dependency for Sync + Send on Blob 2023-03-06 11:12:23 -05:00
Chad Brokaw 5e216adfa8 Merge branch 'main' into glyph-run 2023-03-06 08:17:45 -05:00
Daniel McNab 5156447346
Make the with_winit example run on android (#273) 2023-03-05 11:33:30 +00:00
Chad Brokaw 15efb8b3f6 fixes after rebase
* remove SceneBuilder::finish() calls
* remove old Config struct
* comment about syncing structs in config.wgsl
2023-03-03 20:46:50 -05:00
Chad Brokaw fca106a5ce Merge branch 'main' into glyph-run 2023-03-03 20:30:10 -05:00
Arman Uguray 5d915113e8
Merge pull request #287 from armansito/pr-clear-color
Add a base-color uniform to the (full) fine rasterization stage
2023-03-03 14:37:27 -08:00
Arman Uguray 12d5dcd34f Use clap to parse base-color option; remove unused width/height parameters 2023-03-03 14:28:07 -08:00
Arman Uguray acfd570440 Handle error that can be returned by render_to_texture 2023-03-03 11:32:39 -08:00
Arman Uguray d72ad14059 Add a test scene that animates the base color
The test scenes can now supply their own optional base (background)
color. In the with_winit example, we also allow the user to provide a
base color as a CLI option. The precedence is as follows:

   1. Use the color from the CLI options, if any.
   2. Otherwise use the scene provided base color, if any.
   3. Otherwise default to black.
2023-03-03 11:30:12 -08:00
Arman Uguray 3bbf108df5 Renamed clear_color to base_color; addressed review comments 2023-03-02 14:29:44 -08:00
Arman Uguray 05fa8c7c39 RenderParams struct for render-time options
The texture and surface render API now takes render-time parameters
(such as clear color, target width/height) as a RenderParams struct.

The examples have been updated to demonstrate this. The with_winit
example now accepts a clear color as a command line option.
2023-03-02 11:25:19 -08:00
Arman Uguray 8eabc12a72 Add a clear_color uniform
Introduced an RGBA8 config parameter to apply as a base blend color in
the fine stage of the full pipeline.
2023-03-02 09:26:31 -08:00
Chad Brokaw 82391534c0 small fixes
* make SimpleText::add_run accept glyph_transform and style parameters so it doesn't unconditionally do oblique strokes
* replace fill/stroke methods on DrawGlyphs with a single draw method that accepts either fill or stroke styles
* update peniko rev to access the new style types used above
* for now, change glyph cache to only cache non-zero fills. Prior to this, style was ignored in the key which could lead to incorrect rendering.
2023-02-24 16:13:48 -05:00
Chad Brokaw 39e35ceba9 fix copypasta comment 2023-02-23 23:29:34 -05:00
Chad Brokaw 2ef58adad5 Glyph run API 2023-02-23 22:59:03 -05:00
Arman Uguray 61ae3cde03
Merge pull request #283 from linebender/brush-fix
Fix brush transforms
2023-02-22 22:28:00 -08:00
Chad Brokaw f657b88018 use matrix math! 2023-02-23 01:19:04 -05:00
Chad Brokaw 659ab2ff7e simplify 2023-02-22 23:25:45 -05:00
Chad Brokaw 1f938e5f49 linear algebra refresher 2023-02-22 23:18:51 -05:00
Chad Brokaw 3c15bff867 Proper inverse of translation components 2023-02-22 23:08:38 -05:00
Chad Brokaw c65c19dc4f add additional test scene 2023-02-22 22:32:04 -05:00
Chad Brokaw 6612b7a8ef
From typo in comment 2023-02-22 21:47:35 -05:00
Chad Brokaw 033870d91e Fix brush transforms
This fixes an incorrect application of the inverse transform for radial gradients in fine.

Also fixes an edge case in `SceneBuilder` where a brush transform is identical to the path transform leading to a corrupt encoding.
2023-02-22 20:10:00 -05:00
Arman Uguray 0bb519c1ba
Merge pull request #282 from DJMcNab/rotate_key
Add a keyboard key to rotate the scene
2023-02-22 15:40:52 -08:00
Daniel McNab db243aed4e Add a keyboard key to rotate the scene 2023-02-22 12:35:28 +00:00
Jason Davies 5f59a2e818
Fix include_str! compile error in examples/scenes. (#279)
I don't think CARGO_MANIFEST_DIR should ever end in "/", though I've
only checked on Linux and macOS.
2023-02-11 09:44:18 +00:00
Arman Uguray 68022d2f4f
Merge pull request #277 from DJMcNab/headless
Create a headless example
2023-02-09 08:05:26 -08:00
Daniel McNab 56939df615 Re-use render context in headless 2023-02-09 09:34:53 +00:00
Daniel McNab 19552ad819 Update to better match other examples 2023-02-08 22:48:34 +00:00
Daniel McNab 3a63f00e7e Fix handling of wgpu to hopefully be valid 2023-02-08 21:43:24 +00:00
Arman Uguray fb4cfcdc9e
Merge pull request #275 from DJMcNab/bevy_stageless
Migrate the bevy example to stageless
2023-02-07 13:35:03 -08:00
Daniel McNab d366151970 Support changing the output directory 2023-02-07 16:37:29 +00:00
Daniel McNab 6e1481db40 Finish the headless example 2023-02-07 16:26:56 +00:00