JDK-7168550 : [macosx] duplicate OGL context state changes related to vertex cache
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 8
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2012-05-14
  • Updated: 2014-10-10
  • Resolved: 2012-06-26
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8
7u6Fixed 8 b40Fixed
Related Reports
Relates :  
Relates :  
Description
Here's the code used to configure OpenGL to get texture coordinates, colors and vertex data from our arrays

src/share/native/sun/java2d/opengl/OGLVertexCache.c

    glTexCoordPointer(..., vertexCache);
    glColorPointer(..., vertexCache + 2);
    glVertexPointer(..., vertexCache + 3);

    glEnableClientState(GL_TEXTURE_COORD_ARRAY);
    glEnableClientState(GL_COLOR_ARRAY);
    glEnableClientState(GL_VERTEX_ARRAY);

It's called from InitVertexCache() on the flusher thread and it's currently done only once per application. That is, the initialization changes the state of the *current* OpenGL context (NSOpenGLContext on Mac) only and the state isn't shared across multiple NSOpenGLContexts.

The problem becomes visible in dual-screen environment where we instantiate separate off-screen NSOpenGLContext for each screen (see CGLGraphicsConfig.m).

Comments
It is hard to reproduce this bug, so it is hard to write manual test.
27-06-2013

SUGGESTED FIX Fixed in jdk8/awt - http://hg.openjdk.java.net/jdk8/awt/jdk/rev/28ec5b811aa2
15-05-2012

EVALUATION Looks like the easiest way to fix it is to duplicate context state changes.
14-05-2012