summaryrefslogtreecommitdiffstats
path: root/media/tools
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-30 22:05:37 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-30 22:05:37 +0000
commit818c8554ec0fc9688690c1c29cbf713268e33568 (patch)
treec223a0d7f476212cae6848cf34a89f3eac24f5af /media/tools
parent2a6156dc5ebee4b091022603cb9250a67ef005d9 (diff)
downloadchromium_src-818c8554ec0fc9688690c1c29cbf713268e33568.zip
chromium_src-818c8554ec0fc9688690c1c29cbf713268e33568.tar.gz
chromium_src-818c8554ec0fc9688690c1c29cbf713268e33568.tar.bz2
Ensure GL initialization only happens once, and provide common init path
Currently tests initialize GL by calling into methods that should be internal to the gl bindings code. Instead, everyone should go through GLSurface::InitializeOneOff. Also GLSurface::InitializeOneOff early outs if it was already called, leading to a pattern of initializing GL all over the place just in case and not having a clear idea of where it should be set up. Instead, DCHECK that it is not called more than once, and move calls to this method to be during process startup for unit test suites instead of mid-test. This adds two test variants of InitializeOneOff for tests to call, that set up OSMesa or Mock GL bindings, via GLSurface::InitializeOneOff. R=piman, sievers BUG=270918 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=247793 Review URL: https://codereview.chromium.org/135213003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@248049 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/tools')
-rw-r--r--media/tools/player_x11/gl_video_renderer.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/media/tools/player_x11/gl_video_renderer.cc b/media/tools/player_x11/gl_video_renderer.cc
index 58d122a..e32a63c 100644
--- a/media/tools/player_x11/gl_video_renderer.cc
+++ b/media/tools/player_x11/gl_video_renderer.cc
@@ -11,7 +11,7 @@
#include "media/base/buffers.h"
#include "media/base/video_frame.h"
#include "media/base/yuv_convert.h"
-#include "ui/gl/gl_implementation.h"
+#include "ui/gl/gl_surface.h"
enum { kNumYUVPlanes = 3 };
@@ -20,8 +20,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
- if (!InitializeStaticGLBindings(gfx::kGLImplementationDesktopGL)) {
- LOG(ERROR) << "InitializeStaticGLBindings failed";
+ if (!gfx::GLSurface::InitializeOneOff()) {
+ LOG(ERROR) << "GLSurface::InitializeOneOff failed";
return NULL;
}