changeset 4642:9dfe50f456be

7125723: [macosx] painting artifacts after running SwingSet2 with jdk7u-osx build Reviewed-by: bae
author dcherepanov
date Fri, 30 Dec 2011 17:37:53 +0300
parents bd7524f94558
children f9fd4c285876
files src/share/native/sun/java2d/opengl/OGLSurfaceData.c
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/native/sun/java2d/opengl/OGLSurfaceData.c	Thu Dec 29 09:21:28 2011 -0800
+++ b/src/share/native/sun/java2d/opengl/OGLSurfaceData.c	Fri Dec 30 17:37:53 2011 +0300
@@ -137,7 +137,8 @@
                         jint width, jint height)
 {
     GLenum texTarget, texProxyTarget;
-    GLint format = isOpaque ? GL_RGB : GL_RGBA;
+    GLint format = GL_RGBA;
+    GLint size = GL_UNSIGNED_INT_8_8_8_8;
     GLuint texID;
     GLsizei texWidth, texHeight, realWidth, realHeight;
     GLint texMax;
@@ -191,7 +192,7 @@
     // the calculated power-of-two dimensions and the given internal format
     j2d_glTexImage2D(texProxyTarget, 0, format,
                      texWidth, texHeight, 0,
-                     format, GL_UNSIGNED_BYTE, NULL);
+                     format, size, NULL);
     j2d_glGetTexLevelParameteriv(texProxyTarget, 0,
                                  GL_TEXTURE_WIDTH, &realWidth);
     j2d_glGetTexLevelParameteriv(texProxyTarget, 0,
@@ -213,7 +214,7 @@
     j2d_glBindTexture(texTarget, texID);
     j2d_glTexImage2D(texTarget, 0, format,
                      texWidth, texHeight, 0,
-                     format, GL_UNSIGNED_BYTE, NULL);
+                     format, size, NULL);
 
     oglsdo->isOpaque = isOpaque;
     oglsdo->xOffset = 0;