Mesa (master): intel: Implement DRIimageExtension::dupImage

Benjamin Franzke bnf at kemper.freedesktop.org
Thu Jun 23 19:07:59 UTC 2011


Module: Mesa
Branch: master
Commit: 3af3c58dfd8b1ddc96fc10b6865de0cb26860dde
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3af3c58dfd8b1ddc96fc10b6865de0cb26860dde

Author: Benjamin Franzke <benjaminfranzke at googlemail.com>
Date:   Wed Mar  9 20:56:02 2011 +0100

intel: Implement DRIimageExtension::dupImage

---

 src/mesa/drivers/dri/intel/intel_screen.c |   27 ++++++++++++++++++++++++++-
 1 files changed, 26 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index e915ca0..2a3a601 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -282,13 +282,38 @@ intel_query_image(__DRIimage *image, int attrib, int *value)
    }
 }
 
+static __DRIimage *
+intel_dup_image(__DRIimage *orig_image, void *loaderPrivate)
+{
+   __DRIimage *image;
+
+   image = CALLOC(sizeof *image);
+   if (image == NULL)
+      return NULL;
+
+   image->region = NULL;
+   intel_region_reference(&image->region, orig_image->region);
+   if (image->region == NULL) {
+      FREE(image);
+      return NULL;
+   }
+
+   image->internal_format = orig_image->internal_format;
+   image->format          = orig_image->format;
+   image->data_type       = orig_image->data_type;
+   image->data            = loaderPrivate;
+   
+   return image;
+}
+
 static struct __DRIimageExtensionRec intelImageExtension = {
     { __DRI_IMAGE, __DRI_IMAGE_VERSION },
     intel_create_image_from_name,
     intel_create_image_from_renderbuffer,
     intel_destroy_image,
     intel_create_image,
-    intel_query_image
+    intel_query_image,
+    intel_dup_image
 };
 
 static const __DRIextension *intelScreenExtensions[] = {




More information about the mesa-commit mailing list