path: root/src/opengl/qglextensions_p.h
diff options
authorEskil Abrahamsen Blomfeldt <>2011-05-03 15:06:13 +0200
committerEskil Abrahamsen Blomfeldt <>2011-05-03 16:50:01 +0200
commite443d8850105549eb1d72f54d3bf0d3d72cf90c2 (patch)
treee23754ee15ea52b12361e3ac0e5cd160656fb504 /src/opengl/qglextensions_p.h
parentac4af55972291db96cc6bfa322dc7d35b67f7775 (diff)
Support gamma correction of text on GL
If the SRGB framebuffer extension in GL is available, we can support gamma correction of text with a gamma of 2.1. On Mac this is sufficient for gamma correcting subpixel antialiased text. Gray antialiasing should not be gamma corrected on Mac. On Windows, the user can potentially set the gamma value to anything between 1.0 and 2.2 (or something like that). We support anything that resembles 1.0 closely enough by pushing the text out without any correction (like before). We also support anything that resembles 2.1 (the gamma hardcoded in GL's SRGB extension) by turning on the extension before blending the text. In between the two, we'll use gray antialiasing to avoid differing too much from the raster engine (which is our reference in this.) For gray antialiasing on Windows, we use a constant gamma of 2.3 which has been determined by experimentation. Since this is close enough to 2.1 we do gamma correction with SRGB extension. The distance limit of 0.2 is determined by some experimentation. Reviewed-by: Samuel (cherry picked from commit 79ba7cceca5e4029876ace2121edd25b08ae14ce)
Diffstat (limited to 'src/opengl/qglextensions_p.h')
1 files changed, 8 insertions, 0 deletions
diff --git a/src/opengl/qglextensions_p.h b/src/opengl/qglextensions_p.h
index 529c7a1b4e..ac80ce8b96 100644
--- a/src/opengl/qglextensions_p.h
+++ b/src/opengl/qglextensions_p.h
@@ -477,6 +477,14 @@ struct QGLExtensionFuncs
// OpenGL constants
#define GL_ARRAY_BUFFER 0x8892