From 9650483acded249d766441dd37db5af9b9b1e245 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Sun, 31 Jul 2011 12:08:24 +0900 Subject: [PATCH] winsys/sw/android: use HAL formats Native buffers use HAL formats, not UI formats. --- .../winsys/sw/android/android_sw_winsys.cpp | 27 +++++++------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/src/gallium/winsys/sw/android/android_sw_winsys.cpp b/src/gallium/winsys/sw/android/android_sw_winsys.cpp index 6ea48b25c39..02faf1e0cca 100644 --- a/src/gallium/winsys/sw/android/android_sw_winsys.cpp +++ b/src/gallium/winsys/sw/android/android_sw_winsys.cpp @@ -32,8 +32,9 @@ #include "util/u_format.h" #include "state_tracker/sw_winsys.h" -#include +#include #include + #include #include "android_sw_winsys.h" @@ -183,39 +184,29 @@ android_is_displaytarget_format_supported(struct sw_winsys *ws, enum pipe_format format) { struct android_sw_winsys *droid = android_sw_winsys(ws); - int fmt; + int fmt = -1; switch (format) { case PIPE_FORMAT_R8G8B8A8_UNORM: - fmt = PIXEL_FORMAT_RGBA_8888; + fmt = HAL_PIXEL_FORMAT_RGBA_8888; break; case PIPE_FORMAT_R8G8B8X8_UNORM: - fmt = PIXEL_FORMAT_RGBX_8888; + fmt = HAL_PIXEL_FORMAT_RGBX_8888; break; case PIPE_FORMAT_R8G8B8_UNORM: - fmt = PIXEL_FORMAT_RGB_888; + fmt = HAL_PIXEL_FORMAT_RGB_888; break; case PIPE_FORMAT_B5G6R5_UNORM: - fmt = PIXEL_FORMAT_RGB_565; + fmt = HAL_PIXEL_FORMAT_RGB_565; break; case PIPE_FORMAT_B8G8R8A8_UNORM: - fmt = PIXEL_FORMAT_BGRA_8888; - break; - case PIPE_FORMAT_A8_UNORM: - fmt = PIXEL_FORMAT_A_8; - break; - case PIPE_FORMAT_L8_UNORM: - fmt = PIXEL_FORMAT_L_8; - break; - case PIPE_FORMAT_L8A8_UNORM: - fmt = PIXEL_FORMAT_LA_88; + fmt = HAL_PIXEL_FORMAT_BGRA_8888; break; default: - fmt = PIXEL_FORMAT_NONE; break; } - return (fmt != PIXEL_FORMAT_NONE); + return (fmt != -1); } static void -- 2.30.2