summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-16 19:01:56 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-16 19:01:56 +0000
commitaf9884f13671ccbab814a99cf97c9d63ba58d0d5 (patch)
tree103dbd09dfd724f62fa4d6aea8c510e19b51be05 /content
parent080287469804ce94aaf94c87e957fd27315dcf49 (diff)
downloadchromium_src-af9884f13671ccbab814a99cf97c9d63ba58d0d5.zip
chromium_src-af9884f13671ccbab814a99cf97c9d63ba58d0d5.tar.gz
chromium_src-af9884f13671ccbab814a99cf97c9d63ba58d0d5.tar.bz2
Decide whether to use image transport surface on windows by querying EGL extensions directly.
The bindings and extensions are not enumerated until the first context is made current. This meant the first view surface was not using image transport surface. Review URL: http://codereview.chromium.org/8965015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114836 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/common/gpu/image_transport_surface_win.cc21
1 files changed, 13 insertions, 8 deletions
diff --git a/content/common/gpu/image_transport_surface_win.cc b/content/common/gpu/image_transport_surface_win.cc
index c696f1f..fb79de8 100644
--- a/content/common/gpu/image_transport_surface_win.cc
+++ b/content/common/gpu/image_transport_surface_win.cc
@@ -14,6 +14,7 @@
#include "base/win/windows_version.h"
#include "content/common/gpu/gpu_messages.h"
#include "content/public/common/content_switches.h"
+#include "third_party/angle/include/EGL/egl.h"
#include "ui/gfx/gl/gl_bindings.h"
#include "ui/gfx/gl/gl_context.h"
#include "ui/gfx/gl/gl_implementation.h"
@@ -190,19 +191,23 @@ scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface(
int32 command_buffer_id,
gfx::PluginWindowHandle handle) {
scoped_refptr<gfx::GLSurface> surface;
-
base::win::OSInfo* os_info = base::win::OSInfo::GetInstance();
if (gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2 &&
- gfx::g_EGL_ANGLE_query_surface_pointer &&
- gfx::g_EGL_ANGLE_d3d_share_handle_client_buffer &&
!CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableImageTransportSurface)) {
- surface = new PbufferImageTransportSurface(manager,
- render_view_id,
- renderer_id,
- command_buffer_id);
- } else {
+ const char* extensions = eglQueryString(eglGetDisplay(EGL_DEFAULT_DISPLAY),
+ EGL_EXTENSIONS);
+ if (strstr(extensions, "EGL_ANGLE_query_surface_pointer") &&
+ strstr(extensions, "EGL_ANGLE_surface_d3d_texture_2d_share_handle")) {
+ surface = new PbufferImageTransportSurface(manager,
+ render_view_id,
+ renderer_id,
+ command_buffer_id);
+ }
+ }
+
+ if (!surface.get()) {
surface = gfx::GLSurface::CreateViewGLSurface(false, handle);
if (!surface.get())
return NULL;