diff options
author | marha <marha@users.sourceforge.net> | 2012-09-27 15:15:06 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-09-27 15:15:06 +0200 |
commit | 24703f26d8ed55b1971aa2e94d33636e871bff0b (patch) | |
tree | 3e57b600f4446a1db1d8e73cb8a83519570eb678 /mesalib/src/mesa/main/enable.c | |
parent | 94ef26cb962261d0b47daf7ef3c856510999bd4c (diff) | |
parent | 2cf1e3de4759264eac2fa8ac758ea750636542f8 (diff) | |
download | vcxsrv-24703f26d8ed55b1971aa2e94d33636e871bff0b.tar.gz vcxsrv-24703f26d8ed55b1971aa2e94d33636e871bff0b.tar.bz2 vcxsrv-24703f26d8ed55b1971aa2e94d33636e871bff0b.zip |
Merge remote-tracking branch 'origin/released'
* origin/released:
mesa xserver pixman xkeyboard-config git update 27 sep 2012
Diffstat (limited to 'mesalib/src/mesa/main/enable.c')
-rw-r--r-- | mesalib/src/mesa/main/enable.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/mesalib/src/mesa/main/enable.c b/mesalib/src/mesa/main/enable.c index 3643cfb52..a607bdc10 100644 --- a/mesalib/src/mesa/main/enable.c +++ b/mesalib/src/mesa/main/enable.c @@ -264,6 +264,23 @@ _mesa_set_multisample(struct gl_context *ctx, GLboolean state) } /** + * Helper function to enable or disable GL_FRAMEBUFFER_SRGB, skipping the + * check for whether the API supports it (GLES doesn't). + */ +void +_mesa_set_framebuffer_srgb(struct gl_context *ctx, GLboolean state) +{ + if (ctx->Color.sRGBEnabled == state) + return; + FLUSH_VERTICES(ctx, _NEW_BUFFERS); + ctx->Color.sRGBEnabled = state; + + if (ctx->Driver.Enable) { + ctx->Driver.Enable(ctx, GL_FRAMEBUFFER_SRGB, state); + } +} + +/** * Helper function to enable or disable state. * * \param ctx GL context. @@ -1044,12 +1061,11 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) /* GL3.0 - GL_framebuffer_sRGB */ case GL_FRAMEBUFFER_SRGB_EXT: - if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx)) + if (!_mesa_is_desktop_gl(ctx)) goto invalid_enum_error; CHECK_EXTENSION(EXT_framebuffer_sRGB, cap); - FLUSH_VERTICES(ctx, _NEW_BUFFERS); - ctx->Color.sRGBEnabled = state; - break; + _mesa_set_framebuffer_srgb(ctx, state); + return; /* GL_OES_EGL_image_external */ case GL_TEXTURE_EXTERNAL_OES: @@ -1699,7 +1715,7 @@ _mesa_IsEnabled( GLenum cap ) /* GL3.0 - GL_framebuffer_sRGB */ case GL_FRAMEBUFFER_SRGB_EXT: - if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx)) + if (!_mesa_is_desktop_gl(ctx)) goto invalid_enum_error; CHECK_EXTENSION(EXT_framebuffer_sRGB); return ctx->Color.sRGBEnabled; |