diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2018-06-29 16:39:30 +0200 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2018-07-02 19:00:48 +0200 |
commit | 9e544c2aae5d94be562683e216d1b64d888930ff (patch) | |
tree | 4cbc7285c10011198ee4dc8a41f670ecd864be51 | |
parent | b6b9fe07e2ff55b5bee31e7a9b0a85d31390a762 (diff) | |
download | servo-9e544c2aae5d94be562683e216d1b64d888930ff.tar.gz servo-9e544c2aae5d94be562683e216d1b64d888930ff.zip |
Remove the egl-configs diagnostic program
It has served its purpose. If we ever need it again it’s in git history.
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | servo-tidy.toml | 1 | ||||
-rw-r--r-- | support/android/egl-configs/.cargo/config | 10 | ||||
-rw-r--r-- | support/android/egl-configs/Cargo.lock | 55 | ||||
-rw-r--r-- | support/android/egl-configs/Cargo.toml | 7 | ||||
-rw-r--r-- | support/android/egl-configs/build.rs | 20 | ||||
-rwxr-xr-x | support/android/egl-configs/ld-i686.sh | 16 | ||||
-rwxr-xr-x | support/android/egl-configs/ld.sh | 16 | ||||
-rwxr-xr-x | support/android/egl-configs/run.sh | 30 | ||||
-rw-r--r-- | support/android/egl-configs/src/ffi.rs | 25 | ||||
-rw-r--r-- | support/android/egl-configs/src/main.rs | 104 |
12 files changed, 1 insertions, 286 deletions
diff --git a/.gitignore b/.gitignore index a1b982002af..94acd5b1d03 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,6 @@ /.servobuild /android-toolchains /target -/support/android/egl-configs/target /ports/android/bin /ports/android/libs /ports/android/local.properties diff --git a/Cargo.toml b/Cargo.toml index 7fe866b06a4..4f107203f28 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ default-members = [ "ports/servo", "tests/unit/*", ] -exclude = [".cargo", "support/android/egl-configs"] +exclude = [".cargo"] [profile.release] opt-level = 3 diff --git a/servo-tidy.toml b/servo-tidy.toml index 286a303d303..ce69b5a24cc 100644 --- a/servo-tidy.toml +++ b/servo-tidy.toml @@ -58,7 +58,6 @@ files = [ "./resources/hsts_preload.json", "./tests/wpt/metadata/MANIFEST.json", "./support/android/openssl.sh", - "./support/android/egl-configs/Cargo.lock", # Upstream code from Khronos/WebGL uses tabs for indentation "./tests/wpt/mozilla/tests/webgl", # Ignore those files since the issues reported are on purpose diff --git a/support/android/egl-configs/.cargo/config b/support/android/egl-configs/.cargo/config deleted file mode 100644 index 800226ab108..00000000000 --- a/support/android/egl-configs/.cargo/config +++ /dev/null @@ -1,10 +0,0 @@ -[build] -target = "i686-linux-android" - -[target.armv7-linux-androideabi] -linker = "./ld.sh" -runner = "./run.sh" - -[target.i686-linux-android] -linker = "./ld-i686.sh" -runner = "./run.sh" diff --git a/support/android/egl-configs/Cargo.lock b/support/android/egl-configs/Cargo.lock deleted file mode 100644 index 1f846687f05..00000000000 --- a/support/android/egl-configs/Cargo.lock +++ /dev/null @@ -1,55 +0,0 @@ -[[package]] -name = "bitflags" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "cfg-if" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "egl-configs" -version = "0.1.0" -dependencies = [ - "gl_generator 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "gl_generator" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "khronos_api 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "xml-rs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "khronos_api" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "log" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "xml-rs" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[metadata] -"checksum bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c54bb8f454c567f21197eefcdbf5679d0bd99f2ddbe52e84c77061952e6789" -"checksum cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "405216fd8fe65f718daa7102ea808a946b6ce40c742998fbfd3463645552de18" -"checksum gl_generator 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a795170cbd85b5a7baa58d6d7525cae6a03e486859860c220f7ebbbdd379d0a" -"checksum khronos_api 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "037ab472c33f67b5fbd3e9163a2645319e5356fcd355efa6d4eb7fff4bbcb554" -"checksum log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6fddaa003a65722a7fb9e26b0ce95921fe4ba590542ced664d8ce2fa26f9f3ac" -"checksum xml-rs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3c1cb601d29fe2c2ac60a2b2e5e293994d87a1f6fa9687a31a15270f909be9c2" diff --git a/support/android/egl-configs/Cargo.toml b/support/android/egl-configs/Cargo.toml deleted file mode 100644 index ae5a6f5d342..00000000000 --- a/support/android/egl-configs/Cargo.toml +++ /dev/null @@ -1,7 +0,0 @@ -[package] -name = "egl-configs" -version = "0.1.0" -license = "MPL-2.0" - -[build-dependencies] -gl_generator = "0.9" diff --git a/support/android/egl-configs/build.rs b/support/android/egl-configs/build.rs deleted file mode 100644 index 62558fbafd4..00000000000 --- a/support/android/egl-configs/build.rs +++ /dev/null @@ -1,20 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -extern crate gl_generator; - -use gl_generator::{Registry, Api, Profile, Fallbacks}; -use std::env; -use std::fs::File; -use std::path::PathBuf; - -fn main() { - let out_dir = PathBuf::from(&env::var("OUT_DIR").unwrap()); - let mut file = File::create(&out_dir.join("egl_bindings.rs")).unwrap(); - Registry::new(Api::Egl, (1, 5), Profile::Core, Fallbacks::All, [ - "EGL_KHR_create_context", - "EGL_KHR_platform_android", - ]) - .write_bindings(gl_generator::StaticGenerator, &mut file).unwrap(); -} diff --git a/support/android/egl-configs/ld-i686.sh b/support/android/egl-configs/ld-i686.sh deleted file mode 100755 index 37b1dadd64e..00000000000 --- a/support/android/egl-configs/ld-i686.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash - -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -set -o errexit -set -o nounset -set -o pipefail - -NDK=../../../android-toolchains/android-ndk-r12b-linux-x86_64/android-ndk-r12b -BIN="${NDK}/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/" - -"${BIN}/i686-linux-android-gcc" \ - --sysroot "${NDK}/platforms/android-18/arch-x86" \ - "${@}" diff --git a/support/android/egl-configs/ld.sh b/support/android/egl-configs/ld.sh deleted file mode 100755 index f49c9940c4c..00000000000 --- a/support/android/egl-configs/ld.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash - -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -set -o errexit -set -o nounset -set -o pipefail - -NDK=../../../android-toolchains/android-ndk-r12b-linux-x86_64/android-ndk-r12b -BIN="${NDK}/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/" - -"${BIN}/arm-linux-androideabi-gcc" \ - --sysroot "${NDK}/platforms/android-18/arch-arm" \ - "${@}" diff --git a/support/android/egl-configs/run.sh b/support/android/egl-configs/run.sh deleted file mode 100755 index dfe4a1dbd4e..00000000000 --- a/support/android/egl-configs/run.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash - -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -set -o errexit -set -o nounset -set -o pipefail - -# Any -target="" - -# Specific device -#target="-s something" - -# Emulator -#target="-e" - -# USB -#target="-d" - -path="${1}" -base="$(basename ${1})" -remote_path="/data/local/tmp/${base}" -shift - -adb ${target} "wait-for-device" -adb ${target} push "${path}" "${remote_path}" >&2 -adb ${target} shell "${remote_path}" "${@}" diff --git a/support/android/egl-configs/src/ffi.rs b/support/android/egl-configs/src/ffi.rs deleted file mode 100644 index ee2b43aebd4..00000000000 --- a/support/android/egl-configs/src/ffi.rs +++ /dev/null @@ -1,25 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#![allow(non_camel_case_types)] - -use std::os::raw::*; - -pub type NativeDisplayType = *const c_void; -pub type NativePixmapType = *const c_void; -pub type NativeWindowType = *const c_void; - -pub type EGLNativeDisplayType = NativeDisplayType; -pub type EGLNativePixmapType = NativePixmapType; -pub type EGLNativeWindowType = NativeWindowType; - -pub type khronos_utime_nanoseconds_t = khronos_uint64_t; -pub type khronos_uint64_t = u64; -pub type khronos_ssize_t = c_long; -pub type EGLint = i32; - -#[link(name = "EGL")] -extern "C" {} - -include!(concat!(env!("OUT_DIR"), "/egl_bindings.rs")); diff --git a/support/android/egl-configs/src/main.rs b/support/android/egl-configs/src/main.rs deleted file mode 100644 index eb7a4388263..00000000000 --- a/support/android/egl-configs/src/main.rs +++ /dev/null @@ -1,104 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -use ffi::*; -use ffi::types::*; -use std::ptr::null_mut; - -mod ffi; - -fn main() { - unsafe { - run() - } -} - -macro_rules! check { - ($name: ident($($arg: expr),*)) => { - check($name($($arg),*), stringify!($name)) - } -} - -unsafe fn run() { - let display = GetDisplay(DEFAULT_DISPLAY as *mut _); - assert!(!display.is_null()); - - check!(Initialize(display, null_mut(), null_mut())); - - let mut num_config = -1; - check!(GetConfigs(display, null_mut(), 0, &mut num_config)); - println!("Got {} configs", num_config); - assert!(num_config >= 0); - - let mut configs = Vec::with_capacity(num_config as usize); - let mut num_config2 = -1; - check!(GetConfigs(display, configs.as_mut_ptr(), num_config, &mut num_config2)); - assert_eq!(num_config, num_config2); - configs.set_len(num_config as usize); - - for (i, &config) in configs.iter().enumerate() { - println!("Config #{}", i + 1); - - macro_rules! to_pairs { - ($($name: ident)*) => { - &[ $( (stringify!($name), $name) ),* ] - } - } - // https://www.khronos.org/registry/EGL/sdk/docs/man/html/eglGetConfigAttrib.xhtml#description - for &(attr_name, attr) in to_pairs! [ - ALPHA_SIZE - ALPHA_MASK_SIZE - BIND_TO_TEXTURE_RGB - BIND_TO_TEXTURE_RGBA - BLUE_SIZE - BUFFER_SIZE - COLOR_BUFFER_TYPE - CONFIG_CAVEAT - CONFIG_ID - CONFORMANT - DEPTH_SIZE - GREEN_SIZE - LEVEL - LUMINANCE_SIZE - MAX_PBUFFER_WIDTH - MAX_PBUFFER_HEIGHT - MAX_PBUFFER_PIXELS - MAX_SWAP_INTERVAL - MIN_SWAP_INTERVAL - NATIVE_RENDERABLE - NATIVE_VISUAL_ID - NATIVE_VISUAL_TYPE - RED_SIZE - RENDERABLE_TYPE - SAMPLE_BUFFERS - SAMPLES - STENCIL_SIZE - SURFACE_TYPE - TRANSPARENT_TYPE - TRANSPARENT_RED_VALUE - TRANSPARENT_GREEN_VALUE - TRANSPARENT_BLUE_VALUE - ] { - let mut value = -1; - check!(GetConfigAttrib(display, config, attr as i32, &mut value)); - if value < 10 { - println!(" {}\t = {}", attr_name, value) - } else { - println!(" {}\t= {} = 0x{:x}", attr_name, value, value) - } - } - } -} - -unsafe fn check(result: EGLBoolean, function_name: &str) { - check_error(); - assert_eq!(result, TRUE, "{} failed", function_name); -} - -unsafe fn check_error() { - let status = GetError(); - if status != SUCCESS as i32 { - panic!("Error: 0x{:x}", status); - } -} |