Skip to content

Commit f6a2a16

Browse files
committed
Make fill_window a no-op on mobile platforms for now
1 parent 03d544a commit f6a2a16

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ smol_str = "0.2.0"
6363
[dev-dependencies]
6464
image = { version = "0.24.0", default-features = false, features = ["png"] }
6565
simple_logger = { version = "2.1.0", default_features = false }
66+
67+
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dev-dependencies]
6668
softbuffer = "0.2.0"
6769

6870
[target.'cfg(target_os = "android")'.dependencies]

examples/util/fill.rs

+12-4
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@
77
//! The `softbuffer` crate is used, largely because of its ease of use. `glutin` or `wgpu` could
88
//! also be used to fill the window buffer, but they are more complicated to use.
99
10-
use softbuffer::GraphicsContext;
11-
use std::cell::RefCell;
12-
use std::collections::HashMap;
13-
use winit::window::{Window, WindowId};
10+
use winit::window::Window;
1411

12+
#[cfg(not(any(target_os = "android", target_os = "ios")))]
1513
pub(super) fn fill_window(window: &Window) {
14+
use softbuffer::GraphicsContext;
15+
use std::cell::RefCell;
16+
use std::collections::HashMap;
17+
use winit::window::WindowId;
18+
1619
thread_local! {
1720
/// A static, thread-local map of graphics contexts to open windows.
1821
static GC: RefCell<HashMap<WindowId, GraphicsContext>> = RefCell::new(HashMap::new());
@@ -35,3 +38,8 @@ pub(super) fn fill_window(window: &Window) {
3538
context.set_buffer(&buffer, size.width as u16, size.height as u16);
3639
})
3740
}
41+
42+
#[cfg(any(target_os = "android", target_os = "ios"))]
43+
pub(super) fn fill_window(_window: &Window) {
44+
// No-op on mobile platforms.
45+
}

0 commit comments

Comments
 (0)