Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/opengl/gl2paintengineex/qglengineshadersource_p.h

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    107107        gl_Position = vec4(transformedPos.xy, 0.0, transformedPos.z); \n\
    108108    }\n";
     109
     110static const char* const qglslComplexGeometryPositionOnlyVertexShader = "\n\
     111    uniform highp mat3 matrix; \n\
     112    attribute highp vec2 vertexCoordsArray; \n\
     113    void setPosition(void) \n\
     114    { \n\
     115      gl_Position = vec4(matrix * vec3(vertexCoordsArray, 1), 1);\n\
     116    } \n";
    109117
    110118static const char* const qglslUntransformedPositionVertexShader = "\n\
     
    275283    uniform   highp   vec2      invertedTextureSize; \n\
    276284    uniform   highp   mat3      brushTransform; \n\
    277     varying   highp   vec2      textureCoords; \n\
     285    varying   highp   vec2      brushTextureCoords; \n\
    278286    void setPosition(void) \n\
    279287    { \n\
     
    285293        mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \n\
    286294        gl_Position = vec4(gl_Position.xy * invertedHTexCoordsZ, 0.0, invertedHTexCoordsZ); \n\
    287         textureCoords.xy = (hTexCoords.xy * invertedTextureSize) * gl_Position.w; \n\
     295        brushTextureCoords.xy = (hTexCoords.xy * invertedTextureSize) * gl_Position.w; \n\
    288296    }\n";
    289297
     
    296304// TODO: Special case POT textures which don't need this emulation
    297305static const char* const qglslTextureBrushSrcFragmentShader = "\n\
    298     varying highp   vec2      textureCoords; \n\
     306    varying highp   vec2      brushTextureCoords; \n\
    299307    uniform lowp    sampler2D brushTexture; \n\
    300308    lowp vec4 srcPixel() { \n\
    301         return texture2D(brushTexture, fract(textureCoords)); \n\
     309        return texture2D(brushTexture, fract(brushTextureCoords)); \n\
    302310    }\n";
    303311#else
    304312static const char* const qglslTextureBrushSrcFragmentShader = "\n\
    305     varying   highp   vec2      textureCoords; \n\
     313    varying   highp   vec2      brushTextureCoords; \n\
    306314    uniform   lowp    sampler2D brushTexture; \n\
    307315    lowp vec4 srcPixel() \n\
    308316    { \n\
    309         return texture2D(brushTexture, textureCoords); \n\
     317        return texture2D(brushTexture, brushTextureCoords); \n\
    310318    }\n";
    311319#endif
    312320
    313321static const char* const qglslTextureBrushSrcWithPatternFragmentShader = "\n\
    314     varying   highp   vec2      textureCoords; \n\
     322    varying   highp   vec2      brushTextureCoords; \n\
    315323    uniform   lowp    vec4      patternColor; \n\
    316324    uniform   lowp    sampler2D brushTexture; \n\
    317325    lowp vec4 srcPixel() \n\
    318326    { \n\
    319         return patternColor * (1.0 - texture2D(brushTexture, textureCoords).r); \n\
     327        return patternColor * (1.0 - texture2D(brushTexture, brushTextureCoords).r); \n\
    320328    }\n";
    321329
     
    333341    lowp vec4 srcPixel() \n\
    334342    { \n"
    335 #ifdef QT_OPENGL_ES_2
    336         // work-around for driver bug
    337         "return 1.0 * texture2D(imageTexture, textureCoords); \n"
    338 #else
    339343        "return texture2D(imageTexture, textureCoords); \n"
    340 #endif
    341344    "}\n";
    342345
Note: See TracChangeset for help on using the changeset viewer.