From 0e4f3414189b1820443b35248e4c9e03f0c2e34e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 27 Dec 2013 02:04:11 -0800 Subject: [PATCH] glamor: Unifdef the cache format indices. We only ask for GL_RGB on desktop GL as far as I can see, but now if GLES2 did happen to ask for GL_RGB it would return a cache index instead of -1. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard Reviewed-by: Adam Jackson --- glamor/glamor_priv.h | 4 ---- glamor/glamor_utils.h | 18 ++---------------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h index a6cdf6458..81b46b6e9 100644 --- a/glamor/glamor_priv.h +++ b/glamor/glamor_priv.h @@ -197,11 +197,7 @@ struct glamor_saved_procs { SetWindowPixmapProcPtr set_window_pixmap; }; -#ifdef GLAMOR_GLES2 #define CACHE_FORMAT_COUNT 3 -#else -#define CACHE_FORMAT_COUNT 2 -#endif #define CACHE_BUCKET_WCOUNT 4 #define CACHE_BUCKET_HCOUNT 4 diff --git a/glamor/glamor_utils.h b/glamor/glamor_utils.h index d2774689a..3de613338 100644 --- a/glamor/glamor_utils.h +++ b/glamor/glamor_utils.h @@ -1020,20 +1020,6 @@ glamor_get_tex_format_type_from_pictformat(PictFormatShort format, return 0; } -/* Currently, we use RGBA to represent all formats. */ -inline static int -cache_format(GLenum format) -{ - switch (format) { - case GL_ALPHA: - return 1; - case GL_RGBA: - return 0; - default: - return -1; - } -} - #else #define IS_LITTLE_ENDIAN (IMAGE_BYTE_ORDER == LSBFirst) @@ -1206,6 +1192,8 @@ glamor_get_tex_format_type_from_pictformat(PictFormatShort format, return 0; } +#endif + inline static int cache_format(GLenum format) { @@ -1221,8 +1209,6 @@ cache_format(GLenum format) } } -#endif - static inline int glamor_get_tex_format_type_from_pixmap(PixmapPtr pixmap, GLenum * format,