Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 28 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
[workspace]
resolver = "2"
members = [
"renderer",
"vello",
"vger",
"tiny_skia",
"reactive",
"editor-core",
"examples/*",
Expand Down Expand Up @@ -101,10 +97,20 @@ ui-events.workspace = true
ui-events-winit.workspace = true
dpi.workspace = true
wgpu.workspace = true

anyrender = "0.6.1"
anyrender_vello = {version = "0.6.1", optional = true }
anyrender_vello_cpu = {version = "0.8.1", optional = true, features = ["pixels_window_renderer"] }
anyrender_skia = {version = "0.2.0", optional = true }


fluent-bundle = { version = "0.16", optional = true }
unic-langid = { version = "0.9", optional = true }
sys-locale = {version = "0.3.2", optional = true }

cosmic-text = { version = "0.14.2", features = ["shape-run-cache"] }


[target.'cfg(any(target_os = "windows", target_os = "macos"))'.dependencies]
muda = { workspace = true }

Expand All @@ -129,9 +135,7 @@ objc2-app-kit = { version = "0.3", features = [
] }

[features]
default = ["editor", "default-image-formats", "vger"]
vello = ["dep:floem_vello_renderer"]
vger = ["dep:floem_vger_renderer"]
default = ["editor", "default-image-formats", "vello-classic", "vello-cpu"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure we want editor feature to be include as a default? 🤔

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope. that should be removed

serde = [
"dep:serde",
"winit/serde",
Expand Down Expand Up @@ -168,10 +172,24 @@ tokio = ["dep:tokio"]
# rfd (file dialog) async runtime
rfd-async-std = ["dep:rfd", "rfd/async-std"]
rfd-tokio = ["dep:rfd", "rfd/tokio"]
crossbeam = ["dep:crossbeam", "floem_renderer/crossbeam"]
crossbeam = ["dep:crossbeam"]
localization = ["dep:fluent-bundle", "dep:unic-langid", "dep:sys-locale"]

[profile.dev]
opt-level = 1
# Renderers
vello-classic = ["dep:anyrender_vello"]
skia = ["dep:anyrender_skia"]
vello-cpu = ["dep:anyrender_vello_cpu"]


[patch.crates-io]
anyrender = { path = "../anyrender/crates/anyrender" }
# anyrender_skia = { path = "../anyrender/crates/anyrender_skia" }
anyrender_vello = { path = "../anyrender/crates/anyrender_vello" }
anyrender_vello_cpu = { path = "../anyrender/crates/anyrender_vello_cpu" }
vello = {path = "../vello/vello/"}
# anyrender_svg = { path = "../anyrender/crates/anyrender_svg" }
# wgpu_context = { path = "../anyrender/crates/wgpu_context" }




2 changes: 1 addition & 1 deletion examples/localization/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ license.workspace = true
version.workspace = true

[dependencies]
floem = { path = "../..", features = ["vello", "localization"] }
floem = { path = "../..", features = ["localization"] }
1 change: 0 additions & 1 deletion examples/todo-complex/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ edition = "2021"
confy = "1.0.0"
floem = { path = "../..", features = [
"serde",
"vello",
], default-features = false }
rusqlite = { version = "0.37.0", features = ["bundled"] }
serde = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion examples/view-transition/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ version = "0.1.0"
edition = "2021"

[dependencies]
floem = { path = "../..", features = ["vello"], default-features = false }
floem = { path = "../..", default-features = false }
6 changes: 1 addition & 5 deletions examples/widget-gallery/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@ version = "0.1.0"
edition = "2021"

[dependencies]
floem = { path = "../..", features = ["rfd-async-std", "vello"] }
floem = { path = "../..", features = ["rfd-async-std"] }
strum = { workspace = true }
files = { path = "../files/", optional = true }
stacks = { path = "../stacks/", optional = true }

[features]
default = ["full"]
vello = ["floem/vello"]
full = ["dep:files", "dep:stacks"]
2 changes: 1 addition & 1 deletion examples/widget-gallery/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ fn app_view(window_id: WindowId) -> impl IntoView {
.scroll()
.style(|s| s.size_full())
},
Some(
Some(
WindowConfig::default()
.size(Size::new(700.0, 400.0))
.title(name.unwrap_or_default()),
Expand Down
25 changes: 0 additions & 25 deletions renderer/Cargo.toml

This file was deleted.

85 changes: 0 additions & 85 deletions renderer/src/lib.rs

This file was deleted.

69 changes: 0 additions & 69 deletions renderer/src/swash.rs

This file was deleted.

9 changes: 0 additions & 9 deletions renderer/src/text/mod.rs

This file was deleted.

19 changes: 4 additions & 15 deletions src/app_handle.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use dpi::PhysicalPosition;
use floem_renderer::gpu_resources::GpuResources;
#[cfg(not(target_arch = "wasm32"))]
use std::time::Instant;
use ui_events_winit::WindowEventTranslation;
Expand All @@ -12,28 +11,18 @@ use wgpu::web_sys;
use floem_reactive::SignalUpdate;
use peniko::kurbo::{Point, Size};
use std::{collections::HashMap, rc::Rc};
use wgpu::{Device, Instance, Queue};
use winit::{
dpi::{LogicalPosition, LogicalSize},
event::WindowEvent,
event_loop::{ActiveEventLoop, ControlFlow},
window::{Theme, WindowId},
};

use crate::app::AppConfig;
use crate::{
AppEvent,
action::{Timer, TimerToken},
app::{APP_UPDATE_EVENTS, AppEventCallback, AppUpdateEvent, UserEvent},
context::PaintState,
dropped_file::FileDragEvent::{self, DragDropped},
ext_event::EXT_EVENT_HANDLER,
inspector::Capture,
profiler::{Profile, ProfileEvent},
view::View,
window::WindowConfig,
window_handle::WindowHandle,
window_id::process_window_updates,
action::{Timer, TimerToken}, app::{AppEventCallback, AppUpdateEvent, UserEvent, APP_UPDATE_EVENTS}, context::PaintState, dropped_file::FileDragEvent::{self, DragDropped}, ext_event::EXT_EVENT_HANDLER, inspector::Capture, profiler::{Profile, ProfileEvent}, renderer::AnyWindowRenderer, view::View, window::WindowConfig, window_handle::WindowHandle, window_id::process_window_updates, AppEvent
};
use crate::{app::AppConfig, gpu_resources::GpuResources};

pub(crate) struct ApplicationHandle {
window_handles: HashMap<winit::window::WindowId, WindowHandle>,
Expand Down Expand Up @@ -84,7 +73,7 @@ impl ApplicationHandle {
} = &handle.paint_state
{
let (gpu_resources, surface) = rx.recv().unwrap().unwrap();
let renderer = crate::renderer::Renderer::new(
let renderer = AnyWindowRenderer::VelloWindowRenderer::new(
window.clone(),
gpu_resources.clone(),
surface,
Expand Down
Loading
Loading