Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Commit

Permalink
Bump kurbo version (#177)
Browse files Browse the repository at this point in the history
* Bump kurbo version

This also requires bumping vello/wgpu dev-deps and fixing all the examples.

* fmt
  • Loading branch information
dfrg authored Jan 25, 2024
1 parent b79dd1b commit ec7e0c5
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 19 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ accesskit = [

[dependencies]
# Moving forward, this version should align with the kurbo version in peniko.
kurbo = "0.9.0"
kurbo = "0.10.4"

tracing = { version = "0.1.22", features = ["log"] }
lazy_static = "1.4.0"
Expand Down Expand Up @@ -148,10 +148,10 @@ static_assertions = "1.1.0"
test-log = { version = "0.2.5", features = ["trace"], default-features = false }
tracing-subscriber = { version = "0.3.2", features = ["env-filter"] }
unicode-segmentation = "1.7.0"
vello = { git = "https://github.com/linebender/vello", rev = "9d7c4f00d8db420337706771a37937e9025e089c" }
vello = { git = "https://github.com/linebender/vello", rev = "1c06c308b2ed1ebb858ed585cc284756325f9bb3" }
parley = { git = "https://github.com/dfrg/parley", rev = "2371bf4b702ec91edee2d58ffb2d432539580e1e" }
pollster = "0.3.0"
wgpu = "0.17.0"
wgpu = "0.18.0"

[target.'cfg(any(target_os = "freebsd", target_os="linux", target_os="openbsd"))'.build-dependencies]
bindgen = { version = "0.66", optional = true }
Expand Down
2 changes: 2 additions & 0 deletions examples/accesskit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ impl WinHandler for HelloState {

fn paint(&mut self, _: &Region) {}

#[cfg(feature = "accesskit")]
fn accesskit_tree(&mut self) -> TreeUpdate {
let root = {
let mut builder = NodeBuilder::new(Role::Window);
Expand Down Expand Up @@ -179,6 +180,7 @@ impl WinHandler for HelloState {
self.size = size;
}

#[cfg(feature = "accesskit")]
fn accesskit_action(&mut self, request: ActionRequest) {
if let ActionRequest {
action,
Expand Down
4 changes: 2 additions & 2 deletions examples/common/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use parley::Layout;
use vello::kurbo::Affine;
use vello::{
glyph::{fello::raw::FontRef, GlyphContext},
glyph::{skrifa::raw::FontRef, GlyphContext},
peniko::{Brush, Color},
*,
};
Expand Down Expand Up @@ -37,7 +37,7 @@ pub fn render_text(builder: &mut SceneBuilder, transform: Affine, layout: &Layou
if let Ok(font_ref) = FontRef::from_index(font_ref.data, font.index()) {
let style = glyph_run.style();
let vars: [(&str, f32); 0] = [];
let mut gp = gcx.new_provider(&font_ref, None, font_size, false, vars);
let mut gp = gcx.new_provider(&font_ref, font_size, false, &vars);
for glyph in glyph_run.glyphs() {
if let Some(fragment) = gp.get(glyph.id, Some(&style.brush.0)) {
let gx = x + glyph.x;
Expand Down
12 changes: 9 additions & 3 deletions examples/edit_text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ use parley::FontContext;
use tracing_subscriber::EnvFilter;
use unicode_segmentation::GraphemeCursor;
use vello::util::{RenderContext, RenderSurface};
use vello::Renderer;
use vello::{
kurbo::{Affine, Point, Rect},
peniko::{Brush, Color, Fill},
RenderParams, RendererOptions, Scene, SceneBuilder,
};
use vello::{AaSupport, Renderer};

use glazier::kurbo::Size;
use glazier::{
Expand Down Expand Up @@ -205,15 +205,21 @@ impl WindowState {
let queue = &self.render.devices[dev_id].queue;
let renderer_options = RendererOptions {
surface_format: Some(surface.format),
timestamp_period: queue.get_timestamp_period(),
use_cpu: false,
antialiasing_support: AaSupport {
area: true,
msaa8: false,
msaa16: false,
},
};
let render_params = RenderParams {
base_color: Color::BLACK,
width,
height,
antialiasing_method: vello::AaConfig::Area,
};
self.renderer
.get_or_insert_with(|| Renderer::new(device, &renderer_options).unwrap())
.get_or_insert_with(|| Renderer::new(device, renderer_options).unwrap())
.render_to_surface(device, queue, &self.scene, &surface_texture, &render_params)
.unwrap();
surface_texture.present();
Expand Down
16 changes: 11 additions & 5 deletions examples/pen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ use std::f64::consts::PI;
use accesskit::TreeUpdate;
use kurbo::Ellipse;
use vello::util::{RenderContext, RenderSurface};
use vello::Renderer;
use vello::{
kurbo::{Affine, BezPath, Point, Rect},
peniko::{Brush, Color, Fill, Stroke},
kurbo::{Affine, BezPath, Point, Rect, Stroke},
peniko::{Brush, Color, Fill},
RenderParams, RendererOptions, Scene, SceneBuilder,
};
use vello::{AaSupport, Renderer};

use glazier::kurbo::Size;
use glazier::{
Expand Down Expand Up @@ -112,15 +112,21 @@ impl WindowState {
let queue = &self.render.devices[dev_id].queue;
let renderer_options = RendererOptions {
surface_format: Some(surface.format),
timestamp_period: queue.get_timestamp_period(),
use_cpu: false,
antialiasing_support: AaSupport {
area: true,
msaa8: false,
msaa16: false,
},
};
let render_params = RenderParams {
base_color: Color::BLACK,
width,
height,
antialiasing_method: vello::AaConfig::Area,
};
self.renderer
.get_or_insert_with(|| Renderer::new(device, &renderer_options).unwrap())
.get_or_insert_with(|| Renderer::new(device, renderer_options).unwrap())
.render_to_surface(device, queue, &self.scene, &surface_texture, &render_params)
.unwrap();
surface_texture.present();
Expand Down
16 changes: 11 additions & 5 deletions examples/shello.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ use accesskit::TreeUpdate;
use parley::FontContext;
use tracing_subscriber::EnvFilter;
use vello::util::{RenderContext, RenderSurface};
use vello::Renderer;
use vello::{
kurbo::{Affine, PathEl, Point, Rect},
peniko::{Brush, Color, Fill, Mix, Stroke},
kurbo::{Affine, PathEl, Point, Rect, Stroke},
peniko::{Brush, Color, Fill, Mix},
RenderParams, RendererOptions, Scene, SceneBuilder,
};
use vello::{AaSupport, Renderer};

use glazier::kurbo::Size;
use glazier::{
Expand Down Expand Up @@ -100,15 +100,21 @@ impl WindowState {
let queue = &self.render.devices[dev_id].queue;
let renderer_options = RendererOptions {
surface_format: Some(surface.format),
timestamp_period: queue.get_timestamp_period(),
use_cpu: false,
antialiasing_support: AaSupport {
area: true,
msaa8: false,
msaa16: false,
},
};
let render_params = RenderParams {
base_color: Color::BLACK,
width,
height,
antialiasing_method: vello::AaConfig::Area,
};
self.renderer
.get_or_insert_with(|| Renderer::new(device, &renderer_options).unwrap())
.get_or_insert_with(|| Renderer::new(device, renderer_options).unwrap())
.render_to_surface(device, queue, &self.scene, &surface_texture, &render_params)
.unwrap();
surface_texture.present();
Expand Down
4 changes: 3 additions & 1 deletion examples/wgpu-triangle/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,11 @@ impl InnerWindowState {
resolve_target: None,
ops: wgpu::Operations {
load: wgpu::LoadOp::Clear(wgpu::Color::GREEN),
store: true,
store: wgpu::StoreOp::Store,
},
})],
timestamp_writes: None,
occlusion_query_set: None,
depth_stencil_attachment: None,
});
rpass.set_pipeline(&self.render_pipeline);
Expand Down

0 comments on commit ec7e0c5

Please sign in to comment.