mesa: remove unneeded #include of colormac.h
[mesa.git] / src / mesa / main / blend.c
index eb4f1d6bef23f9337c6951f894bf6ec4d3f7d8ea..774fc888ec41ff5d7b31bdeaae984fc3b5f7e4c5 100644 (file)
@@ -799,7 +799,7 @@ get_clamp_color(const struct gl_framebuffer *fb, GLenum clamp)
    if (clamp == GL_TRUE || clamp == GL_FALSE)
       return clamp;
 
-   ASSERT(clamp == GL_FIXED_ONLY);
+   assert(clamp == GL_FIXED_ONLY);
    if (!fb)
       return GL_TRUE;
 
@@ -896,7 +896,7 @@ void _mesa_init_color( struct gl_context * ctx )
    ctx->Color.AlphaFunc = GL_ALWAYS;
    ctx->Color.AlphaRef = 0;
    ctx->Color.BlendEnabled = 0x0;
-   for (i = 0; i < Elements(ctx->Color.Blend); i++) {
+   for (i = 0; i < ARRAY_SIZE(ctx->Color.Blend); i++) {
       ctx->Color.Blend[i].SrcRGB = GL_ONE;
       ctx->Color.Blend[i].DstRGB = GL_ZERO;
       ctx->Color.Blend[i].SrcA = GL_ONE;
@@ -911,7 +911,9 @@ void _mesa_init_color( struct gl_context * ctx )
    ctx->Color.LogicOp = GL_COPY;
    ctx->Color.DitherFlag = GL_TRUE;
 
-   if (ctx->Visual.doubleBufferMode) {
+   /* GL_FRONT is not possible on GLES. Instead GL_BACK will render to either
+    * the front or the back buffer depending on the config */
+   if (ctx->Visual.doubleBufferMode || _mesa_is_gles(ctx)) {
       ctx->Color.DrawBuffer[0] = GL_BACK;
    }
    else {