diff options
author | Brian Paul <[email protected]> | 2013-11-07 19:47:13 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2013-11-11 08:17:46 -0700 |
commit | ab2da985b67704ac556da591e227b41f3a2e1419 (patch) | |
tree | 9af19e68dae3d9f0f2419cc99cbf6750ea3533c6 /src/mesa/drivers/osmesa/osmesa.c | |
parent | a66a008b17872f3eab91b7d04dd70e4537bdb627 (diff) |
osmesa: assorted code clean-ups
Diffstat (limited to 'src/mesa/drivers/osmesa/osmesa.c')
-rw-r--r-- | src/mesa/drivers/osmesa/osmesa.c | 63 |
1 files changed, 38 insertions, 25 deletions
diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index 6f6f824b462..97cd41c6031 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -205,26 +205,31 @@ osmesa_choose_line_function( struct gl_context *ctx ) return NULL; } - if (ctx->RenderMode != GL_RENDER) return NULL; - if (ctx->Line.SmoothFlag) return NULL; - if (ctx->Texture._EnabledUnits) return NULL; - if (ctx->Light.ShadeModel != GL_FLAT) return NULL; - if (ctx->Line.Width != 1.0F) return NULL; - if (ctx->Line.StippleFlag) return NULL; - if (ctx->Line.SmoothFlag) return NULL; + if (ctx->RenderMode != GL_RENDER || + ctx->Line.SmoothFlag || + ctx->Texture._EnabledUnits || + ctx->Light.ShadeModel != GL_FLAT || + ctx->Line.Width != 1.0F || + ctx->Line.StippleFlag || + ctx->Line.SmoothFlag) { + return NULL; + } + if (osmesa->format != OSMESA_RGBA && osmesa->format != OSMESA_BGRA && - osmesa->format != OSMESA_ARGB) return NULL; + osmesa->format != OSMESA_ARGB) { + return NULL; + } - if (swrast->_RasterMask==DEPTH_BIT - && ctx->Depth.Func==GL_LESS - && ctx->Depth.Mask==GL_TRUE + if (swrast->_RasterMask == DEPTH_BIT + && ctx->Depth.Func == GL_LESS + && ctx->Depth.Mask == GL_TRUE && ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS) { - return (swrast_line_func) flat_rgba_z_line; + return flat_rgba_z_line; } if (swrast->_RasterMask == 0) { - return (swrast_line_func) flat_rgba_line; + return flat_rgba_line; } return (swrast_line_func) NULL; @@ -311,32 +316,40 @@ osmesa_choose_triangle_function( struct gl_context *ctx ) /* the special-case triangle functions in this file don't work * for float color channels. */ - return (swrast_tri_func) NULL; + return NULL; + } + + if (ctx->RenderMode != GL_RENDER || + ctx->Polygon.SmoothFlag || + ctx->Polygon.StippleFlag || + ctx->Texture._EnabledUnits) { + return NULL; } - if (ctx->RenderMode != GL_RENDER) return (swrast_tri_func) NULL; - if (ctx->Polygon.SmoothFlag) return (swrast_tri_func) NULL; - if (ctx->Polygon.StippleFlag) return (swrast_tri_func) NULL; - if (ctx->Texture._EnabledUnits) return (swrast_tri_func) NULL; if (osmesa->format != OSMESA_RGBA && osmesa->format != OSMESA_BGRA && - osmesa->format != OSMESA_ARGB) return (swrast_tri_func) NULL; - if (ctx->Polygon.CullFlag && - ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK) - return (swrast_tri_func) NULL; + osmesa->format != OSMESA_ARGB) { + return NULL; + } + + if (ctx->Polygon.CullFlag && + ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK) { + return NULL; + } if (swrast->_RasterMask == DEPTH_BIT && ctx->Depth.Func == GL_LESS && ctx->Depth.Mask == GL_TRUE && ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS) { if (ctx->Light.ShadeModel == GL_SMOOTH) { - return (swrast_tri_func) smooth_rgba_z_triangle; + return smooth_rgba_z_triangle; } else { - return (swrast_tri_func) flat_rgba_z_triangle; + return flat_rgba_z_triangle; } } - return (swrast_tri_func) NULL; + + return NULL; } |