Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(483)

Unified Diff: ui/gl/gl_surface_egl.cc

Issue 2902863002: Implement EGL context priority if supported, use in VrShell (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gl/gl_surface_egl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_surface_egl.cc
diff --git a/ui/gl/gl_surface_egl.cc b/ui/gl/gl_surface_egl.cc
index fe3772586c630afa6bef05b284364d1514e398ed..5563fe2a2abab16a9caf10c1cabb58e7673164e5 100644
--- a/ui/gl/gl_surface_egl.cc
+++ b/ui/gl/gl_surface_egl.cc
@@ -128,6 +128,7 @@ bool g_egl_sync_control_supported = false;
bool g_egl_window_fixed_size_supported = false;
bool g_egl_surfaceless_context_supported = false;
bool g_egl_surface_orientation_supported = false;
+bool g_egl_context_priority_supported = false;
bool g_use_direct_composition = false;
class EGLSyncControlVSyncProvider : public SyncControlVSyncProvider {
@@ -525,6 +526,17 @@ bool GLSurfaceEGL::InitializeOneOff(EGLNativeDisplayType native_display) {
HasEGLExtension("EGL_ANGLE_window_fixed_size");
g_egl_surface_orientation_supported =
HasEGLExtension("EGL_ANGLE_surface_orientation");
+ // According to https://source.android.com/compatibility/android-cdd.html the
+ // EGL_IMG_context_priority extension is mandatory for Virtual Reality High
+ // Performance support, but due to a bug in Android Nougat the extension
+ // isn't being reported even when it's present. As a fallback, check if other
+ // related extensions that were added for VR support are present, and assume
+ // that this implies context priority is also supported. See also:
+ // https://github.com/googlevr/gvr-android-sdk/issues/330
+ g_egl_context_priority_supported =
+ HasEGLExtension("EGL_IMG_context_priority") ||
+ (HasEGLExtension("EGL_ANDROID_front_buffer_auto_refresh") &&
+ HasEGLExtension("EGL_ANDROID_create_native_client_buffer"));
// Need EGL_ANGLE_flexible_surface_compatibility to allow surfaces with and
// without alpha to be bound to the same context.
@@ -627,6 +639,11 @@ bool GLSurfaceEGL::IsEGLSurfacelessContextSupported() {
}
// static
+bool GLSurfaceEGL::IsEGLContextPrioritySupported() {
+ return g_egl_context_priority_supported;
+}
+
+// static
bool GLSurfaceEGL::IsDirectCompositionSupported() {
return g_use_direct_composition;
}
« no previous file with comments | « ui/gl/gl_surface_egl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698