summaryrefslogtreecommitdiff
path: root/src/egl/drivers/android/droid_intel.c
diff options
context:
space:
mode:
authorChia-I Wu <olvaffe@gmail.com>2009-10-27 16:15:54 +0800
committerChia-I Wu <olvaffe@gmail.com>2009-10-27 17:45:13 +0800
commitf457f7a31c03f218cdcb31108fefb343d6be14a8 (patch)
treea44a14177d08286f192e3ec4f9d1102e405bf44b /src/egl/drivers/android/droid_intel.c
parent11ff6a0e6f18d434ae0f9502ae0711977db6c22e (diff)
egl_android: Decide image config by matching the native pixmap.
Diffstat (limited to 'src/egl/drivers/android/droid_intel.c')
-rw-r--r--src/egl/drivers/android/droid_intel.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/egl/drivers/android/droid_intel.c b/src/egl/drivers/android/droid_intel.c
index 32570b5ae03..3209ff9af73 100644
--- a/src/egl/drivers/android/droid_intel.c
+++ b/src/egl/drivers/android/droid_intel.c
@@ -472,7 +472,7 @@ intel_create_window_surface(struct droid_backend *backend,
static struct droid_surface *
intel_create_image_surface(struct droid_backend *backend,
- NativePixmapType pix, int *depth)
+ NativePixmapType pix)
{
struct droid_surface_intel *isurf;
int cpp;
@@ -490,13 +490,6 @@ intel_create_image_surface(struct droid_backend *backend,
return NULL;
}
- cpp = ui_bytes_per_pixel(pix->format);
- if (cpp * 8 > DROID_MAX_IMAGE_DEPTH) {
- LOGE("pixmap of depth %d is not supported", cpp * 8);
- _eglError(EGL_BAD_NATIVE_PIXMAP, "eglCreateImage");
- return NULL;
- }
-
isurf = calloc(1, sizeof(*isurf));
if (!isurf) {
_eglError(EGL_BAD_ALLOC, "eglCreateWindowSurface");
@@ -508,9 +501,6 @@ intel_create_image_surface(struct droid_backend *backend,
update_native_buffer((struct droid_surface *) isurf);
- if (depth)
- *depth = cpp * 8;
-
return (struct droid_surface *) isurf;
}
@@ -542,6 +532,16 @@ intel_swap_native_buffers(struct droid_backend *backend,
}
static int
+intel_match_pixmap(struct droid_backend *backend, _EGLConfig *conf,
+ NativePixmapType pix)
+{
+ int val;
+ val = GET_CONFIG_ATTRIB(conf, EGL_NATIVE_VISUAL_TYPE);
+ /* match the visual type */
+ return (pix->format == val);
+}
+
+static int
intel_initialize(struct droid_backend *backend, int *fd, int *screen_number)
{
struct droid_backend_intel *intel = lookup_backend(backend);
@@ -638,5 +638,7 @@ droid_backend_create_intel(const char *dev)
intel->base.destroy_surface = intel_destroy_surface;
intel->base.swap_native_buffers = intel_swap_native_buffers;
+ intel->base.match_pixmap = intel_match_pixmap;
+
return &intel->base;
}