• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

hardware/intel/libva


Commit MetaInfo

修订版8428600c94857d53ba83da174215cd589c0fbda0 (tree)
时间2010-07-07 15:53:15
作者Gwenole Beauchesne <gbeauchesne@spli...>
CommiterXiang, Haihao

Log Message

Call GLX Pixmap related functions through the vtable.

更改概述

差异

--- a/va/glx/va_glx_impl.c
+++ b/va/glx/va_glx_impl.c
@@ -222,6 +222,14 @@ static int load_tfp_extensions(VADriverContextP ctx)
222222 {
223223 VAOpenGLVTableP pOpenGLVTable = gl_get_vtable(ctx);
224224
225+ pOpenGLVTable->glx_create_pixmap = (PFNGLXCREATEPIXMAPPROC)
226+ get_proc_address("glXCreatePixmap");
227+ if (!pOpenGLVTable->glx_create_pixmap)
228+ return 0;
229+ pOpenGLVTable->glx_destroy_pixmap = (PFNGLXDESTROYPIXMAPPROC)
230+ get_proc_address("glXDestroyPixmap");
231+ if (!pOpenGLVTable->glx_destroy_pixmap)
232+ return 0;
225233 pOpenGLVTable->glx_bind_tex_image = (PFNGLXBINDTEXIMAGEEXTPROC)
226234 get_proc_address("glXBindTexImageEXT");
227235 if (!pOpenGLVTable->glx_bind_tex_image)
@@ -451,15 +459,16 @@ struct VASurfaceGLX {
451459 // Create Pixmaps for GLX texture-from-pixmap extension
452460 static int create_tfp_surface(VADriverContextP ctx, VASurfaceGLXP pSurfaceGLX)
453461 {
454- const unsigned int width = pSurfaceGLX->width;
455- const unsigned int height = pSurfaceGLX->height;
456- Pixmap pixmap = None;
457- GLXFBConfig *fbconfig = NULL;
458- GLXPixmap glx_pixmap = None;
459- Window root_window;
460- XWindowAttributes wattr;
461- int *attrib;
462- int n_fbconfig_attrs;
462+ VAOpenGLVTableP const pOpenGLVTable = gl_get_vtable(ctx);
463+ const unsigned int width = pSurfaceGLX->width;
464+ const unsigned int height = pSurfaceGLX->height;
465+ Pixmap pixmap = None;
466+ GLXFBConfig *fbconfig = NULL;
467+ GLXPixmap glx_pixmap = None;
468+ Window root_window;
469+ XWindowAttributes wattr;
470+ int *attrib;
471+ int n_fbconfig_attrs;
463472
464473 root_window = RootWindow((Display *)ctx->native_dpy, ctx->x11_screen);
465474 XGetWindowAttributes((Display *)ctx->native_dpy, root_window, &wattr);
@@ -523,7 +532,7 @@ static int create_tfp_surface(VADriverContextP ctx, VASurfaceGLXP pSurfaceGLX)
523532 *attrib++ = GL_NONE;
524533
525534 x11_trap_errors();
526- glx_pixmap = glXCreatePixmap(
535+ glx_pixmap = pOpenGLVTable->glx_create_pixmap(
527536 (Display *)ctx->native_dpy,
528537 fbconfig[0],
529538 pixmap,
@@ -544,13 +553,15 @@ static int create_tfp_surface(VADriverContextP ctx, VASurfaceGLXP pSurfaceGLX)
544553 // Destroy Pixmaps used for TFP
545554 static void destroy_tfp_surface(VADriverContextP ctx, VASurfaceGLXP pSurfaceGLX)
546555 {
556+ VAOpenGLVTableP const pOpenGLVTable = gl_get_vtable(ctx);
557+
547558 if (pSurfaceGLX->pix_texture) {
548559 glDeleteTextures(1, &pSurfaceGLX->pix_texture);
549560 pSurfaceGLX->pix_texture = 0;
550561 }
551562
552563 if (pSurfaceGLX->glx_pixmap) {
553- glXDestroyPixmap((Display *)ctx->native_dpy, pSurfaceGLX->glx_pixmap);
564+ pOpenGLVTable->glx_destroy_pixmap((Display *)ctx->native_dpy, pSurfaceGLX->glx_pixmap);
554565 pSurfaceGLX->glx_pixmap = None;
555566 }
556567
--- a/va/glx/va_glx_private.h
+++ b/va/glx/va_glx_private.h
@@ -31,15 +31,25 @@
3131 #include "va_x11.h"
3232 #include "va_glx.h"
3333 #include "va_backend_glx.h"
34+#include <GL/glxext.h>
3435
3536 #if GLX_GLXEXT_VERSION < 18
3637 typedef void (*PFNGLXBINDTEXIMAGEEXTPROC)(Display *, GLXDrawable, int, const int *);
3738 typedef void (*PFNGLXRELEASETEXIMAGEEXTPROC)(Display *, GLXDrawable, int);
3839 #endif
3940
41+#if GLX_GLXEXT_VERSION < 27
42+/* XXX: this is not exactly that version but this is the only means to
43+ make sure we have the correct <GL/glx.h> with those signatures */
44+typedef GLXPixmap (*PFNGLXCREATEPIXMAPPROC)(Display *, GLXFBConfig, Pixmap, const int *);
45+typedef void (*PFNGLXDESTROYPIXMAPPROC)(Display *, GLXPixmap);
46+#endif
47+
4048 typedef struct VAOpenGLVTable *VAOpenGLVTableP;
4149
4250 struct VAOpenGLVTable {
51+ PFNGLXCREATEPIXMAPPROC glx_create_pixmap;
52+ PFNGLXDESTROYPIXMAPPROC glx_destroy_pixmap;
4353 PFNGLXBINDTEXIMAGEEXTPROC glx_bind_tex_image;
4454 PFNGLXRELEASETEXIMAGEEXTPROC glx_release_tex_image;
4555 PFNGLGENFRAMEBUFFERSEXTPROC gl_gen_framebuffers;