Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mach bootstrap-android and test-android-startup commands #21094

Merged
merged 30 commits into from Jul 2, 2018
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b9d5f11
Add `./mach bootstrap-android`
SimonSapin Jun 21, 2018
510cf1a
boostrap: set executable bits when extracting zip files
SimonSapin Jun 21, 2018
56df7f4
Install complete Android SDK (as much as on Buildbot CI)
SimonSapin Jun 21, 2018
244a332
Use more recent Android tools
SimonSapin Jun 25, 2018
1ee54ab
Create and Android virtual device
SimonSapin Jun 25, 2018
8889742
mach bootstrap-android: configure and show how to start an emulator
SimonSapin Jun 25, 2018
fe24816
mach run --android: show PID
SimonSapin Jun 25, 2018
4cbf3de
mach {package,install} --android: add --emulator and --usb
SimonSapin Jun 25, 2018
eab971c
Android cross-compiled command line hello world
SimonSapin Jun 25, 2018
90ba22b
egl-configs: link to EGL and generate bindings
SimonSapin Jun 25, 2018
89f6c6d
egl-configs: get the number of configs
SimonSapin Jun 25, 2018
7e7316e
egl-configs: print all config attributes
SimonSapin Jun 25, 2018
1f8d04b
egl-configs: print hex too
SimonSapin Jun 25, 2018
6e68705
cargo run into Android/adb: configurable target device
SimonSapin Jun 25, 2018
484eee8
Tidy
SimonSapin Jun 25, 2018
3c992af
Remove debugging println from a year ago
SimonSapin Jun 26, 2018
7d7f202
Fix copy/paste mistake
SimonSapin Jun 26, 2018
b7a8b81
egl-configs: add i686 support
SimonSapin Jun 26, 2018
f4d740f
Typo fixes
SimonSapin Jun 27, 2018
e54ad77
Do not prompt for Android emulator hardware profile
SimonSapin Jun 28, 2018
0e2e9cb
Create emulator images for both ARM and x86
SimonSapin Jun 28, 2018
aa1c3ce
bootstrap-android: use predictable paths for SDK and NDK
SimonSapin Jun 28, 2018
65122b1
bootstrap-android: always run sdkmanager
SimonSapin Jun 28, 2018
fc77db4
Use the bootstraped Android toolchains by default
SimonSapin Jun 28, 2018
b6b9fe0
Add "./mach android-emulator"
SimonSapin Jun 28, 2018
9e544c2
Remove the egl-configs diagnostic program
SimonSapin Jun 29, 2018
8293b29
bootstrap-android: check SHA1 hashes of downloaded archives
SimonSapin Jun 29, 2018
bee3fd0
mach android-emulator: avoid mach error messages for Python exceptions
SimonSapin Jun 29, 2018
eecbe83
Add ./mach test-android-startup
SimonSapin Jun 29, 2018
c0d1b8e
Android: increase emulator disk size, for debug builds
SimonSapin Jul 2, 2018
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

egl-configs: print all config attributes

  • Loading branch information
SimonSapin committed Jul 2, 2018
commit 7e7316e76629aa57fb7316540b65d1877c53541d
@@ -25,6 +25,62 @@ unsafe fn run() {
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));
println!(" {} = {}", attr_name, value)
}
}
}

unsafe fn check(result: EGLBoolean, function_name: &str) {
@@ -35,6 +91,6 @@ unsafe fn check(result: EGLBoolean, function_name: &str) {
unsafe fn check_error() {
let status = GetError();
if status != SUCCESS as i32 {
println!("Error: 0x{:x}", status);
panic!("Error: 0x{:x}", status);
}
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.