[Mesa-dev,v3,2/5] dri: Add another duplicateImage to DRIimageExtension

Submitted by John Kåre Alsaker on April 26, 2014, 2:25 p.m.

Details

Message ID 1398522355-29770-2-git-send-email-john.kare.alsaker@gmail.com
State New
Headers show

Not browsing as part of any series.

Commit Message

John Kåre Alsaker April 26, 2014, 2:25 p.m.
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(-)

Patch hide | download patch | download mbox

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