| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/gl/gl_surface_egl.h" | 5 #include "ui/gl/gl_surface_egl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 g_egl_window_fixed_size_supported = | 385 g_egl_window_fixed_size_supported = |
| 386 HasEGLExtension("EGL_ANGLE_window_fixed_size"); | 386 HasEGLExtension("EGL_ANGLE_window_fixed_size"); |
| 387 g_egl_surface_orientation_supported = | 387 g_egl_surface_orientation_supported = |
| 388 HasEGLExtension("EGL_ANGLE_surface_orientation"); | 388 HasEGLExtension("EGL_ANGLE_surface_orientation"); |
| 389 | 389 |
| 390 // Need EGL_ANGLE_flexible_surface_compatibility to allow surfaces with and | 390 // Need EGL_ANGLE_flexible_surface_compatibility to allow surfaces with and |
| 391 // without alpha to be bound to the same context. | 391 // without alpha to be bound to the same context. |
| 392 g_use_direct_composition = | 392 g_use_direct_composition = |
| 393 HasEGLExtension("EGL_ANGLE_direct_composition") && | 393 HasEGLExtension("EGL_ANGLE_direct_composition") && |
| 394 HasEGLExtension("EGL_ANGLE_flexible_surface_compatibility") && | 394 HasEGLExtension("EGL_ANGLE_flexible_surface_compatibility") && |
| 395 base::CommandLine::ForCurrentProcess()->HasSwitch( | 395 !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 396 switches::kUseDirectComposition); | 396 switches::kDisableDirectComposition); |
| 397 | 397 |
| 398 // TODO(oetuaho@nvidia.com): Surfaceless is disabled on Android as a temporary | 398 // TODO(oetuaho@nvidia.com): Surfaceless is disabled on Android as a temporary |
| 399 // workaround, since code written for Android WebView takes different paths | 399 // workaround, since code written for Android WebView takes different paths |
| 400 // based on whether GL surface objects have underlying EGL surface handles, | 400 // based on whether GL surface objects have underlying EGL surface handles, |
| 401 // conflicting with the use of surfaceless. See https://crbug.com/382349 | 401 // conflicting with the use of surfaceless. See https://crbug.com/382349 |
| 402 #if defined(OS_ANDROID) | 402 #if defined(OS_ANDROID) |
| 403 DCHECK(!g_egl_surfaceless_context_supported); | 403 DCHECK(!g_egl_surfaceless_context_supported); |
| 404 #else | 404 #else |
| 405 // Check if SurfacelessEGL is supported. | 405 // Check if SurfacelessEGL is supported. |
| 406 g_egl_surfaceless_context_supported = | 406 g_egl_surfaceless_context_supported = |
| (...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1024 } | 1024 } |
| 1025 | 1025 |
| 1026 void* SurfacelessEGL::GetShareHandle() { | 1026 void* SurfacelessEGL::GetShareHandle() { |
| 1027 return NULL; | 1027 return NULL; |
| 1028 } | 1028 } |
| 1029 | 1029 |
| 1030 SurfacelessEGL::~SurfacelessEGL() { | 1030 SurfacelessEGL::~SurfacelessEGL() { |
| 1031 } | 1031 } |
| 1032 | 1032 |
| 1033 } // namespace gfx | 1033 } // namespace gfx |
| OLD | NEW |