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

Unified Diff: ui/gl/gl_context_egl.cc

Issue 2586803003: Enable creation of offscreen contexts which own their backing surface. (Closed)
Patch Set: Rebase, update comment for alpha semantics Created 3 years, 11 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_context.h ('k') | ui/gl/gl_surface_egl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_context_egl.cc
diff --git a/ui/gl/gl_context_egl.cc b/ui/gl/gl_context_egl.cc
index 1cd08cd40496efa08ee512b4dfe85efcc9d69296..6e85155f8347be950b51b2829b134f4308013990 100644
--- a/ui/gl/gl_context_egl.cc
+++ b/ui/gl/gl_context_egl.cc
@@ -32,6 +32,12 @@ extern "C" {
#define EGL_CONTEXT_WEBGL_COMPATIBILITY_ANGLE 0x3AAC
#endif /* EGL_ANGLE_create_context_webgl_compatibility */
+#ifndef EGL_CONTEXT_PRIORITY_LEVEL_IMG
+#define EGL_CONTEXT_PRIORITY_LEVEL_IMG 0x3100
+#define EGL_CONTEXT_PRIORITY_LOW_IMG 0x3103
+#endif /* EGL_CONTEXT_PRIORITY_LEVEL */
+
+
using ui::GetLastEGLErrorString;
namespace gl {
@@ -105,6 +111,12 @@ bool GLContextEGL::Initialize(GLSurface* compatible_surface,
DCHECK(!attribs.webgl_compatibility_context);
}
+ if (GLSurfaceEGL::IsEGLContextPrioritySupported() && attribs.low_priority) {
+ DVLOG(1) << __FUNCTION__ << ": setting low priority";
+ context_attributes.push_back(EGL_CONTEXT_PRIORITY_LEVEL_IMG);
+ context_attributes.push_back(EGL_CONTEXT_PRIORITY_LOW_IMG);
+ }
+
// Append final EGL_NONE to signal the context attributes are finished
context_attributes.push_back(EGL_NONE);
context_attributes.push_back(EGL_NONE);
« no previous file with comments | « ui/gl/gl_context.h ('k') | ui/gl/gl_surface_egl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698