Changeset 769 for trunk/src/opengl/gl2paintengineex
- Timestamp:
- Aug 2, 2010, 9:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.3 (added) merged: 768 /branches/vendor/nokia/qt/current merged: 767 /branches/vendor/nokia/qt/4.6.2 removed
- Property svn:mergeinfo changed
-
trunk/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
r651 r769 266 266 do { 267 267 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); 268 272 source.append(qShaderSnippets[prog.mainFragShader]); 269 273 source.append(qShaderSnippets[prog.srcPixelFragShader]); 270 if (prog.srcPixelFragShader == CustomImageSrcFragmentShader)271 source.append(prog.customStageSource);272 274 if (prog.compositionFragShader) 273 275 source.append(qShaderSnippets[prog.compositionFragShader]); … … 766 768 QGLContextPrivate* ctx_d = ctx->d_func(); 767 769 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); 770 772 771 773 shaderProgNeedsChanging = false; -
trunk/src/opengl/gl2paintengineex/qglengineshadersource_p.h
r651 r769 332 332 uniform lowp sampler2D imageTexture; \n\ 333 333 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"; 337 342 338 343 static const char* const qglslCustomSrcFragmentShader = "\n\ 339 344 varying highp vec2 textureCoords; \n\ 340 345 uniform lowp sampler2D imageTexture; \n\ 341 lowp vec4 customShader(lowp sampler2D texture, highp vec2 coords); \n\342 346 lowp vec4 srcPixel() \n\ 343 347 { \n\ -
trunk/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
r651 r769 90 90 91 91 //#define QT_GL_NO_SCISSOR_TEST 92 #if defined(Q_WS_WIN) 93 extern Q_GUI_EXPORT bool qt_cleartype_enabled; 94 #endif 92 95 93 96 extern QImage qt_imageForBrush(int brushStyle, bool invert); … … 182 185 183 186 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); 185 188 updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, q->state()->renderHints & QPainter::SmoothPixmapTransform); 186 189 } … … 1232 1235 : d->glyphCacheType; 1233 1236 1234 if (txtype > QTransform::TxTranslate) 1235 glyphType = QFontEngineGlyphCache::Raster_A8;1236 1237 if (glyphType == QFontEngineGlyphCache::Raster_RGBMask1238 && state()->composition_mode != QPainter::CompositionMode_Source1239 && 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 } 1242 1245 } 1243 1246 … … 1556 1559 #if !defined(QT_OPENGL_ES_2) 1557 1560 #if defined(Q_WS_WIN) 1558 extern Q_GUI_EXPORT bool qt_cleartype_enabled;1559 1561 if (qt_cleartype_enabled) 1560 1562 #endif … … 1596 1598 delete d->shaderManager; 1597 1599 d->shaderManager = 0; 1600 d->currentBrush = QBrush(); 1598 1601 1599 1602 #ifdef QT_OPENGL_CACHE_AS_VBOS -
trunk/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
r651 r769 42 42 #include "qtextureglyphcache_gl_p.h" 43 43 #include "qpaintengineex_opengl2_p.h" 44 45 QT_BEGIN_NAMESPACE 44 46 45 47 #ifdef Q_WS_WIN … … 244 246 #endif 245 247 } 248 249 QT_END_NAMESPACE -
trunk/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp
r651 r769 145 145 146 146 const qreal *endPts = pts + (count<<1); 147 const qreal *startPts ;147 const qreal *startPts = 0; 148 148 149 149 Qt::PenCapStyle cap = m_cap_style; 150 150 151 151 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 152 158 startPts = pts; 153 159 … … 162 168 pts += 2; 163 169 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 } 166 174 pts += 2; 167 175 } … … 170 178 171 179 } else { 172 bool endsAtStart ;180 bool endsAtStart = false; 173 181 while (pts < endPts) { 174 182 switch (*types) {
Note:
See TracChangeset
for help on using the changeset viewer.