Ignore:
Timestamp:
Aug 2, 2010, 9:27:30 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

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

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/opengl/gl2paintengineex/qglengineshadermanager.cpp

    r651 r769  
    266266    do {
    267267        QByteArray source;
     268        // Insert the custom stage before the srcPixel shader to work around an ATI driver bug
     269        // where you cannot forward declare a function that takes a sampler as argument.
     270        if (prog.srcPixelFragShader == CustomImageSrcFragmentShader)
     271            source.append(prog.customStageSource);
    268272        source.append(qShaderSnippets[prog.mainFragShader]);
    269273        source.append(qShaderSnippets[prog.srcPixelFragShader]);
    270         if (prog.srcPixelFragShader == CustomImageSrcFragmentShader)
    271             source.append(prog.customStageSource);
    272274        if (prog.compositionFragShader)
    273275            source.append(qShaderSnippets[prog.compositionFragShader]);
     
    766768    QGLContextPrivate* ctx_d = ctx->d_func();
    767769    ctx_d->setVertexAttribArrayEnabled(QT_VERTEX_COORDS_ATTR, true);
    768     ctx_d->setVertexAttribArrayEnabled(QT_TEXTURE_COORDS_ATTR, currentShaderProg->useTextureCoords);
    769     ctx_d->setVertexAttribArrayEnabled(QT_OPACITY_ATTR, currentShaderProg->useOpacityAttribute);
     770    ctx_d->setVertexAttribArrayEnabled(QT_TEXTURE_COORDS_ATTR, currentShaderProg && currentShaderProg->useTextureCoords);
     771    ctx_d->setVertexAttribArrayEnabled(QT_OPACITY_ATTR, currentShaderProg && currentShaderProg->useOpacityAttribute);
    770772
    771773    shaderProgNeedsChanging = false;
  • trunk/src/opengl/gl2paintengineex/qglengineshadersource_p.h

    r651 r769  
    332332    uniform   lowp    sampler2D imageTexture; \n\
    333333    lowp vec4 srcPixel() \n\
    334     { \n\
    335         return texture2D(imageTexture, textureCoords); \n\
    336     }\n";
     334    { \n"
     335#ifdef QT_OPENGL_ES_2
     336        // work-around for driver bug
     337        "return 1.0 * texture2D(imageTexture, textureCoords); \n"
     338#else
     339        "return texture2D(imageTexture, textureCoords); \n"
     340#endif
     341    "}\n";
    337342
    338343static const char* const qglslCustomSrcFragmentShader = "\n\
    339344    varying   highp   vec2      textureCoords; \n\
    340345    uniform   lowp    sampler2D imageTexture; \n\
    341     lowp vec4 customShader(lowp sampler2D texture, highp vec2 coords); \n\
    342346    lowp vec4 srcPixel() \n\
    343347    { \n\
  • trunk/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp

    r651 r769  
    9090
    9191//#define QT_GL_NO_SCISSOR_TEST
     92#if defined(Q_WS_WIN)
     93extern Q_GUI_EXPORT bool qt_cleartype_enabled;
     94#endif
    9295
    9396extern QImage qt_imageForBrush(int brushStyle, bool invert);
     
    182185
    183186        glActiveTexture(GL_TEXTURE0 + QT_BRUSH_TEXTURE_UNIT);
    184         ctx->d_func()->bindTexture(texImage, GL_TEXTURE_2D, GL_RGBA, true, QGLContext::InternalBindOption);
     187        ctx->d_func()->bindTexture(texImage, GL_TEXTURE_2D, GL_RGBA, QGLContext::InternalBindOption);
    185188        updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, q->state()->renderHints & QPainter::SmoothPixmapTransform);
    186189    }
     
    12321235                                            : d->glyphCacheType;
    12331236
    1234     if (txtype > QTransform::TxTranslate)
    1235         glyphType = QFontEngineGlyphCache::Raster_A8;
    1236 
    1237     if (glyphType == QFontEngineGlyphCache::Raster_RGBMask
    1238         && state()->composition_mode != QPainter::CompositionMode_Source
    1239         && state()->composition_mode != QPainter::CompositionMode_SourceOver)
    1240     {
    1241         drawCached = false;
     1237
     1238    if (glyphType == QFontEngineGlyphCache::Raster_RGBMask) {
     1239        if (d->device->alphaRequested() || txtype > QTransform::TxTranslate
     1240            || (state()->composition_mode != QPainter::CompositionMode_Source
     1241            && state()->composition_mode != QPainter::CompositionMode_SourceOver))
     1242        {
     1243            glyphType = QFontEngineGlyphCache::Raster_A8;
     1244        }
    12421245    }
    12431246
     
    15561559#if !defined(QT_OPENGL_ES_2)
    15571560#if defined(Q_WS_WIN)
    1558     extern Q_GUI_EXPORT bool qt_cleartype_enabled;
    15591561    if (qt_cleartype_enabled)
    15601562#endif
     
    15961598    delete d->shaderManager;
    15971599    d->shaderManager = 0;
     1600    d->currentBrush = QBrush();
    15981601
    15991602#ifdef QT_OPENGL_CACHE_AS_VBOS
  • trunk/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp

    r651 r769  
    4242#include "qtextureglyphcache_gl_p.h"
    4343#include "qpaintengineex_opengl2_p.h"
     44
     45QT_BEGIN_NAMESPACE
    4446
    4547#ifdef Q_WS_WIN
     
    244246#endif
    245247}
     248
     249QT_END_NAMESPACE
  • trunk/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp

    r651 r769  
    145145
    146146    const qreal *endPts = pts + (count<<1);
    147     const qreal *startPts;
     147    const qreal *startPts = 0;
    148148
    149149    Qt::PenCapStyle cap = m_cap_style;
    150150
    151151    if (!types) {
     152        // skip duplicate points
     153        while((pts + 2) < endPts && pts[0] == pts[2] && pts[1] == pts[3])
     154            pts += 2;
     155        if ((pts + 2) == endPts)
     156            return;
     157
    152158        startPts = pts;
    153159
     
    162168        pts += 2;
    163169        while (pts < endPts) {
    164             join(pts);
    165             lineTo(pts);
     170            if (m_cx != pts[0] || m_cy != pts[1]) {
     171                join(pts);
     172                lineTo(pts);
     173            }
    166174            pts += 2;
    167175        }
     
    170178
    171179    } else {
    172         bool endsAtStart;
     180        bool endsAtStart = false;
    173181        while (pts < endPts) {
    174182            switch (*types) {
Note: See TracChangeset for help on using the changeset viewer.