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>2011-03-16 20:18:39 +0800
commit73d3113849fa457b0ad36f612c1841d7629caeb9 (patch)
tree2c24e1772bf6b80ac3b34eb98ff1ca3151b58c1d
parent2b1f1af17f8e8f199cb0dd4f7f1a225529b357c5 (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 2fb729afcd..ecd4a90ded 100644
--- a/include/GL/internal/dri_interface.h
+++ b/include/GL/internal/dri_interface.h
@@ -813,6 +813,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 af140c85f5..442adbb63c 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 64a21a147f..c8cff0147e 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -152,6 +152,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;
@@ -238,6 +243,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;