diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2010-02-24 16:51:40 -0800 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2010-03-03 12:37:04 -0800 |
commit | 6f317253bf987f6e9788eb913a587d1373192f1c (patch) | |
tree | 683e349af794e3a1c7c8a4926207ea93c8b7e6a3 /src | |
parent | 718ff7e87bf9b86517e88270cc984e364ace9506 (diff) | |
download | external_mesa3d-6f317253bf987f6e9788eb913a587d1373192f1c.zip external_mesa3d-6f317253bf987f6e9788eb913a587d1373192f1c.tar.gz external_mesa3d-6f317253bf987f6e9788eb913a587d1373192f1c.tar.bz2 |
fbdev: Remove support for color-index rendering
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/fbdev/glfbdev.c | 122 |
1 files changed, 36 insertions, 86 deletions
diff --git a/src/mesa/drivers/fbdev/glfbdev.c b/src/mesa/drivers/fbdev/glfbdev.c index 4e369ce..e6ece69 100644 --- a/src/mesa/drivers/fbdev/glfbdev.c +++ b/src/mesa/drivers/fbdev/glfbdev.c @@ -70,7 +70,6 @@ #define PF_B8G8R8A8 2 #define PF_B5G6R5 3 #define PF_B5G5R5 4 -#define PF_CI8 5 /** @@ -264,25 +263,6 @@ viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h) #include "swrast/s_spantemp.h" -/* 8-bit color index */ -#define NAME(PREFIX) PREFIX##_CI8 -#define CI_MODE -#define RB_TYPE GLubyte -#define SPAN_VARS \ - struct GLFBDevRenderbufferRec *frb = (struct GLFBDevRenderbufferRec *) rb; -#define INIT_PIXEL_PTR(P, X, Y) \ - GLubyte *P = frb->bottom - (Y) * frb->rowStride + (X) -#define INC_PIXEL_PTR(P) P += 1 -#define STORE_PIXEL(DST, X, Y, VALUE) \ - *DST = VALUE[0] -#define FETCH_PIXEL(DST, SRC) \ - DST = SRC[0] - -#include "swrast/s_spantemp.h" - - - - /**********************************************************************/ /* Public API functions */ /**********************************************************************/ @@ -345,7 +325,7 @@ glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo, { GLFBDevVisualPtr vis; const int *attrib; - GLboolean rgbFlag = GL_TRUE, dbFlag = GL_FALSE, stereoFlag = GL_FALSE; + GLboolean dbFlag = GL_FALSE, stereoFlag = GL_FALSE; GLint redBits = 0, greenBits = 0, blueBits = 0, alphaBits = 0; GLint indexBits = 0, depthBits = 0, stencilBits = 0; GLint accumRedBits = 0, accumGreenBits = 0; @@ -367,9 +347,6 @@ glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo, case GLFBDEV_DOUBLE_BUFFER: dbFlag = GL_TRUE; break; - case GLFBDEV_COLOR_INDEX: - rgbFlag = GL_FALSE; - break; case GLFBDEV_DEPTH_SIZE: depthBits = attrib[1]; attrib++; @@ -390,6 +367,8 @@ glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo, numSamples = attrib[1]; attrib++; break; + case GLFBDEV_COLOR_INDEX: + /* Mesa no longer supports color-index rendering. */ default: /* unexpected token */ free(vis); @@ -397,60 +376,45 @@ glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo, } } - if (rgbFlag) { - redBits = varInfo->red.length; - greenBits = varInfo->green.length; - blueBits = varInfo->blue.length; - alphaBits = varInfo->transp.length; - - if (fixInfo->visual == FB_VISUAL_TRUECOLOR || - fixInfo->visual == FB_VISUAL_DIRECTCOLOR) { - if (varInfo->bits_per_pixel == 24 - && varInfo->red.offset == 16 - && varInfo->green.offset == 8 - && varInfo->blue.offset == 0) { - vis->pixelFormat = PF_B8G8R8; - } - else if (varInfo->bits_per_pixel == 32 - && varInfo->red.offset == 16 - && varInfo->green.offset == 8 - && varInfo->blue.offset == 0) { - vis->pixelFormat = PF_B8G8R8A8; - } - else if (varInfo->bits_per_pixel == 16 - && varInfo->red.offset == 11 - && varInfo->green.offset == 5 - && varInfo->blue.offset == 0) { - vis->pixelFormat = PF_B5G6R5; - } - else if (varInfo->bits_per_pixel == 16 - && varInfo->red.offset == 10 - && varInfo->green.offset == 5 - && varInfo->blue.offset == 0) { - vis->pixelFormat = PF_B5G5R5; - } - else { - _mesa_problem(NULL, "Unsupported fbdev RGB visual/bitdepth!\n"); - free(vis); - return NULL; - } + redBits = varInfo->red.length; + greenBits = varInfo->green.length; + blueBits = varInfo->blue.length; + alphaBits = varInfo->transp.length; + + if (fixInfo->visual == FB_VISUAL_TRUECOLOR || + fixInfo->visual == FB_VISUAL_DIRECTCOLOR) { + if (varInfo->bits_per_pixel == 24 + && varInfo->red.offset == 16 + && varInfo->green.offset == 8 + && varInfo->blue.offset == 0) { + vis->pixelFormat = PF_B8G8R8; } - } - else { - indexBits = varInfo->bits_per_pixel; - if ((fixInfo->visual == FB_VISUAL_PSEUDOCOLOR || - fixInfo->visual == FB_VISUAL_STATIC_PSEUDOCOLOR) - && varInfo->bits_per_pixel == 8) { - vis->pixelFormat = PF_CI8; + else if (varInfo->bits_per_pixel == 32 + && varInfo->red.offset == 16 + && varInfo->green.offset == 8 + && varInfo->blue.offset == 0) { + vis->pixelFormat = PF_B8G8R8A8; + } + else if (varInfo->bits_per_pixel == 16 + && varInfo->red.offset == 11 + && varInfo->green.offset == 5 + && varInfo->blue.offset == 0) { + vis->pixelFormat = PF_B5G6R5; + } + else if (varInfo->bits_per_pixel == 16 + && varInfo->red.offset == 10 + && varInfo->green.offset == 5 + && varInfo->blue.offset == 0) { + vis->pixelFormat = PF_B5G5R5; } else { - _mesa_problem(NULL, "Unsupported fbdev CI visual/bitdepth!\n"); + _mesa_problem(NULL, "Unsupported fbdev RGB visual/bitdepth!\n"); free(vis); return NULL; } } - if (!_mesa_initialize_visual(&vis->glvisual, rgbFlag, dbFlag, stereoFlag, + if (!_mesa_initialize_visual(&vis->glvisual, GL_TRUE, dbFlag, stereoFlag, redBits, greenBits, blueBits, alphaBits, indexBits, depthBits, stencilBits, accumRedBits, accumGreenBits, @@ -554,23 +518,9 @@ new_glfbdev_renderbuffer(void *bufferStart, const GLFBDevVisualPtr visual) rb->Base.PutValues = put_values_B5G5R5; rb->Base.PutMonoValues = put_mono_values_B5G5R5; } - else if (pixelFormat == PF_CI8) { - rb->Base.GetRow = get_row_CI8; - rb->Base.GetValues = get_values_CI8; - rb->Base.PutRow = put_row_CI8; - rb->Base.PutMonoRow = put_mono_row_CI8; - rb->Base.PutValues = put_values_CI8; - rb->Base.PutMonoValues = put_mono_values_CI8; - } - if (pixelFormat == PF_CI8) { - rb->Base.InternalFormat = GL_COLOR_INDEX8_EXT; - rb->Base._BaseFormat = GL_COLOR_INDEX; - } - else { - rb->Base.InternalFormat = GL_RGBA; - rb->Base._BaseFormat = GL_RGBA; - } + rb->Base.InternalFormat = GL_RGBA; + rb->Base._BaseFormat = GL_RGBA; rb->Base.DataType = GL_UNSIGNED_BYTE; rb->Base.Data = bufferStart; |