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

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 4 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_surface_egl.h ('k') | ui/gl/gl_switches.h » ('j') | 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 5dd8637f0f301c7213ba8993f0cd35f171922d64..2d1882e1b6d01cdc44337c5be9505b8253e01012 100644
--- a/ui/gl/gl_surface_egl.cc
+++ b/ui/gl/gl_surface_egl.cc
@@ -116,6 +116,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_use_direct_composition = false;
class EGLSyncControlVSyncProvider
: public gfx::SyncControlVSyncProvider {
@@ -376,6 +377,9 @@ bool GLSurfaceEGL::InitializeOneOff() {
g_egl_surface_orientation_supported =
HasEGLExtension("EGL_ANGLE_surface_orientation");
+ 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,
@@ -438,6 +442,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
@@ -500,9 +508,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),
flips_vertically_(false),
swap_interval_(1) {
#if defined(OS_ANDROID)
@@ -541,7 +550,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);
« no previous file with comments | « ui/gl/gl_surface_egl.h ('k') | ui/gl/gl_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698