summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChia-I Wu <olvaffe@gmail.com>2010-10-13 10:16:36 -0400
committerChia-I Wu <olvaffe@gmail.com>2010-12-09 20:01:35 -0500
commit07a8209c3f9aad96a71a258b9fa029f286cee74e (patch)
tree88b14f6d9c12cfc074a0c55d117dbbd4e17acb6c
parentb0a79b3512dd3e142bc5d2fcd5fac7438997c49f (diff)
android: Add __DRI_IMAGE_FORMAT_RGBA8888_REV.
-rw-r--r--include/GL/internal/dri_interface.h1
-rw-r--r--src/egl/drivers/android/droid_image.c2
-rw-r--r--src/mesa/drivers/dri/i915/i915_texstate.c2
-rw-r--r--src/mesa/drivers/dri/intel/intel_screen.c10
4 files changed, 15 insertions, 0 deletions
diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h
index 9ee039bd90..2c4d906981 100644
--- a/include/GL/internal/dri_interface.h
+++ b/include/GL/internal/dri_interface.h
@@ -788,6 +788,7 @@ struct __DRIdri2ExtensionRec {
#define __DRI_IMAGE_FORMAT_RGB565 0x1001
#define __DRI_IMAGE_FORMAT_XRGB8888 0x1002
#define __DRI_IMAGE_FORMAT_ARGB8888 0x1003
+#define __DRI_IMAGE_FORMAT_RGBA8888_REV 0x1004
#define __DRI_IMAGE_USE_SHARE 0x0001
#define __DRI_IMAGE_USE_SCANOUT 0x0002
diff --git a/src/egl/drivers/android/droid_image.c b/src/egl/drivers/android/droid_image.c
index 509335bce6..0e69340b7b 100644
--- a/src/egl/drivers/android/droid_image.c
+++ b/src/egl/drivers/android/droid_image.c
@@ -57,6 +57,8 @@ droid_create_image_android_native_buffer(_EGLDisplay *disp,
format = __DRI_IMAGE_FORMAT_RGB565;
break;
case HAL_PIXEL_FORMAT_RGBA_8888:
+ format = __DRI_IMAGE_FORMAT_RGBA8888_REV;
+ break;
case HAL_PIXEL_FORMAT_RGBX_8888:
case HAL_PIXEL_FORMAT_RGB_888:
case HAL_PIXEL_FORMAT_RGBA_5551:
diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c
index c724a21496..bc05a5687c 100644
--- a/src/mesa/drivers/dri/i915/i915_texstate.c
+++ b/src/mesa/drivers/dri/i915/i915_texstate.c
@@ -60,6 +60,8 @@ translate_texture_format(gl_format mesa_format, GLuint internal_format,
return MAPSURF_32BIT | MT_32BIT_ARGB8888;
case MESA_FORMAT_XRGB8888:
return MAPSURF_32BIT | MT_32BIT_XRGB8888;
+ case MESA_FORMAT_RGBA8888_REV:
+ return MAPSURF_32BIT | MT_32BIT_ABGR8888;
case MESA_FORMAT_YCBCR_REV:
return (MAPSURF_422 | MT_422_YCRCB_NORMAL);
case MESA_FORMAT_YCBCR:
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index 3f13589a21..e5b6c9f0e4 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -151,6 +151,11 @@ intel_create_image_from_name(__DRIscreen *screen,
image->internal_format = GL_RGBA;
image->data_type = GL_UNSIGNED_BYTE;
break;
+ case __DRI_IMAGE_FORMAT_RGBA8888_REV:
+ image->format = MESA_FORMAT_RGBA8888_REV;
+ image->internal_format = GL_RGBA;
+ image->data_type = GL_UNSIGNED_BYTE;
+ break;
default:
free(image);
return NULL;
@@ -237,6 +242,11 @@ intel_create_image(__DRIscreen *screen,
image->internal_format = GL_RGBA;
image->data_type = GL_UNSIGNED_BYTE;
break;
+ case __DRI_IMAGE_FORMAT_RGBA8888_REV:
+ image->format = MESA_FORMAT_RGBA8888_REV;
+ image->internal_format = GL_RGBA;
+ image->data_type = GL_UNSIGNED_BYTE;
+ break;
default:
free(image);
return NULL;