From 5e5f761c9a9a6bc55dad992d13fa04455ffb2936 Mon Sep 17 00:00:00 2001 From: Glenn Watson Date: Wed, 29 Oct 2014 14:23:57 +1000 Subject: [PATCH] Update to use CGL crate for mac. --- Cargo.lock | 10 +++++++++- ports/cef/Cargo.lock | 10 +++++++++- ports/glfw/Cargo.toml | 4 ++-- ports/glfw/lib.rs | 3 ++- ports/glfw/window.rs | 2 +- 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f3ac245ff91..44367f5b74c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -48,6 +48,14 @@ dependencies = [ "util 0.0.1", ] +[[package]] +name = "cgl" +version = "0.0.1" +source = "git+https://github.com/servo/rust-cgl#0a8d726e57b4cd55bee9f7c743d29ae1cf8f3fc2" +dependencies = [ + "opengles 0.1.0 (git+https://github.com/servo/rust-opengles#e308a8672f7d953f6484932b6a4aaae8a0cc2a50)", +] + [[package]] name = "cocoa" version = "0.1.0" @@ -220,12 +228,12 @@ name = "glfw_app" version = "0.0.1" dependencies = [ "alert 0.1.0 (git+https://github.com/servo/rust-alert#fdc24f13be8d8a2d15214ec228d166b3221b809e)", + "cgl 0.0.1 (git+https://github.com/servo/rust-cgl#0a8d726e57b4cd55bee9f7c743d29ae1cf8f3fc2)", "compositing 0.0.1", "geom 0.1.0 (git+https://github.com/servo/rust-geom#b001a76e907befaae1d0d6dd259418a22092da86)", "glfw 0.0.1 (git+https://github.com/servo/glfw-rs?ref=servo#a15c2d04b8969aea653841d1d79e5fdf68de664b)", "layers 0.1.0 (git+https://github.com/servo/rust-layers#4282ee4203a2e706007b723f4fd3f5eca9541461)", "msg 0.0.1", - "opengles 0.1.0 (git+https://github.com/servo/rust-opengles#e308a8672f7d953f6484932b6a4aaae8a0cc2a50)", "util 0.0.1", ] diff --git a/ports/cef/Cargo.lock b/ports/cef/Cargo.lock index 84a43167853..cd85aefd208 100644 --- a/ports/cef/Cargo.lock +++ b/ports/cef/Cargo.lock @@ -59,6 +59,14 @@ dependencies = [ "util 0.0.1", ] +[[package]] +name = "cgl" +version = "0.0.1" +source = "git+https://github.com/servo/rust-cgl#0a8d726e57b4cd55bee9f7c743d29ae1cf8f3fc2" +dependencies = [ + "opengles 0.1.0 (git+https://github.com/servo/rust-opengles#e308a8672f7d953f6484932b6a4aaae8a0cc2a50)", +] + [[package]] name = "cocoa" version = "0.1.0" @@ -231,12 +239,12 @@ name = "glfw_app" version = "0.0.1" dependencies = [ "alert 0.1.0 (git+https://github.com/servo/rust-alert#fdc24f13be8d8a2d15214ec228d166b3221b809e)", + "cgl 0.0.1 (git+https://github.com/servo/rust-cgl#0a8d726e57b4cd55bee9f7c743d29ae1cf8f3fc2)", "compositing 0.0.1", "geom 0.1.0 (git+https://github.com/servo/rust-geom#b001a76e907befaae1d0d6dd259418a22092da86)", "glfw 0.0.1 (git+https://github.com/servo/glfw-rs?ref=servo#a15c2d04b8969aea653841d1d79e5fdf68de664b)", "layers 0.1.0 (git+https://github.com/servo/rust-layers#4282ee4203a2e706007b723f4fd3f5eca9541461)", "msg 0.0.1", - "opengles 0.1.0 (git+https://github.com/servo/rust-opengles#e308a8672f7d953f6484932b6a4aaae8a0cc2a50)", "util 0.0.1", ] diff --git a/ports/glfw/Cargo.toml b/ports/glfw/Cargo.toml index 044f27c727c..0b66b7e9cb0 100644 --- a/ports/glfw/Cargo.toml +++ b/ports/glfw/Cargo.toml @@ -29,5 +29,5 @@ path = "../../components/msg" [dependencies.util] path = "../../components/util" -[dependencies.opengles] -git = "https://github.com/servo/rust-opengles" +[dependencies.cgl] +git = "https://github.com/servo/rust-cgl" diff --git a/ports/glfw/lib.rs b/ports/glfw/lib.rs index f70749a62fa..59d861723c7 100644 --- a/ports/glfw/lib.rs +++ b/ports/glfw/lib.rs @@ -9,6 +9,8 @@ #![deny(unused_imports, unused_variable)] extern crate alert; +#[cfg(target_os="macos")] +extern crate cgl; extern crate compositing; extern crate geom; extern crate glfw; @@ -17,7 +19,6 @@ extern crate libc; extern crate msg; extern crate time; extern crate util; -extern crate opengles; use geom::scale_factor::ScaleFactor; use std::rc::Rc; diff --git a/ports/glfw/window.rs b/ports/glfw/window.rs index 076dbe397e9..ca1c0bde48d 100644 --- a/ports/glfw/window.rs +++ b/ports/glfw/window.rs @@ -162,7 +162,7 @@ impl WindowMethods for Window { #[cfg(target_os="macos")] fn native_metadata(&self) -> NativeGraphicsMetadata { - use opengles::cgl::{CGLGetCurrentContext, CGLGetPixelFormat}; + use cgl::{CGLGetCurrentContext, CGLGetPixelFormat}; unsafe { NativeGraphicsMetadata { pixel_format: CGLGetPixelFormat(CGLGetCurrentContext()),