[Mesa-dev] [PATCH 1/5] dri2: add createImageFromName2() hook.

Gwenole Beauchesne gb.devel at gmail.com
Mon Apr 23 02:54:11 PDT 2012


Add a new createImageFromName2() hook with image attributes struct
so that to reduce the number of arguments passed to the function.
---
 include/GL/internal/dri_interface.h |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h
index da83666..d488ea8 100644
--- a/include/GL/internal/dri_interface.h
+++ b/include/GL/internal/dri_interface.h
@@ -921,7 +921,16 @@ struct __DRIdri2ExtensionRec {
 #define __DRI_IMAGE_ATTRIB_FORMAT	0x2003 /* available in versions 3+ */
 
 typedef struct __DRIimageRec          __DRIimage;
+typedef struct __DRIimageAttrsRec     __DRIimageAttrs;
 typedef struct __DRIimageExtensionRec __DRIimageExtension;
+
+struct __DRIimageAttrsRec {
+    unsigned int        format;
+    unsigned int        width;
+    unsigned int        height;
+    unsigned int        pitch;
+};
+
 struct __DRIimageExtensionRec {
     __DRIextension base;
 
@@ -954,6 +963,11 @@ struct __DRIimageExtensionRec {
     * \since 2
     */
    GLboolean (*validateUsage)(__DRIimage *image, unsigned int use);
+
+    __DRIimage *(*createImageFromName2)(__DRIscreen *screen,
+                                        int name,
+                                        const __DRIimageAttrs *attrs,
+                                        void *loaderPrivate);
 };
 
 
-- 
1.7.5.4



More information about the mesa-dev mailing list