Skip to content

Commit

Permalink
Auto merge of #249 - mukilan:bump-version-to-0.6.0, r=jdm
Browse files Browse the repository at this point in the history
Bump version to 0.6.0

Also updated examples to work with winit 0.28.1
  • Loading branch information
bors-servo authored Feb 23, 2023
2 parents 64df6b2 + c2607a0 commit 50644f0
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 25 deletions.
21 changes: 10 additions & 11 deletions surfman/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "surfman"
license = "MIT OR Apache-2.0"
edition = "2018"
version = "0.5.0"
version = "0.6.0"
authors = [
"Patrick Walton <pcwalton@mimiga.net>",
"Emilio Cobos Álvarez <emilio@crisal.io>",
Expand Down Expand Up @@ -33,7 +33,6 @@ bitflags = "1.1"
lazy_static = "1"
libc = "0.2"
log = "0.4"
parking_lot = "0.10.2"

[dependencies.euclid]
version = "0.22"
Expand All @@ -54,22 +53,22 @@ optional = true
[dev-dependencies]
clap = "2"
gl = "0.14"
png = "0.15"
rand = "0.7"
png = "0.17"
rand = "0.8"

[target.'cfg(target_os = "macos")'.dependencies]
cgl = "0.3.2"
cocoa = "0.19"
core-foundation = "0.6"
core-graphics = "0.17"
cocoa = "0.24"
core-foundation = "0.9"
core-graphics = "0.22"
servo-display-link = "0.2"
io-surface = "0.12"
io-surface = "0.15"
mach = "0.3"
metal = "0.18"
metal = "0.24"
objc = "0.2"

[target.'cfg(all(unix, not(any(target_os = "macos", target_os = "android"))))'.dependencies.wayland-sys]
version = "0.24"
version = "0.30"
features = ["client", "dlopen", "egl"]

[target.'cfg(all(unix, not(any(target_os = "macos", target_os = "android"))))'.dependencies.x11]
Expand All @@ -85,7 +84,7 @@ optional = true

[target.'cfg(target_os = "windows")'.dependencies]
wio = "0.2"
winapi = { version = "0.3", features = ["d3d11", "wingdi", "winuser", "libloaderapi"] }
winapi = { version = "0.3", features = ["d3d11", "wingdi", "winuser", "winerror", "libloaderapi"] }

[target.'cfg(target_os = "android")'.dependencies]
raw-window-handle = "0.5"
Expand Down
11 changes: 4 additions & 7 deletions surfman/examples/chaos_game.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use euclid::default::Point2D;
use rand::{self, Rng};
use surfman::{SurfaceAccess, SurfaceType};
use winit::dpi::{LogicalSize, PhysicalSize};
use winit::dpi::PhysicalSize;
use winit::event::{DeviceEvent, Event, WindowEvent, KeyboardInput, VirtualKeyCode};
use winit::event_loop::{ControlFlow, EventLoop};
use winit::window::WindowBuilder;
Expand Down Expand Up @@ -40,13 +40,10 @@ fn main() {
let mut device = connection.create_device(&adapter).unwrap();

let event_loop = EventLoop::new();
let dpi = event_loop.primary_monitor().unwrap().scale_factor();
let logical_size =
PhysicalSize::new(WINDOW_WIDTH, WINDOW_HEIGHT)
.to_logical::<f64>(dpi);
let physical_size = PhysicalSize::new(WINDOW_WIDTH, WINDOW_HEIGHT);
let window = WindowBuilder::new()
.with_title("Chaos game example")
.with_inner_size(logical_size)
.with_inner_size(physical_size)
.build(&event_loop)
.unwrap();

Expand Down Expand Up @@ -81,7 +78,7 @@ fn main() {
} => *control_flow = ControlFlow::Exit,
_ => {
for _ in 0..ITERATIONS_PER_FRAME {
let (dest_x, dest_y) = TRIANGLE_POINTS[rng.gen_range(0, 3)];
let (dest_x, dest_y) = TRIANGLE_POINTS[rng.gen_range(0..3)];
point = point.lerp(Point2D::new(dest_x, dest_y), 0.5);
put_pixel(&mut data, &point, FOREGROUND_COLOR);
}
Expand Down
2 changes: 1 addition & 1 deletion surfman/examples/offscreen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ fn main() {
FRAMEBUFFER_WIDTH as u32,
FRAMEBUFFER_HEIGHT as u32,
);
encoder.set_color(ColorType::RGBA);
encoder.set_color(ColorType::Rgba);
encoder.set_depth(BitDepth::Eight);
let mut image_writer = encoder.write_header().unwrap();
image_writer.write_image_data(&pixels).unwrap();
Expand Down
9 changes: 3 additions & 6 deletions surfman/examples/threads.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use self::common::FilesystemResourceLoader;
use surfman::{ContextAttributeFlags, ContextAttributes, GLVersion};
#[cfg(not(target_os = "android"))]
use winit::{
dpi::{LogicalSize, PhysicalSize},
dpi::PhysicalSize,
event::{DeviceEvent, Event, KeyboardInput, VirtualKeyCode, WindowEvent},
event_loop::{ControlFlow, EventLoop},
window::WindowBuilder
Expand Down Expand Up @@ -88,15 +88,12 @@ static BACKGROUND_COLOR: [f32; 4] = [
#[cfg(not(target_os = "android"))]
fn main() {
let event_loop = EventLoop::new();
let dpi = event_loop.primary_monitor().unwrap().scale_factor();
let window_size = Size2D::new(WINDOW_WIDTH, WINDOW_HEIGHT);
let logical_size =
PhysicalSize::new(window_size.width, window_size.height)
.to_logical::<f64>(dpi);
let physical_size = PhysicalSize::new(WINDOW_WIDTH, WINDOW_HEIGHT);

let window = WindowBuilder::new()
.with_title("Multithreaded example")
.with_inner_size(logical_size)
.with_inner_size(physical_size)
.build(&event_loop)
.unwrap();

Expand Down

0 comments on commit 50644f0

Please sign in to comment.