Commit graph

13 commits

Author SHA1 Message Date
Chad Brokaw f19dbdb1b5 Update piet-scene to depend on peniko
This adds a new dependency on peniko, reintroduces kurbo for geometry (!), removes the now defunct types from piet-scene and updates all the test scenes to use the new types.
2022-11-22 14:49:51 -05:00
Chad Brokaw 6b1c315163 update c-api deps 2022-10-19 15:54:43 -04:00
Chad Brokaw 6c5a2cb4f4 macOS fixes
* Fix call to removed encoded_scene method in pgpu-render
* Add new ImageFormat::Surface variant to select a pixel format that matches the platform specific surface format. This makes gradients consistent across platforms.
2022-10-19 15:20:04 -04:00
Chad Brokaw d07fda8ef8 Make transforms stateless
Removes the transform state mutator from SceneBuilder and adds transform parameters to push_layer, fill and stroke methods.
2022-10-19 15:20:04 -04:00
Chad Brokaw c0fcdbad58 make gradient ramps late bound
Removes ResourceContext type. This makes scenes and fragments nearly identical. Should they be merged?
2022-10-19 15:20:04 -04:00
Chad Brokaw 782e7d51d2 Remove piet API & replace w/ fragments
Removes the dependency on the piet crate and replaces all uses with the scene crate.  Also does some cleanup of the scene API, renaming some types and moving them all to the crate root for better ergonomics.
2022-10-19 15:19:20 -04:00
Chad Brokaw 5a127e09a5 Expose path rendering in C API
* capi: Add PathIter type and support for encoding fills
* capi: Minimal support for brushes (solid color only)
* Add flush method to command buffers
* Better initial heuristic for memory buffer size based on target dimensions
2022-08-08 01:03:27 -04:00
Chad Brokaw 8943fa7ea6 encode absolute transforms
This removes the GPU transform stage, changes shaders to reference transforms directly from the scene, and modifies the render context to maintain a transform stack.
2022-07-15 14:36:20 -04:00
Daniel McNab 28cbc8f199 Make pgpu-render compile on non apple platforms
Also add `resolver="2"` to the entire workspace, in case we gain a wgpu
dependency
2022-06-25 14:11:13 +01:00
Raph Levien 307bf8d227 More blend mode fixes
Adds a test to visualize the blend modes. Fixes a dumb bug in blend.h and also a more subtle issue where default blending is not the same as clipping, as the former needs to always push a blend group (to cause isolation) and the latter does not. This might be something we need to get back to.

This should fix the rendering, so it fairly closely resembles the Mozilla reference image. There's also a compile-time switch to disable sRGB conversion, which is (sadly) needed for compatible rendering.
2022-05-17 16:12:05 -07:00
Chad Brokaw 6f9e53459a Address review feedback
* Change pgpu-render header file generator to add a comment noting that the file is auto-generated
* Remove bin target and associated dependencies from piet-scene crate
* Remove FP constructors from the Color type
* Better codegen and rounding in Color::to_premul_u32()
* Add kurbo attribution for piet_scene::geometry module
2022-05-10 20:07:41 -04:00
Chad Brokaw 3ff87c88a7 Make return value mutable
Changes the return mutability for pgpu_glyph_provider_get()
2022-05-10 03:59:31 -04:00
Chad Brokaw 532b6ee808 Add C api for glyph rendering
First cut at a public C api that supports glyph rendering on Metal targets.
2022-05-10 03:56:06 -04:00