diff --git a/android-example/app/src/main/assets/blit.fs.glsl b/android-example/app/src/main/assets/blit.fs.glsl index 6ba3068a..060348f4 120000 --- a/android-example/app/src/main/assets/blit.fs.glsl +++ b/android-example/app/src/main/assets/blit.fs.glsl @@ -1 +1 @@ -../../../../../surfman/resources/examples/blit.fs.glsl \ No newline at end of file +../../../../../resources/examples/blit.fs.glsl \ No newline at end of file diff --git a/android-example/app/src/main/assets/check.fs.glsl b/android-example/app/src/main/assets/check.fs.glsl index 909f96ad..612b8a2f 120000 --- a/android-example/app/src/main/assets/check.fs.glsl +++ b/android-example/app/src/main/assets/check.fs.glsl @@ -1 +1 @@ -../../../../../surfman/resources/examples/check.fs.glsl \ No newline at end of file +../../../../../resources/examples/check.fs.glsl \ No newline at end of file diff --git a/android-example/app/src/main/assets/grid.fs.glsl b/android-example/app/src/main/assets/grid.fs.glsl index b5845582..b0e6446e 120000 --- a/android-example/app/src/main/assets/grid.fs.glsl +++ b/android-example/app/src/main/assets/grid.fs.glsl @@ -1 +1 @@ -../../../../../surfman/resources/examples/grid.fs.glsl \ No newline at end of file +../../../../../resources/examples/grid.fs.glsl \ No newline at end of file diff --git a/android-example/app/src/main/assets/quad.vs.glsl b/android-example/app/src/main/assets/quad.vs.glsl index 69435d4c..e6764b82 120000 --- a/android-example/app/src/main/assets/quad.vs.glsl +++ b/android-example/app/src/main/assets/quad.vs.glsl @@ -1 +1 @@ -../../../../../surfman/resources/examples/quad.vs.glsl \ No newline at end of file +../../../../../resources/examples/quad.vs.glsl \ No newline at end of file diff --git a/android-example/app/src/main/assets/tri.fs.glsl b/android-example/app/src/main/assets/tri.fs.glsl index 78431e12..a4efd463 120000 --- a/android-example/app/src/main/assets/tri.fs.glsl +++ b/android-example/app/src/main/assets/tri.fs.glsl @@ -1 +1 @@ -../../../../../surfman/resources/examples/tri.fs.glsl \ No newline at end of file +../../../../../resources/examples/tri.fs.glsl \ No newline at end of file diff --git a/android-example/app/src/main/assets/tri.vs.glsl b/android-example/app/src/main/assets/tri.vs.glsl index d2bed96f..a1bd5eb6 120000 --- a/android-example/app/src/main/assets/tri.vs.glsl +++ b/android-example/app/src/main/assets/tri.vs.glsl @@ -1 +1 @@ -../../../../../surfman/resources/examples/tri.vs.glsl \ No newline at end of file +../../../../../resources/examples/tri.vs.glsl \ No newline at end of file diff --git a/android-example/app/src/main/jniLibs/arm64-v8a/libsurfman_android_threads.so b/android-example/app/src/main/jniLibs/arm64-v8a/libsurfman_android_threads.so deleted file mode 120000 index e4259481..00000000 --- a/android-example/app/src/main/jniLibs/arm64-v8a/libsurfman_android_threads.so +++ /dev/null @@ -1 +0,0 @@ -../../../../../../target/aarch64-linux-android/debug/libsurfman_android_threads.so \ No newline at end of file diff --git a/android-example/rust/Cargo.toml b/android-example/rust/Cargo.toml index 61e5dbe2..54762231 100644 --- a/android-example/rust/Cargo.toml +++ b/android-example/rust/Cargo.toml @@ -2,11 +2,11 @@ name = "surfman_android_threads" version = "0.1.0" authors = ["Patrick Walton "] -edition = "2018" +edition = "2021" [lib] name = "main" -crate_type = ["cdylib"] +crate-type = ["cdylib"] [profile.dev] panic = "abort" @@ -21,7 +21,8 @@ gl = "0.14" jni = "0.21" log = "0.4" surfman = { version = "0.9.4", features = [ "sm-test" ] } -winit = { version = "0.29.10", features = [ "android-native-activity", "rwh_05" ] } +winit = { version = "0.29.10", features = [ "android-native-activity", "rwh_06" ] } +rwh_06 = { package = "raw-window-handle", version = "0.6" } [patch.crates-io] surfman = { path = "../../" } diff --git a/android-example/rust/src/lib.rs b/android-example/rust/src/lib.rs index c791a360..1517b22a 100644 --- a/android-example/rust/src/lib.rs +++ b/android-example/rust/src/lib.rs @@ -14,10 +14,10 @@ use log::Level; use std::cell::{Cell, RefCell}; use std::mem; use std::thread::{self, JoinHandle}; -use surfman::platform::android::tests; +use surfman::platform::egl::tests; use surfman::{Connection, NativeContext, NativeDevice}; -#[path = "../../../surfman/examples/threads.rs"] +#[path = "../../../examples/threads.rs"] mod threads; thread_local! { diff --git a/examples/chaos_game.rs b/examples/chaos_game.rs index cae27a57..f7abd25b 100644 --- a/examples/chaos_game.rs +++ b/examples/chaos_game.rs @@ -6,7 +6,8 @@ use euclid::default::Point2D; use rand::{self, Rng}; use surfman::{SurfaceAccess, SurfaceType}; use winit::dpi::PhysicalSize; -use winit::event::{DeviceEvent, Event, KeyboardInput, VirtualKeyCode, WindowEvent}; +use winit::event::WindowEvent::KeyboardInput; +use winit::event::{DeviceEvent, Event, WindowEvent}; use winit::event_loop::{ControlFlow, EventLoop}; use winit::window::WindowBuilder; diff --git a/src/tests.rs b/src/tests.rs index db725372..7d34c294 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -18,6 +18,7 @@ use crate::{ContextAttributeFlags, ContextAttributes, Error, GLApi, GLVersion, G use crate::{SurfaceType, WindowingApiError}; use euclid::default::Size2D; +#[cfg(not(feature = "sm-test"))] use serial_test::serial; use std::os::raw::c_void; use std::sync::mpsc; @@ -40,7 +41,7 @@ static GL_ES_VERSIONS: [GLVersion; 4] = [ ]; #[cfg_attr(not(feature = "sm-test"), test)] -#[serial] +#[cfg_attr(not(feature = "sm-test"), serial)] pub fn test_adapter_creation() { let connection = Connection::new().unwrap(); connection.create_hardware_adapter().unwrap(); @@ -49,7 +50,7 @@ pub fn test_adapter_creation() { } #[cfg_attr(not(feature = "sm-test"), test)] -#[serial] +#[cfg_attr(not(feature = "sm-test"), serial)] pub fn test_device_creation() { let connection = Connection::new().unwrap(); let adapter = connection @@ -65,7 +66,7 @@ pub fn test_device_creation() { } #[cfg_attr(not(feature = "sm-test"), test)] -#[serial] +#[cfg_attr(not(feature = "sm-test"), serial)] pub fn test_device_accessors() { let connection = Connection::new().unwrap(); let adapter = connection.create_low_power_adapter().unwrap(); @@ -84,7 +85,7 @@ pub fn test_device_accessors() { // Tests that all combinations of flags result in the creation of valid context descriptors and // contexts. #[cfg_attr(not(feature = "sm-test"), test)] -#[serial] +#[cfg_attr(not(feature = "sm-test"), serial)] pub fn test_context_creation() { let connection = Connection::new().unwrap(); let adapter = connection @@ -164,7 +165,7 @@ pub fn test_context_creation() { // Tests that newly-created contexts are not immediately made current (issue #7). #[cfg_attr(not(feature = "sm-test"), test)] -#[serial] +#[cfg_attr(not(feature = "sm-test"), serial)] pub fn test_newly_created_contexts_are_not_current() { let connection = Connection::new().unwrap(); let adapter = connection @@ -233,7 +234,7 @@ pub fn test_newly_created_contexts_are_not_current() { // Tests a simple case of one context being shared with another. #[cfg_attr(not(feature = "sm-test"), test)] -#[serial] +#[cfg_attr(not(feature = "sm-test"), serial)] pub fn test_context_sharing() { let connection = Connection::new().unwrap(); let adapter = connection @@ -274,7 +275,7 @@ pub fn test_context_sharing() { // Tests that generic surfaces can be created. #[cfg_attr(not(feature = "sm-test"), test)] -#[serial] +#[cfg_attr(not(feature = "sm-test"), serial)] pub fn test_generic_surface_creation() { let connection = Connection::new().unwrap(); let adapter = connection @@ -343,7 +344,7 @@ pub fn test_generic_surface_creation() { // Tests that basic GL commands work. #[cfg_attr(not(feature = "sm-test"), test)] -#[serial] +#[cfg_attr(not(feature = "sm-test"), serial)] pub fn test_gl() { let mut env = match BasicEnvironment::new() { None => return, @@ -437,7 +438,7 @@ pub fn test_gl() { } #[cfg_attr(not(feature = "sm-test"), test)] -#[serial] +#[cfg_attr(not(feature = "sm-test"), serial)] pub fn test_surface_texture_blit_framebuffer() { let mut env = match BasicEnvironment::new() { None => return, @@ -504,7 +505,7 @@ pub fn test_surface_texture_blit_framebuffer() { } #[cfg_attr(not(feature = "sm-test"), test)] -#[serial] +#[cfg_attr(not(feature = "sm-test"), serial)] pub fn test_cross_device_surface_texture_blit_framebuffer() { let mut env = match BasicEnvironment::new() { None => return, @@ -575,7 +576,7 @@ pub fn test_cross_device_surface_texture_blit_framebuffer() { } #[cfg_attr(not(feature = "sm-test"), test)] -#[serial] +#[cfg_attr(not(feature = "sm-test"), serial)] pub fn test_cross_thread_surface_texture_blit_framebuffer() { let mut env = match BasicEnvironment::new() { None => return, @@ -661,7 +662,7 @@ pub fn test_cross_thread_surface_texture_blit_framebuffer() { // Tests that surface textures are not upside-down. #[cfg_attr(not(feature = "sm-test"), test)] -#[serial] +#[cfg_attr(not(feature = "sm-test"), serial)] pub fn test_surface_texture_right_side_up() { let mut env = match BasicEnvironment::new() { None => return, @@ -734,7 +735,7 @@ pub fn test_surface_texture_right_side_up() { #[cfg(not(any(target_os = "android", target_env = "ohos")))] #[cfg_attr(not(feature = "sm-test"), test)] -#[serial] +#[cfg_attr(not(feature = "sm-test"), serial)] pub fn test_depth_and_stencil() { let connection = Connection::new().unwrap(); let adapter = connection @@ -856,7 +857,7 @@ pub fn test_depth_and_stencil() { // Make sure that the current native context can be fetched and that they can be correctly wrapped // in `surfman` contexts. #[cfg_attr(not(feature = "sm-test"), test)] -#[serial] +#[cfg_attr(not(feature = "sm-test"), serial)] pub fn test_get_native_context() { let mut env = match BasicEnvironment::new() { None => return,