mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1421199 - Use EGL_EXPERIMENTAL_PRESENT_PATH_FAST_ANGLE for WebRender r=jgilbert
This commit is contained in:
parent
190f7edde5
commit
5c61ce035d
@ -744,7 +744,7 @@ Error ValidateCreateContext(Display *display, Config *configuration, gl::Context
|
||||
{
|
||||
return EglBadConfig();
|
||||
}
|
||||
if (!(configuration->conformant & EGL_OPENGL_ES3_BIT_KHR))
|
||||
if (!(configuration->renderableType & EGL_OPENGL_ES3_BIT_KHR))
|
||||
{
|
||||
return EglBadConfig();
|
||||
}
|
||||
|
@ -53,6 +53,11 @@
|
||||
#define LOCAL_EGL_PLATFORM_ANGLE_DEVICE_TYPE_REFERENCE_ANGLE 0x320C
|
||||
#define LOCAL_EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE 0x320F
|
||||
|
||||
// EGL_ANGLE_experimental_present_path
|
||||
#define LOCAL_EGL_EXPERIMENTAL_PRESENT_PATH_ANGLE 0x33A4
|
||||
#define LOCAL_EGL_EXPERIMENTAL_PRESENT_PATH_FAST_ANGLE 0x33A9
|
||||
#define LOCAL_EGL_EXPERIMENTAL_PRESENT_PATH_COPY_ANGLE 0x33AA
|
||||
|
||||
// EGL_ANGLE_direct3d_display
|
||||
#define LOCAL_EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE ((EGLNativeDisplayType)-2)
|
||||
#define LOCAL_EGL_D3D11_ONLY_DISPLAY_ANGLE ((EGLNativeDisplayType)-3)
|
||||
|
@ -146,6 +146,35 @@ GetAndInitWARPDisplay(GLLibraryEGL& egl, void* displayType)
|
||||
return display;
|
||||
}
|
||||
|
||||
static EGLDisplay
|
||||
GetAndInitDisplayForWebRender(GLLibraryEGL& egl, void* displayType)
|
||||
{
|
||||
const EGLint attrib_list[] = { LOCAL_EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE,
|
||||
LOCAL_EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE,
|
||||
LOCAL_EGL_PLATFORM_ANGLE_TYPE_ANGLE,
|
||||
LOCAL_EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||
LOCAL_EGL_EXPERIMENTAL_PRESENT_PATH_ANGLE,
|
||||
LOCAL_EGL_EXPERIMENTAL_PRESENT_PATH_FAST_ANGLE,
|
||||
LOCAL_EGL_NONE };
|
||||
EGLDisplay display = egl.fGetPlatformDisplayEXT(LOCAL_EGL_PLATFORM_ANGLE_ANGLE,
|
||||
displayType,
|
||||
attrib_list);
|
||||
|
||||
if (display == EGL_NO_DISPLAY) {
|
||||
const EGLint err = egl.fGetError();
|
||||
if (err != LOCAL_EGL_SUCCESS) {
|
||||
gfxCriticalError() << "Unexpected GL error: " << gfx::hexa(err);
|
||||
MOZ_CRASH("GFX: Unexpected GL error.");
|
||||
}
|
||||
return EGL_NO_DISPLAY;
|
||||
}
|
||||
|
||||
if (!egl.fInitialize(display, nullptr, nullptr))
|
||||
return EGL_NO_DISPLAY;
|
||||
|
||||
return display;
|
||||
}
|
||||
|
||||
static bool
|
||||
IsAccelAngleSupported(const nsCOMPtr<nsIGfxInfo>& gfxInfo,
|
||||
nsACString* const out_failureId)
|
||||
@ -241,7 +270,7 @@ GetAndInitDisplayForAccelANGLE(GLLibraryEGL& egl, nsACString* const out_failureI
|
||||
EGLDisplay ret = 0;
|
||||
|
||||
if (wr::RenderThread::IsInRenderThread()) {
|
||||
return GetAndInitDisplay(egl, LOCAL_EGL_D3D11_ONLY_DISPLAY_ANGLE);
|
||||
return GetAndInitDisplayForWebRender(egl, EGL_DEFAULT_DISPLAY);
|
||||
}
|
||||
|
||||
FeatureState& d3d11ANGLE = gfxConfig::GetFeature(Feature::D3D11_HW_ANGLE);
|
||||
|
Loading…
Reference in New Issue
Block a user