From 68ddb7e51d6ec15de2c9d608dff6735a3ce68f41 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Fri, 26 Jun 2020 11:30:09 -0400 Subject: [PATCH] Remove gleam dependency from io-surface. --- io-surface/Cargo.toml | 3 +-- io-surface/src/lib.rs | 9 ++++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/io-surface/Cargo.toml b/io-surface/Cargo.toml index 15d86ae..7fe34e0 100644 --- a/io-surface/Cargo.toml +++ b/io-surface/Cargo.toml @@ -3,7 +3,7 @@ name = "io-surface" description = "Bindings to IO Surface for macOS" homepage = "https://github.com/servo/core-foundation-rs" repository = "https://github.com/servo/core-foundation-rs" -version = "0.15.0" +version = "0.15.1" authors = ["The Servo Project Developers"] license = "MIT / Apache-2.0" @@ -12,7 +12,6 @@ default-target = "x86_64-apple-darwin" [dependencies] libc = "0.2" -gleam = "0.7" core-foundation = { path = "../core-foundation", version = "0.9" } cgl = "0.3" leaky-cow = "0.1.1" diff --git a/io-surface/src/lib.rs b/io-surface/src/lib.rs index adc5277..5bf32a7 100644 --- a/io-surface/src/lib.rs +++ b/io-surface/src/lib.rs @@ -13,7 +13,6 @@ extern crate libc; extern crate core_foundation; extern crate cgl; -extern crate gleam; extern crate leaky_cow; // Rust bindings to the IOSurface framework on macOS. @@ -21,14 +20,18 @@ extern crate leaky_cow; use core_foundation::base::{CFRelease, CFRetain, CFTypeID, CFTypeRef, CFType, TCFType}; use core_foundation::dictionary::{CFDictionary, CFDictionaryRef}; use core_foundation::string::{CFString, CFStringRef}; -use cgl::{kCGLNoError, CGLGetCurrentContext, CGLTexImageIOSurface2D, CGLErrorString}; -use gleam::gl::{BGRA, GLenum, RGB, RGBA, TEXTURE_RECTANGLE_ARB, UNSIGNED_INT_8_8_8_8_REV}; +use cgl::{kCGLNoError, CGLGetCurrentContext, CGLTexImageIOSurface2D, CGLErrorString, GLenum}; use libc::{c_int, size_t}; use std::os::raw::c_void; use leaky_cow::LeakyCow; use std::slice; use std::ffi::CStr; +const BGRA: GLenum = 0x80E1; +const RGBA: GLenum = 0x1908; +const RGB: GLenum = 0x1907; +const TEXTURE_RECTANGLE_ARB: GLenum = 0x84F5; +const UNSIGNED_INT_8_8_8_8_REV: GLenum = 0x8367; //static kIOSurfaceLockReadOnly: u32 = 0x1; //static kIOSurfaceLockAvoidSync: u32 = 0x2;