glamor_gl: Use GL_ALPHA for depth 8 pixmap.

Use GL_RGBA to represent a8 pixmap is not efficient.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
This commit is contained in:
Zhigang Gong 2012-04-13 13:47:05 +08:00 committed by Eric Anholt
parent 428f2a3f58
commit 18d69fb014
2 changed files with 4 additions and 2 deletions

View File

@ -185,7 +185,7 @@ struct glamor_saved_procs {
#ifdef GLAMOR_GLES2 #ifdef GLAMOR_GLES2
#define CACHE_FORMAT_COUNT 3 #define CACHE_FORMAT_COUNT 3
#else #else
#define CACHE_FORMAT_COUNT 1 #define CACHE_FORMAT_COUNT 2
#endif #endif
#define CACHE_BUCKET_WCOUNT 4 #define CACHE_BUCKET_WCOUNT 4

View File

@ -257,10 +257,10 @@ static inline void
gl_iformat_for_depth(int depth, GLenum * format) gl_iformat_for_depth(int depth, GLenum * format)
{ {
switch (depth) { switch (depth) {
#if 0
case 8: case 8:
*format = GL_ALPHA; *format = GL_ALPHA;
break; break;
#if 0
case 24: case 24:
*format = GL_RGB; *format = GL_RGB;
break; break;
@ -411,6 +411,8 @@ glamor_get_tex_format_type_from_pictformat(PictFormatShort format,
inline static int cache_format(GLenum format) inline static int cache_format(GLenum format)
{ {
switch (format) { switch (format) {
case GL_ALPHA:
return 1;
case GL_RGBA: case GL_RGBA:
return 0; return 0;
default: default: