~ubuntu-mate-dev/compiz/marco-decoration

« back to all changes in this revision

Viewing changes to plugins/opengl/src/vertexbuffer.cpp

  • Committer: CI Train Bot
  • Author(s): Eleni Maria Stea
  • Date: 2015-08-05 11:26:09 UTC
  • mfrom: (3947.3.22 compiz)
  • Revision ID: ci-train-bot@canonical.com-20150805112609-3h3s5r4x4dgtshxd
It fixes the 3d windows plugin.
Problem:
The 3d clipping is performed in viewing space (modelview transformation) and should be done inside the shader when we use shaders otherwise the viewing space pipeline operations will be ignored. Compiz used to perform the clipping inside the td plugin using pipeline functions, then it was loading a generic shader program (no clipping operations) to render the windows and then it rendered the 3d quads around the windows using the pipeline (so these were clipped correctly).

Fix:
Added a variable that indicates when to load the shaders and when render using the fixed functions pipeline and use the fixed functions pipeline to render between glEnableOutputClipping and glDisableOutputClipping.

+small fix in the legacyRendering (pipeline) Fixes: #1395697
Approved by: PS Jenkins bot, Stephen M. Webb

Show diffs side-by-side

added added

removed removed

Lines of Context:
621
621
        glTexCoordPointer (2, GL_FLOAT, 0, &textureData[i][0]);
622
622
    }
623
623
 
624
 
    glDrawArrays (primitiveType, vertexOffset, vertexData.size () / 3);
 
624
    glDrawArrays (primitiveType, vertexOffset, maxVertices > 0 ?
 
625
                                    std::min (static_cast <int> (vertexData.size () / 3),
 
626
                                              maxVertices) :
 
627
                                    vertexData.size () / 3);
625
628
 
626
629
    glDisableClientState (GL_VERTEX_ARRAY);
627
630
    glDisableClientState (GL_NORMAL_ARRAY);