United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 7168550 [macosx] duplicate OGL context state changes related to vertex cache
7168550 : [macosx] duplicate OGL context state changes related to vertex cache

Details
Type:
Bug
Submit Date:
2012-05-14
Status:
Closed
Updated Date:
2012-06-26
Project Name:
JDK
Resolved Date:
2012-06-26
Component:
client-libs
OS:
generic
Sub-Component:
2d
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
8
Fixed Versions:
8

Related Reports
Backport:
Relates:
Relates:

Sub Tasks

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
SUGGESTED FIX

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

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



Hardware and Software, Engineered to Work Together