mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Remove the egl-configs diagnostic program
It has served its purpose. If we ever need it again it’s in git history.
This commit is contained in:
parent
b6b9fe07e2
commit
9e544c2aae
12 changed files with 1 additions and 286 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -4,7 +4,6 @@
|
||||||
/.servobuild
|
/.servobuild
|
||||||
/android-toolchains
|
/android-toolchains
|
||||||
/target
|
/target
|
||||||
/support/android/egl-configs/target
|
|
||||||
/ports/android/bin
|
/ports/android/bin
|
||||||
/ports/android/libs
|
/ports/android/libs
|
||||||
/ports/android/local.properties
|
/ports/android/local.properties
|
||||||
|
|
|
@ -7,7 +7,7 @@ default-members = [
|
||||||
"ports/servo",
|
"ports/servo",
|
||||||
"tests/unit/*",
|
"tests/unit/*",
|
||||||
]
|
]
|
||||||
exclude = [".cargo", "support/android/egl-configs"]
|
exclude = [".cargo"]
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
opt-level = 3
|
opt-level = 3
|
||||||
|
|
|
@ -58,7 +58,6 @@ files = [
|
||||||
"./resources/hsts_preload.json",
|
"./resources/hsts_preload.json",
|
||||||
"./tests/wpt/metadata/MANIFEST.json",
|
"./tests/wpt/metadata/MANIFEST.json",
|
||||||
"./support/android/openssl.sh",
|
"./support/android/openssl.sh",
|
||||||
"./support/android/egl-configs/Cargo.lock",
|
|
||||||
# Upstream code from Khronos/WebGL uses tabs for indentation
|
# Upstream code from Khronos/WebGL uses tabs for indentation
|
||||||
"./tests/wpt/mozilla/tests/webgl",
|
"./tests/wpt/mozilla/tests/webgl",
|
||||||
# Ignore those files since the issues reported are on purpose
|
# Ignore those files since the issues reported are on purpose
|
||||||
|
|
|
@ -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"
|
|
55
support/android/egl-configs/Cargo.lock
generated
55
support/android/egl-configs/Cargo.lock
generated
|
@ -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"
|
|
|
@ -1,7 +0,0 @@
|
||||||
[package]
|
|
||||||
name = "egl-configs"
|
|
||||||
version = "0.1.0"
|
|
||||||
license = "MPL-2.0"
|
|
||||||
|
|
||||||
[build-dependencies]
|
|
||||||
gl_generator = "0.9"
|
|
|
@ -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();
|
|
||||||
}
|
|
|
@ -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" \
|
|
||||||
"${@}"
|
|
|
@ -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" \
|
|
||||||
"${@}"
|
|
|
@ -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}" "${@}"
|
|
|
@ -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"));
|
|
|
@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue