[PATCH 07/15] glamor: Unifdef the cache format indices.

Eric Anholt eric at anholt.net
Mon Feb 3 11:03:32 PST 2014


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 <eric at anholt.net>
---
 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 a6cdf64..81b46b6 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 29f1586..581f8b9 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,
-- 
1.9.rc1



More information about the xorg-devel mailing list