servoshell: Remove duplicate egl bindings on android/ohos (#34716)

- The default value for SwapInterval is 1,
  so setting it to 1 changes nothing
- We don't clear the screen immediately anymore, which was the only
  useage of the egl bindings

this saves us from duplicated EGL bindings.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
This commit is contained in:
Jonathan Schwender 2024-12-20 16:08:09 +01:00 committed by GitHub
parent 65c65c9a6a
commit 0dd8798148
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 6 additions and 110 deletions

View file

@ -36,7 +36,6 @@ use xcomponent_sys::{
OH_NativeXComponent_GetKeyEventCode, OH_NativeXComponent_KeyAction, OH_NativeXComponent_KeyCode,
};
use super::gl_glue;
use super::host_trait::HostTrait;
use super::servo_glue::ServoGlue;
@ -240,7 +239,6 @@ extern "C" fn on_surface_created_cb(xcomponent: *mut OH_NativeXComponent, window
let wakeup = Box::new(WakeupCallback::new(tx));
let callbacks = Box::new(HostCallbacks::new());
let egl_init = gl_glue::init().expect("egl::init() failed");
let xc = xc_wrapper;
let window = window_wrapper;
let init_opts = if let Ok(ServoAction::Initialize(init_opts)) = rx.recv() {
@ -248,15 +246,8 @@ extern "C" fn on_surface_created_cb(xcomponent: *mut OH_NativeXComponent, window
} else {
panic!("Servos GL thread received another event before it was initialized")
};
let mut servo = simpleservo::init(
*init_opts,
window.0,
xc.0,
egl_init.gl_wrapper,
wakeup,
callbacks,
)
.expect("Servo initialization failed");
let mut servo = simpleservo::init(*init_opts, window.0, xc.0, wakeup, callbacks)
.expect("Servo initialization failed");
info!("Surface created!");
let native_vsync =