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

Side by Side Diff: media/tools/player_x11/gl_video_renderer.cc

Issue 94963003: Take GL version and extensions correctly into account when binding functions (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Improve Windows initialization and renderBufferMultisample explanation Created 7 years 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 unified diff | Download patch
OLDNEW
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 "media/tools/player_x11/gl_video_renderer.h" 5 #include "media/tools/player_x11/gl_video_renderer.h"
6 6
7 #include <X11/Xutil.h> 7 #include <X11/Xutil.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
11 #include "media/base/buffers.h" 11 #include "media/base/buffers.h"
12 #include "media/base/video_frame.h" 12 #include "media/base/video_frame.h"
13 #include "media/base/yuv_convert.h" 13 #include "media/base/yuv_convert.h"
14 #include "ui/gl/gl_implementation.h" 14 #include "ui/gl/gl_implementation.h"
15 15
16 enum { kNumYUVPlanes = 3 }; 16 enum { kNumYUVPlanes = 3 };
17 17
18 static GLXContext InitGLContext(Display* display, Window window) { 18 static GLXContext InitGLContext(Display* display, Window window) {
19 // Some versions of NVIDIA's GL libGL.so include a broken version of 19 // Some versions of NVIDIA's GL libGL.so include a broken version of
20 // dlopen/dlsym, and so linking it into chrome breaks it. So we dynamically 20 // dlopen/dlsym, and so linking it into chrome breaks it. So we dynamically
21 // load it, and use glew to dynamically resolve symbols. 21 // load it, and use glew to dynamically resolve symbols.
22 // See http://code.google.com/p/chromium/issues/detail?id=16800 22 // See http://code.google.com/p/chromium/issues/detail?id=16800
23 if (!InitializeGLBindings(gfx::kGLImplementationDesktopGL)) { 23 if (!InitializeStaticGLBindings(gfx::kGLImplementationDesktopGL)) {
24 LOG(ERROR) << "InitializeGLBindings failed"; 24 LOG(ERROR) << "InitializeStaticGLBindings failed";
25 return NULL; 25 return NULL;
26 } 26 }
27 27
28 XWindowAttributes attributes; 28 XWindowAttributes attributes;
29 XGetWindowAttributes(display, window, &attributes); 29 XGetWindowAttributes(display, window, &attributes);
30 XVisualInfo visual_info_template; 30 XVisualInfo visual_info_template;
31 visual_info_template.visualid = XVisualIDFromVisual(attributes.visual); 31 visual_info_template.visualid = XVisualIDFromVisual(attributes.visual);
32 int visual_info_count = 0; 32 int visual_info_count = 0;
33 XVisualInfo* visual_info_list = XGetVisualInfo(display, VisualIDMask, 33 XVisualInfo* visual_info_list = XGetVisualInfo(display, VisualIDMask,
34 &visual_info_template, 34 &visual_info_template,
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 verts[0] = x0; verts[1] = y0; 240 verts[0] = x0; verts[1] = y0;
241 verts[2] = x0; verts[3] = y1; 241 verts[2] = x0; verts[3] = y1;
242 verts[4] = x1; verts[5] = y0; 242 verts[4] = x1; verts[5] = y0;
243 verts[6] = x1; verts[7] = y1; 243 verts[6] = x1; verts[7] = y1;
244 glVertexAttribPointer(tc_location, 2, GL_FLOAT, GL_FALSE, 0, verts); 244 glVertexAttribPointer(tc_location, 2, GL_FLOAT, GL_FALSE, 0, verts);
245 245
246 // We are getting called on a thread. Release the context so that it can be 246 // We are getting called on a thread. Release the context so that it can be
247 // made current on the main thread. 247 // made current on the main thread.
248 glXMakeCurrent(display_, 0, NULL); 248 glXMakeCurrent(display_, 0, NULL);
249 } 249 }
OLDNEW
« no previous file with comments | « gpu/tools/compositor_model_bench/compositor_model_bench.cc ('k') | ui/compositor/test/test_suite.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698