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

Unified Diff: ui/gl/gl_surface_egl.cc

Issue 1538803004: Create child window in GPU process for DirectComposition (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
Index: ui/gl/gl_surface_egl.cc
diff --git a/ui/gl/gl_surface_egl.cc b/ui/gl/gl_surface_egl.cc
index 9107bdd90ecb78b190fed84087f99d6a343974f8..1b15a4dcd208ed3a329920871c33d14bcd963306 100644
--- a/ui/gl/gl_surface_egl.cc
+++ b/ui/gl/gl_surface_egl.cc
@@ -103,6 +103,7 @@ bool g_egl_create_context_robustness_supported = false;
bool g_egl_sync_control_supported = false;
bool g_egl_window_fixed_size_supported = false;
bool g_egl_surfaceless_context_supported = false;
+bool g_use_direct_composition = false;
class EGLSyncControlVSyncProvider
: public gfx::SyncControlVSyncProvider {
@@ -361,6 +362,9 @@ bool GLSurfaceEGL::InitializeOneOff() {
g_egl_window_fixed_size_supported =
HasEGLExtension("EGL_ANGLE_window_fixed_size");
+ g_use_direct_composition = base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kUseDirectComposition);
+
// TODO(oetuaho@nvidia.com): Surfaceless is disabled on Android as a temporary
// workaround, since code written for Android WebView takes different paths
// based on whether GL surface objects have underlying EGL surface handles,
@@ -423,6 +427,10 @@ bool GLSurfaceEGL::IsEGLSurfacelessContextSupported() {
return g_egl_surfaceless_context_supported;
}
+bool GLSurfaceEGL::IsDirectCompositionSupported() {
+ return g_use_direct_composition;
+}
+
GLSurfaceEGL::~GLSurfaceEGL() {}
// InitializeDisplay is necessary because the static binding code
@@ -485,9 +493,10 @@ NativeViewGLSurfaceEGL::NativeViewGLSurfaceEGL(EGLNativeWindowType window)
: window_(window),
config_(NULL),
size_(1, 1),
+ alpha_(true),
+ enable_fixed_size_angle_(false),
surface_(NULL),
supports_post_sub_buffer_(false),
- alpha_(true),
swap_interval_(1) {
#if defined(OS_ANDROID)
if (window)
@@ -525,7 +534,7 @@ bool NativeViewGLSurfaceEGL::Initialize(
std::vector<EGLint> egl_window_attributes;
- if (g_egl_window_fixed_size_supported) {
+ if (g_egl_window_fixed_size_supported && enable_fixed_size_angle_) {
egl_window_attributes.push_back(EGL_FIXED_SIZE_ANGLE);
egl_window_attributes.push_back(EGL_TRUE);
egl_window_attributes.push_back(EGL_WIDTH);

Powered by Google App Engine
This is Rietveld 408576698