[Mesa-dev] [PATCH v2 2/5 fixed] dri: Add another duplicateImage to DRIimageExtension

John Kåre Alsaker john.kare.alsaker at gmail.com
Sat Mar 2 22:16:26 PST 2013


duplicateImage will allow you to create a linear or sRGB view into a
DRIimage you have access to. This is useful because compositors may want
a specific view which doesn't correspond to the one used by
applications.
---
 include/GL/internal/dri_interface.h | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h
index 42147e9..2921293 100644
--- a/include/GL/internal/dri_interface.h
+++ b/include/GL/internal/dri_interface.h
@@ -938,7 +938,7 @@ struct __DRIdri2ExtensionRec {
  * extensions.
  */
 #define __DRI_IMAGE "DRI_IMAGE"
-#define __DRI_IMAGE_VERSION 6
+#define __DRI_IMAGE_VERSION 7
 
 /**
  * These formats correspond to the similarly named MESA_FORMAT_*
@@ -1009,6 +1009,15 @@ struct __DRIdri2ExtensionRec {
 #define __DRI_IMAGE_COMPONENTS_Y_UV	0x3004
 #define __DRI_IMAGE_COMPONENTS_Y_XUXV	0x3005
 
+/**
+ * Flags for duplicateImage.
+ *
+ * \since 7
+ */
+
+#define __DRI_IMAGE_FLAG_SRGB_VIEW	0x0001
+#define __DRI_IMAGE_FLAG_LINEAR_VIEW	0x0002
+
 
 /**
  * queryImage attributes
@@ -1117,6 +1126,15 @@ struct __DRIimageExtensionRec {
                                          int level,
                                          unsigned *error,
                                          void *loaderPrivate);
+
+   /**
+    * The new __DRIimage will share the raw content with the old one,
+    * but it might have a different format.
+    *
+    * \since 7
+    */
+    __DRIimage *(*duplicateImage)(__DRIscreen *screen, __DRIimage *image,
+                              unsigned int flags, void *loaderPrivate);
 };
 
 
-- 
1.8.1.4



More information about the mesa-dev mailing list