meta: use _mesa_set_enable() in more places
authorBrian Paul <brianp@vmware.com>
Tue, 20 Sep 2011 17:55:58 +0000 (11:55 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 21 Sep 2011 02:17:42 +0000 (20:17 -0600)
Avoids an extra context lookup.

Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/common/meta.c

index be1953ab2f9524564904418909bc2405b244d385..9703475d031b6de145c0f1a8e3e1bbff3cbcd34d 100644 (file)
@@ -1223,7 +1223,7 @@ blitframebuffer_texture(struct gl_context *ctx,
                                GL_SKIP_DECODE_EXT);
         }
          if (ctx->Extensions.EXT_framebuffer_sRGB) {
-            _mesa_Disable(GL_FRAMEBUFFER_SRGB_EXT);
+            _mesa_set_enable(ctx, GL_FRAMEBUFFER_SRGB_EXT, GL_FALSE);
          }
 
          _mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
@@ -1291,7 +1291,7 @@ blitframebuffer_texture(struct gl_context *ctx,
            _mesa_TexParameteri(target, GL_TEXTURE_SRGB_DECODE_EXT, srgbSave);
         }
         if (ctx->Extensions.EXT_framebuffer_sRGB && fbo_srgb_save) {
-           _mesa_Enable(GL_FRAMEBUFFER_SRGB_EXT);
+           _mesa_set_enable(ctx, GL_FRAMEBUFFER_SRGB_EXT, GL_TRUE);
         }
 
          /* Done with color buffer */
@@ -2748,7 +2748,7 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,
                           GL_SKIP_DECODE_EXT);
    }
    if (ctx->Extensions.EXT_framebuffer_sRGB) {
-      _mesa_Disable(GL_FRAMEBUFFER_SRGB_EXT);
+      _mesa_set_enable(ctx, GL_FRAMEBUFFER_SRGB_EXT, GL_FALSE);
    }
 
    _mesa_set_enable(ctx, target, GL_TRUE);
@@ -2900,7 +2900,7 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,
                           srgbDecodeSave);
    }
    if (ctx->Extensions.EXT_framebuffer_sRGB && srgbBufferSave) {
-      _mesa_Enable(GL_FRAMEBUFFER_SRGB_EXT);
+      _mesa_set_enable(ctx, GL_FRAMEBUFFER_SRGB_EXT, GL_TRUE);
    }
 
    _mesa_lock_texture(ctx, texObj); /* relock */
@@ -3207,7 +3207,7 @@ decompress_texture_image(struct gl_context *ctx,
                              GL_SKIP_DECODE_EXT);
       }
       if (ctx->Extensions.EXT_framebuffer_sRGB) {
-         _mesa_Disable(GL_FRAMEBUFFER_SRGB_EXT);
+         _mesa_set_enable(ctx, GL_FRAMEBUFFER_SRGB_EXT, GL_FALSE);
       }
 
       /* render quad w/ texture into renderbuffer */