From 44a34186a63080c37c70bddc0ecd2c5efc9d7fab Mon Sep 17 00:00:00 2001 From: "wjia@google.com" Date: Wed, 23 Jun 2010 00:37:13 +0000 Subject: fix broken gl renderer BUG=none TEST=player_x11 Review URL: http://codereview.chromium.org/2803019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50555 0039d316-1c4b-4281-b951-d872f2087c98 --- media/tools/player_x11/gl_video_renderer.cc | 27 +++------------------------ media/tools/player_x11/gl_video_renderer.h | 4 +--- 2 files changed, 4 insertions(+), 27 deletions(-) (limited to 'media/tools/player_x11') diff --git a/media/tools/player_x11/gl_video_renderer.cc b/media/tools/player_x11/gl_video_renderer.cc index 630fe9e..10d28d1 100644 --- a/media/tools/player_x11/gl_video_renderer.cc +++ b/media/tools/player_x11/gl_video_renderer.cc @@ -4,11 +4,9 @@ #include "media/tools/player_x11/gl_video_renderer.h" -#include #include -#include -#include +#include "app/gfx/gl/gl_implementation.h" #include "media/base/buffers.h" #include "media/base/video_frame.h" #include "media/base/yuv_convert.h" @@ -44,13 +42,8 @@ static GLXContext InitGLContext(Display* display, Window window) { // dlopen/dlsym, and so linking it into chrome breaks it. So we dynamically // load it, and use glew to dynamically resolve symbols. // See http://code.google.com/p/chromium/issues/detail?id=16800 - void* handle = dlopen("libGL.so.1", RTLD_LAZY | RTLD_GLOBAL); - if (!handle) { - LOG(ERROR) << "Could not find libGL.so.1"; - return NULL; - } - if (glxewInit() != GLEW_OK) { - LOG(ERROR) << "GLXEW failed initialization"; + if (!InitializeGLBindings(gfx::kGLImplementationDesktopGL)) { + LOG(ERROR) << "InitializeGLBindings failed"; return NULL; } @@ -78,18 +71,6 @@ static GLXContext InitGLContext(Display* display, Window window) { return NULL; } - if (glewInit() != GLEW_OK) { - LOG(ERROR) << "GLEW failed initialization"; - glXDestroyContext(display, context); - return NULL; - } - - if (!glewIsSupported("GL_VERSION_2_0")) { - LOG(ERROR) << "GL implementation doesn't support GL version 2.0"; - glXDestroyContext(display, context); - return NULL; - } - return context; } @@ -163,8 +144,6 @@ bool GlVideoRenderer::OnInitialize(media::VideoDecoder* decoder) { if (!gl_context_) return false; - glMatrixMode(GL_MODELVIEW); - // Create 3 textures, one for each plane, and bind them to different // texture units. glGenTextures(media::VideoFrame::kNumYUVPlanes, textures_); diff --git a/media/tools/player_x11/gl_video_renderer.h b/media/tools/player_x11/gl_video_renderer.h index f88129b..e645950 100644 --- a/media/tools/player_x11/gl_video_renderer.h +++ b/media/tools/player_x11/gl_video_renderer.h @@ -5,9 +5,7 @@ #ifndef MEDIA_TOOLS_PLAYER_X11_GL_VIDEO_RENDERER_H_ #define MEDIA_TOOLS_PLAYER_X11_GL_VIDEO_RENDERER_H_ -#include -#include - +#include "app/gfx/gl/gl_bindings.h" #include "base/lock.h" #include "base/scoped_ptr.h" #include "media/base/factory.h" -- cgit v1.1