diff options
author | Eric Anholt <eric@anholt.net> | 2014-02-28 13:02:01 -0500 |
---|---|---|
committer | Zhigang Gong <zhigang.gong@gmail.com> | 2014-03-13 21:52:17 +0800 |
commit | 553a1367ab5c2b70907634674117a8f9078f1912 (patch) | |
tree | 81b3e9cfc5ced50c3a0e206505c4af8bf48115be | |
parent | b68223a660aa9bcb8b86411dec21d4b99b0bdbbb (diff) |
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.
Pulled from Eric's glamor xserver tree.
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | src/glamor_priv.h | 4 | ||||
-rw-r--r-- | 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, |