From: Chia-I Wu Date: Sat, 30 Jul 2011 01:45:20 +0000 (+0900) Subject: st/egl: use HAL formats for Android backend X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8ccafbbbcc797dc15daed883b09250165ab980b3;p=mesa.git st/egl: use HAL formats for Android backend Native buffers use HAL formats, not UI formats. --- diff --git a/src/gallium/state_trackers/egl/android/native_android.cpp b/src/gallium/state_trackers/egl/android/native_android.cpp index 5c4584b2780..a6e0d254ef2 100644 --- a/src/gallium/state_trackers/egl/android/native_android.cpp +++ b/src/gallium/state_trackers/egl/android/native_android.cpp @@ -27,7 +27,7 @@ #define LOG_TAG "MESA-EGL" #include #include -#include +#include #include extern "C" { @@ -97,36 +97,26 @@ get_pipe_format(int native) { enum pipe_format fmt; - /* see libpixelflinger/format.cpp */ switch (native) { - case PIXEL_FORMAT_RGBA_8888: + case HAL_PIXEL_FORMAT_RGBA_8888: fmt = PIPE_FORMAT_R8G8B8A8_UNORM; break; - case PIXEL_FORMAT_RGBX_8888: + case HAL_PIXEL_FORMAT_RGBX_8888: fmt = PIPE_FORMAT_R8G8B8X8_UNORM; break; - case PIXEL_FORMAT_RGB_888: + case HAL_PIXEL_FORMAT_RGB_888: fmt = PIPE_FORMAT_R8G8B8_UNORM; break; - case PIXEL_FORMAT_RGB_565: + case HAL_PIXEL_FORMAT_RGB_565: fmt = PIPE_FORMAT_B5G6R5_UNORM; break; - case PIXEL_FORMAT_BGRA_8888: + case HAL_PIXEL_FORMAT_BGRA_8888: fmt = PIPE_FORMAT_B8G8R8A8_UNORM; break; - case PIXEL_FORMAT_A_8: - fmt = PIPE_FORMAT_A8_UNORM; - break; - case PIXEL_FORMAT_L_8: - fmt = PIPE_FORMAT_L8_UNORM; - break; - case PIXEL_FORMAT_LA_88: - fmt = PIPE_FORMAT_L8A8_UNORM; - break; - case PIXEL_FORMAT_NONE: - case PIXEL_FORMAT_RGBA_5551: - case PIXEL_FORMAT_RGBA_4444: - case PIXEL_FORMAT_RGB_332: + case HAL_PIXEL_FORMAT_RGBA_5551: + /* fmt = PIPE_FORMAT_A1B5G5R5_UNORM; */ + case HAL_PIXEL_FORMAT_RGBA_4444: + /* fmt = PIPE_FORMAT_A4B4G4R4_UNORM; */ default: LOGE("unsupported native format 0x%x", native); fmt = PIPE_FORMAT_NONE; @@ -443,12 +433,11 @@ android_display_init_configs(struct native_display *ndpy) { struct android_display *adpy = android_display(ndpy); const int native_formats[] = { - PIXEL_FORMAT_RGBA_8888, - PIXEL_FORMAT_RGBX_8888, - PIXEL_FORMAT_RGB_888, - PIXEL_FORMAT_RGB_565, - PIXEL_FORMAT_BGRA_8888, - PIXEL_FORMAT_A_8 + HAL_PIXEL_FORMAT_RGBA_8888, + HAL_PIXEL_FORMAT_RGBX_8888, + HAL_PIXEL_FORMAT_RGB_888, + HAL_PIXEL_FORMAT_RGB_565, + HAL_PIXEL_FORMAT_BGRA_8888, }; int i;