[Glamor] [PATCH 06/34] glamor: Unifdef the cache format indices.
Alex Deucher
alexdeucher at gmail.com
Fri Feb 28 10:02:01 PST 2014
From: Eric Anholt <eric at anholt.net>
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.
Pulled from Eric's glamor xserver tree.
Signed-off-by: Eric Anholt <eric at anholt.net>
Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
---
src/glamor_priv.h | 4 ----
src/glamor_utils.h | 18 ++----------------
2 files changed, 2 insertions(+), 20 deletions(-)
diff --git a/src/glamor_priv.h b/src/glamor_priv.h
index 65a02f4..d02bc43 100644
--- a/src/glamor_priv.h
+++ b/src/glamor_priv.h
@@ -224,11 +224,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/src/glamor_utils.h b/src/glamor_utils.h
index 2fb3744..1ffd728 100644
--- a/src/glamor_utils.h
+++ b/src/glamor_utils.h
@@ -1054,19 +1054,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)
@@ -1235,6 +1222,8 @@ glamor_get_tex_format_type_from_pictformat(PictFormatShort format,
return 0;
}
+#endif
+
inline static int cache_format(GLenum format)
{
switch (format) {
@@ -1249,9 +1238,6 @@ inline static int cache_format(GLenum format)
}
}
-#endif
-
-
static inline int
glamor_get_tex_format_type_from_pixmap(PixmapPtr pixmap,
GLenum * format,
--
1.8.3.1
More information about the Glamor
mailing list