mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-14 12:13:22 +00:00
Bug 1563035 - Webrender assumes that an EGL context uses GLES (but it can be GL, too). r=jgilbert
This commit is contained in:
parent
e501ee889d
commit
46c9b36d04
@ -85,15 +85,9 @@ bool gecko_profiler_thread_is_being_profiled() {
|
||||
#endif
|
||||
}
|
||||
|
||||
bool is_glcontext_egl(void* glcontext_ptr) {
|
||||
MOZ_ASSERT(glcontext_ptr);
|
||||
|
||||
mozilla::gl::GLContext* glcontext =
|
||||
reinterpret_cast<mozilla::gl::GLContext*>(glcontext_ptr);
|
||||
if (!glcontext) {
|
||||
return false;
|
||||
}
|
||||
return glcontext->GetContextType() == mozilla::gl::GLContextType::EGL;
|
||||
bool is_glcontext_gles(void* const glcontext_ptr) {
|
||||
MOZ_RELEASE_ASSERT(glcontext_ptr);
|
||||
return reinterpret_cast<mozilla::gl::GLContext*>(glcontext_ptr)->IsGLES();
|
||||
}
|
||||
|
||||
bool is_glcontext_angle(void* glcontext_ptr) {
|
||||
|
@ -535,7 +535,7 @@ extern "C" {
|
||||
fn is_in_compositor_thread() -> bool;
|
||||
fn is_in_render_thread() -> bool;
|
||||
fn is_in_main_thread() -> bool;
|
||||
fn is_glcontext_egl(glcontext_ptr: *mut c_void) -> bool;
|
||||
fn is_glcontext_gles(glcontext_ptr: *mut c_void) -> bool;
|
||||
fn is_glcontext_angle(glcontext_ptr: *mut c_void) -> bool;
|
||||
// Enables binary recording that can be used with `wrench replay`
|
||||
// Outputs a wr-record-*.bin file for each window that is shown
|
||||
@ -1106,7 +1106,7 @@ fn wr_device_new(gl_context: *mut c_void, pc: Option<&mut WrProgramCache>)
|
||||
assert!(unsafe { is_in_render_thread() });
|
||||
|
||||
let gl;
|
||||
if unsafe { is_glcontext_egl(gl_context) } {
|
||||
if unsafe { is_glcontext_gles(gl_context) } {
|
||||
gl = unsafe { gl::GlesFns::load_with(|symbol| get_proc_address(gl_context, symbol)) };
|
||||
} else {
|
||||
gl = unsafe { gl::GlFns::load_with(|symbol| get_proc_address(gl_context, symbol)) };
|
||||
@ -1171,7 +1171,7 @@ pub extern "C" fn wr_window_new(window_id: WrWindowId,
|
||||
};
|
||||
|
||||
let gl;
|
||||
if unsafe { is_glcontext_egl(gl_context) } {
|
||||
if unsafe { is_glcontext_gles(gl_context) } {
|
||||
gl = unsafe { gl::GlesFns::load_with(|symbol| get_proc_address(gl_context, symbol)) };
|
||||
} else {
|
||||
gl = unsafe { gl::GlFns::load_with(|symbol| get_proc_address(gl_context, symbol)) };
|
||||
|
@ -19,7 +19,7 @@ extern "C" {
|
||||
bool is_in_compositor_thread();
|
||||
bool is_in_main_thread();
|
||||
bool is_in_render_thread();
|
||||
bool is_glcontext_egl(void* glcontext_ptr);
|
||||
bool is_glcontext_gles(void* glcontext_ptr);
|
||||
bool is_glcontext_angle(void* glcontext_ptr);
|
||||
bool gfx_use_wrench();
|
||||
const char* gfx_wr_resource_path_override();
|
||||
|
Loading…
x
Reference in New Issue
Block a user