Index: /trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_getstring.c
===================================================================
--- /trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_getstring.c	(revision 27395)
+++ /trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_getstring.c	(revision 27396)
@@ -97,5 +97,5 @@
             return GetExtensions();
         case GL_VERSION:
-#ifdef WINDOWS
+#if 0 && defined(WINDOWS)
             if (packspuRunningUnderWine())
             {
Index: /trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_pixel.c
===================================================================
--- /trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_pixel.c	(revision 27395)
+++ /trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_pixel.c	(revision 27396)
@@ -130,4 +130,10 @@
         && internalformat!=GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
         && internalformat!=GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
+# ifdef CR_EXT_texture_sRGB
+        && internalformat!=GL_COMPRESSED_SRGB_S3TC_DXT1_EXT
+        && internalformat!=GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT
+        && internalformat!=GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT
+        && internalformat!=GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT
+# endif
 #endif
         )
Index: /trunk/src/VBox/GuestHost/OpenGL/include/cr_extstring.h
===================================================================
--- /trunk/src/VBox/GuestHost/OpenGL/include/cr_extstring.h	(revision 27395)
+++ /trunk/src/VBox/GuestHost/OpenGL/include/cr_extstring.h	(revision 27396)
@@ -209,5 +209,8 @@
 #endif
 #ifdef CR_ARB_fragment_shader
-    "GL_ARB_fragment_shader"
+    "GL_ARB_fragment_shader "
+#endif
+#ifdef CR_EXT_texture_sRGB
+    "CR_EXT_texture_sRGB "
 #endif
 	"";
Index: /trunk/src/VBox/GuestHost/OpenGL/include/cr_version.h
===================================================================
--- /trunk/src/VBox/GuestHost/OpenGL/include/cr_version.h	(revision 27395)
+++ /trunk/src/VBox/GuestHost/OpenGL/include/cr_version.h	(revision 27396)
@@ -31,7 +31,10 @@
 #define CR_OPENGL_VERSION_1_5 1
 #define CR_OPENGL_VERSION_2_0 1
+#define CR_OPENGL_VERSION_2_1 1
 
 /* Version (string) of OpenGL functionality suported by Chromium */
-#ifdef CR_OPENGL_VERSION_2_0
+#ifdef CR_OPENGL_VERSION_2_1
+# define CR_OPENGL_VERSION_STRING "2.1"
+#elif defined(CR_OPENGL_VERSION_2_0)
 # define CR_OPENGL_VERSION_STRING "2.0"
 #else
@@ -123,4 +126,5 @@
 
 #define CR_ARB_pixel_buffer_object 1
+#define CR_EXT_texture_sRGB 1
 
 #endif /* CR_VERSION_H */
Index: /trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_texture.c
===================================================================
--- /trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_texture.c	(revision 27395)
+++ /trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_texture.c	(revision 27396)
@@ -382,4 +382,9 @@
 	case GL_RGBA:
 	case GL_COMPRESSED_RGBA_ARB:
+#ifdef CR_EXT_texture_sRGB
+    case GL_SRGB_ALPHA_EXT:
+    case GL_SRGB8_ALPHA8_EXT:
+    case GL_COMPRESSED_SRGB_ALPHA_EXT:
+#endif
 		tl->texFormat = &_texformat_rgba8888;
 		break;
@@ -388,4 +393,9 @@
 	case GL_RGB:
 	case GL_COMPRESSED_RGB_ARB:
+#ifdef CR_EXT_texture_sRGB
+    case GL_SRGB_EXT:
+    case GL_SRGB8_EXT:
+    case GL_COMPRESSED_SRGB_EXT:
+#endif
 		tl->texFormat = &_texformat_rgb888;
 		break;
@@ -429,4 +439,9 @@
 	case GL_LUMINANCE16:
 	case GL_COMPRESSED_LUMINANCE_ARB:
+#ifdef CR_EXT_texture_sRGB
+    case GL_SLUMINANCE_EXT:
+    case GL_SLUMINANCE8_EXT:
+    case GL_COMPRESSED_SLUMINANCE_EXT:
+#endif
 		tl->texFormat = &_texformat_l8;
 		break;
