Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the demo compile with NDK #487

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion c/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ font-kit = "0.6"
foreign-types = "0.3"
gl = "0.14"
libc = "0.2"
usvg = "0.9"
usvg = "0.20.0"

[dependencies.pathfinder_canvas]
features = ["pf-text"]
Expand Down
3 changes: 3 additions & 0 deletions demo/android/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ path = "../../../gl"

[dependencies.pathfinder_gpu]
path = "../../../gpu"

[dependencies.pathfinder_resources]
path = "../../../resources"
8 changes: 4 additions & 4 deletions demo/android/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ extern crate lazy_static;

use jni::objects::{GlobalRef, JByteBuffer, JClass, JObject, JString, JValue};
use jni::{JNIEnv, JavaVM};
use pathfinder_demo::window::{Event, SVGPath, View, Window, WindowSize};
use pathfinder_demo::window::{Event, DataPath, View, Window, WindowSize};
use pathfinder_demo::DemoApp;
use pathfinder_demo::Options;
use pathfinder_geometry::vector::{Vector2I, vec2i};
use pathfinder_geometry::rect::RectI;
use pathfinder_gl::GLVersion;
use pathfinder_gl::{GLVersion, GLDevice};
use pathfinder_resources::ResourceLoader;
use std::cell::RefCell;
use std::io::Error as IOError;
Expand Down Expand Up @@ -175,7 +175,7 @@ pub unsafe extern "system" fn Java_graphics_pathfinder_pathfinderdemo_Pathfinder
EVENT_QUEUE
.lock()
.unwrap()
.push(Event::OpenSVG(SVGPath::Resource(string)))
.push(Event::OpenData(DataPath::Resource(string)))
}

struct WindowImpl {
Expand All @@ -202,7 +202,7 @@ impl Window for WindowImpl {

fn make_current(&mut self, _view: View) {}

fn present(&mut self) {}
fn present(&mut self, device: &mut GLDevice) {}

fn resource_loader(&self) -> &dyn ResourceLoader {
&RESOURCE_LOADER
Expand Down
2 changes: 1 addition & 1 deletion demo/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pf-gl = []
clap = "2.32"
gl = "0.14"
rayon = "1.0"
usvg = "0.9"
usvg = "0.20.0"

[dependencies.image]
version = "0.23"
Expand Down
2 changes: 1 addition & 1 deletion demo/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ fn load_scene(resource_loader: &dyn ResourceLoader,
DataPath::Path(ref path) => std::fs::read(path).unwrap().into()
};

if let Ok(tree) = SvgTree::from_data(&data, &UsvgOptions::default()) {
if let Ok(tree) = SvgTree::from_data(&data, &UsvgOptions::default().to_ref()) {
Content::Svg(tree)
} else if let Ok(file) = PdfFile::from_data(data) {
Content::Pdf { file, cache: PdfRenderCache::new(), page_nr: 0 }
Expand Down
2 changes: 1 addition & 1 deletion demo/magicleap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ authors = ["Alan Jeffrey <[email protected]>"]
[dependencies]
gl = "0.14"
rayon = "1.0"
usvg = "0.9"
usvg = "0.20.0"
egl = "0.2"
log = "0.4"
smallvec = "1.2"
Expand Down
2 changes: 1 addition & 1 deletion svg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ keywords = ["pathfinder", "svg", "vector", "graphics", "gpu"]
[dependencies]
bitflags = "1.0"
hashbrown = "0.7"
usvg = "0.9"
usvg = "0.20.0"

[dependencies.pathfinder_color]
path = "../color"
Expand Down
2 changes: 1 addition & 1 deletion svg/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ impl SVGScene {
state.transform = state.transform * node_transform;
match *node.borrow() {
NodeKind::Group(ref group) => {
if group.filter.is_some() {
if !group.filter.is_empty() {
self.result_flags.insert(BuildResultFlags::UNSUPPORTED_FILTER_ATTR);
}
if group.mask.is_some() {
Expand Down
2 changes: 1 addition & 1 deletion utils/convert/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ edition = "2018"
[dependencies]
pathfinder_export = { path = "../../export" }
pathfinder_svg = { path = "../../svg" }
usvg = "0.9"
usvg = "0.20.0"
2 changes: 1 addition & 1 deletion utils/svg-to-skia/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ authors = ["Patrick Walton <[email protected]>"]
edition = "2018"

[dependencies]
usvg = "0.9"
usvg = "0.20.0"