@@ -441,4 +456,9 @@
 	case GL_LUMINANCE16_ALPHA16:
 	case GL_COMPRESSED_LUMINANCE_ALPHA_ARB:
+#ifdef CR_EXT_texture_sRGB
+    case GL_SLUMINANCE_ALPHA_EXT:
+    case GL_SLUMINANCE8_ALPHA8_EXT:
+    case GL_COMPRESSED_SLUMINANCE_ALPHA_EXT:
+#endif
 		tl->texFormat = &_texformat_al88;
 		break;
Index: /trunk/src/VBox/GuestHost/OpenGL/util/pixel.c
===================================================================
--- /trunk/src/VBox/GuestHost/OpenGL/util/pixel.c	(revision 27395)
+++ /trunk/src/VBox/GuestHost/OpenGL/util/pixel.c	(revision 27396)
@@ -1,3 +1,3 @@
-/* Copyright (c) 2001, Stanford University
+/* Cop(c) 2001, Stanford University
  * All rights reserved
  *
@@ -10,4 +10,11 @@
 #include "cr_version.h"
 
+#if defined(WINDOWS)
+# include <math.h>
+# include <float.h>
+# define isnan(x) _isnan(x)
+#else
+# include <cmath>
+#endif
 
 /**
@@ -116,6 +123,14 @@
         case GL_LUMINANCE:
         case GL_INTENSITY:
+#ifdef CR_EXT_texture_sRGB
+        case GL_SLUMINANCE_EXT:
+        case GL_SLUMINANCE8_EXT:
+#endif
             break;
         case GL_LUMINANCE_ALPHA:
+#ifdef CR_EXT_texture_sRGB
+        case GL_SLUMINANCE_ALPHA_EXT:
+        case GL_SLUMINANCE8_ALPHA8_EXT:
+#endif
             bytes *= 2;
             break;
@@ -124,4 +139,8 @@
         case GL_BGR:
 #endif
+#ifdef CR_EXT_texture_sRGB
+        case GL_SRGB_EXT:
+        case GL_SRGB8_EXT:
+#endif
             bytes *= 3;
             break;
@@ -133,4 +152,8 @@
         case GL_BGRA:
 #endif
+#ifdef CR_EXT_texture_sRGB
+        case GL_SRGB_ALPHA_EXT:
+        case GL_SRGB8_ALPHA8_EXT:
+#endif
             bytes *= 4;
             break;
@@ -162,4 +185,34 @@
 #define FLOAT_TO_UINT(f)  ((GLuint) ((f) * 4294967295.0))
 
+
+static float SRGBF_TO_RGBF(float f)
+{
+    if (isnan(f)) return 0.f;
+
+    if (f<=0.04045f)
+    {
+        return f/12.92f;
+    }
+    else
+    {
+        return pow((f+0.055f)/1.055f, 2.4f);
+    }
+}
+
+static float RGBF_TO_SRGBF(float f)
+{
+    if (isnan(f)) return 0.f;
+    if (f>1.f) return 1.f;
+    if (f<0.f) return 0.f;
+
+    if (f<0.0031308f)
+    {
+        return f*12.92f;
+    }
+    else
+    {
+        return 1.055f*pow(f, 0.41666f) - 0.055f;
+    }
+}
 
 #ifdef _MSC_VER
@@ -268,5 +321,5 @@
     }
     else if (srcFormat == GL_RED || srcFormat == GL_GREEN ||
-                     srcFormat == GL_BLUE || srcFormat == GL_ALPHA) {
+             srcFormat == GL_BLUE || srcFormat == GL_ALPHA) {
         int dst;
         if (srcFormat == GL_RED)
@@ -321,5 +374,10 @@
         }
     }
-    else if (srcFormat == GL_LUMINANCE) {
+    else if (srcFormat == GL_LUMINANCE 
+#ifdef CR_EXT_texture_sRGB
+             || srcFormat == GL_SLUMINANCE_EXT
+             || srcFormat == GL_SLUMINANCE8_EXT
+#endif
+            ) {
         switch (srcType) {
             case GL_BYTE:
@@ -427,5 +485,10 @@
         }
     }
-    else if (srcFormat == GL_LUMINANCE_ALPHA) {
+    else if (srcFormat == GL_LUMINANCE_ALPHA
+#ifdef CR_EXT_texture_sRGB
+             || srcFormat == GL_SLUMINANCE_ALPHA_EXT
+             || srcFormat == GL_SLUMINANCE8_ALPHA8_EXT
+#endif
+            ) {
         switch (srcType) {
             case GL_BYTE:
@@ -490,9 +553,18 @@
     else if (srcFormat == GL_RGB
 #ifdef CR_OPENGL_VERSION_1_2
-                     || srcFormat == GL_BGR
+             || srcFormat == GL_BGR
+#endif
+#ifdef CR_EXT_texture_sRGB
+             || srcFormat == GL_SRGB_EXT
+             || srcFormat == GL_SRGB8_EXT
 #endif
                      ) {
         int r, b;
-        if (srcFormat == GL_RGB) {
+        if (srcFormat == GL_RGB
+#ifdef CR_EXT_texture_sRGB
+            || srcFormat == GL_SRGB_EXT
+            || srcFormat == GL_SRGB8_EXT
+#endif
+           ) {
             r = 0; b = 2;
         }
@@ -605,9 +677,19 @@
     else if (srcFormat == GL_RGBA
 #ifdef CR_OPENGL_VERSION_1_2
-                     || srcFormat == GL_BGRA
-#endif
-                     ) {
+             || srcFormat == GL_BGRA
+#endif
+#ifdef CR_EXT_texture_sRGB
+             || srcFormat == GL_SRGB_ALPHA_EXT
+             || srcFormat == GL_SRGB8_ALPHA8_EXT
+#endif
+             ) {
         int r, b;
-        if (srcFormat == GL_RGB) {
+        if (srcFormat == GL_RGBA
+#ifdef CR_EXT_texture_sRGB
+            || srcFormat == GL_SRGB_ALPHA_EXT
+            || srcFormat == GL_SRGB8_ALPHA8_EXT
+#endif
+           )
+        {
             r = 0; b = 2;
         }
@@ -753,9 +835,29 @@
         crError("unexpected source format in get_row in pixel.c");
     }
+
+#ifdef CR_EXT_texture_sRGB
+    if (srcFormat == GL_SRGB_EXT
+        || srcFormat == GL_SRGB8_EXT
+        || srcFormat == GL_SRGB_ALPHA_EXT
+        || srcFormat == GL_SRGB8_ALPHA8_EXT
+        || srcFormat == GL_SLUMINANCE_ALPHA_EXT
+        || srcFormat == GL_SLUMINANCE8_ALPHA8_EXT
+        || srcFormat == GL_SLUMINANCE_EXT
+        || srcFormat == GL_SLUMINANCE8_EXT
+       )
+    {
+        for (i=0; i<width; ++i)
+        {
+            tmpRow[i*4+0] = SRGBF_TO_RGBF(tmpRow[i*4+0]);
+            tmpRow[i*4+1] = SRGBF_TO_RGBF(tmpRow[i*4+1]);
+            tmpRow[i*4+2] = SRGBF_TO_RGBF(tmpRow[i*4+2]);
+        }
+    }
+#endif
 }
 
 
 static void put_row(char *dst, GLenum dstFormat, GLenum dstType,
-                                        GLsizei width, const GLfloat *tmpRow)
+                    GLsizei width, GLfloat *tmpRow)
 {
     GLbyte *bDst = (GLbyte *) dst;
@@ -769,4 +871,24 @@
     int i;
 
+#ifdef CR_EXT_texture_sRGB
+    if (dstFormat == GL_SRGB_EXT
+        || dstFormat == GL_SRGB8_EXT
+        || dstFormat == GL_SRGB_ALPHA_EXT
+        || dstFormat == GL_SRGB8_ALPHA8_EXT
+        || dstFormat == GL_SLUMINANCE_ALPHA_EXT
+        || dstFormat == GL_SLUMINANCE8_ALPHA8_EXT
+        || dstFormat == GL_SLUMINANCE_EXT
+        || dstFormat == GL_SLUMINANCE8_EXT
+       )
+    {
+        for (i=0; i<width; ++i)
+        {
+            tmpRow[i*4+0] = RGBF_TO_SRGBF(tmpRow[i*4+0]);
+            tmpRow[i*4+1] = RGBF_TO_SRGBF(tmpRow[i*4+1]);
+            tmpRow[i*4+2] = RGBF_TO_SRGBF(tmpRow[i*4+2]);
+        }
+    }
+#endif
+
     if (dstFormat == GL_COLOR_INDEX || dstFormat == GL_STENCIL_INDEX) {
         switch (dstType) {
@@ -846,10 +968,20 @@
     }
     else if (dstFormat == GL_RED || dstFormat == GL_GREEN ||
-                     dstFormat == GL_BLUE || dstFormat == GL_ALPHA ||
-                     dstFormat == GL_LUMINANCE || dstFormat == GL_INTENSITY) {
+             dstFormat == GL_BLUE || dstFormat == GL_ALPHA ||
+             dstFormat == GL_LUMINANCE || dstFormat == GL_INTENSITY
+#ifdef CR_EXT_texture_sRGB
+             || dstFormat == GL_SLUMINANCE_EXT
+             || dstFormat == GL_SLUMINANCE8_EXT
+#endif
+             ) {
         int index;
         if (dstFormat == GL_RED)
             index = 0;
-        else if (dstFormat == GL_LUMINANCE)
+        else if (dstFormat == GL_LUMINANCE 
+#ifdef CR_EXT_texture_sRGB
+                 || dstFormat == GL_SLUMINANCE_EXT
+                 || dstFormat == GL_SLUMINANCE8_EXT
+#endif
+                )
             index = 0;
         else if (dstFormat == GL_INTENSITY)
@@ -898,5 +1030,10 @@
         }
     }
-    else if (dstFormat == GL_LUMINANCE_ALPHA) {
+    else if (dstFormat == GL_LUMINANCE_ALPHA
+#ifdef CR_EXT_texture_sRGB
+             || dstFormat == GL_SLUMINANCE_ALPHA_EXT
+             || dstFormat == GL_SLUMINANCE8_ALPHA8_EXT
+#endif
+            ) {
         switch (dstType) {
             case GL_BYTE:
@@ -954,9 +1091,18 @@
     else if (dstFormat == GL_RGB
 #ifdef CR_OPENGL_VERSION_1_2
-                     || dstFormat == GL_BGR
+             || dstFormat == GL_BGR
+#endif
+#ifdef CR_EXT_texture_sRGB
+             || dstFormat == GL_SRGB_EXT
+             || dstFormat == GL_SRGB8_EXT
 #endif
                      ) {
         int r, b;
-        if (dstFormat == GL_RGB) {
+        if (dstFormat == GL_RGB
+#ifdef CR_EXT_texture_sRGB
+            || dstFormat == GL_SRGB_EXT
+            || dstFormat == GL_SRGB8_EXT
+#endif
+           ) {
             r = 0; b = 2;
         }
@@ -1061,9 +1207,18 @@
     else if (dstFormat == GL_RGBA
 #ifdef CR_OPENGL_VERSION_1_2
-                     || dstFormat == GL_BGRA
+             || dstFormat == GL_BGRA
+#endif
+#ifdef CR_EXT_texture_sRGB
+             || dstFormat == GL_SRGB_ALPHA_EXT
+             || dstFormat == GL_SRGB8_ALPHA8_EXT
 #endif
                      ) {
         int r, b;
-        if (dstFormat == GL_RGB) {
+        if (dstFormat == GL_RGBA
+#ifdef CR_EXT_texture_sRGB
+            || dstFormat == GL_SRGB_ALPHA_EXT
+            || dstFormat == GL_SRGB8_ALPHA8_EXT
+#endif
+           ) {
             r = 0; b = 2;
         }
