summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2009-12-27 09:14:22 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2009-12-27 09:14:22 (GMT)
commit6aa95df70c7701bfe8c1d6b40dc49c4b3e591c64 (patch)
tree2f7033241c700c470027000777d09b689d5ff7a8 /src/opengl
parent3f74384fd781d6d6028914bb8520340694810a1a (diff)
parentfdfb48bdb77ec0710c80d2f4bb6feaaf07f695c1 (diff)
downloadQt-6aa95df70c7701bfe8c1d6b40dc49c4b3e591c64.zip
Qt-6aa95df70c7701bfe8c1d6b40dc49c4b3e591c64.tar.gz
Qt-6aa95df70c7701bfe8c1d6b40dc49c4b3e591c64.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2: revert f36fb8b2b63b3734cc2bd66b329ca4fef1204845 Read QWS_SIZE from layer rather than screen Get rid of no_cast_from_ascii warning Docs: Amendments to latest changes to QImageReader docs. images: Document QImageReader::loopCount behaviour for infinite loops gif: Add unit test for QImageReader::size calls gif: 10% speedup on microbenchmark on QImageReader png: Avoid calling QImage::scanLine(int) from within a loop QImageReader: Avoid errorString creation in the normal case Fix text rendering on GL2 paint engine
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp15
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h1
2 files changed, 11 insertions, 5 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index f52ed92..32fa3dc 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -388,21 +388,24 @@ inline QColor qt_premultiplyColor(QColor c, GLfloat opacity)
void QGL2PaintEngineExPrivate::setBrush(const QBrush& brush)
{
- Q_ASSERT(brush.style() != Qt::NoBrush);
-
if (qbrush_fast_equals(currentBrush, brush))
return;
+ const Qt::BrushStyle newStyle = qbrush_style(brush);
+ Q_ASSERT(newStyle != Qt::NoBrush);
+
currentBrush = brush;
+ brushUniformsDirty = true; // All brushes have at least one uniform
+
+ if (newStyle > Qt::SolidPattern)
+ brushTextureDirty = true;
- brushTextureDirty = true;
- brushUniformsDirty = true;
if (currentBrush.style() == Qt::TexturePattern
&& qHasPixmapTexture(brush) && brush.texture().isQBitmap())
{
shaderManager->setSrcPixelType(QGLEngineShaderManager::TextureSrcWithPattern);
} else {
- shaderManager->setSrcPixelType(currentBrush.style());
+ shaderManager->setSrcPixelType(newStyle);
}
shaderManager->optimiseForBrushTransform(currentBrush.transform());
}
@@ -700,6 +703,7 @@ static inline void setCoords(GLfloat *coords, const QGLRect &rect)
void QGL2PaintEngineExPrivate::drawTexture(const QGLRect& dest, const QGLRect& src, const QSize &textureSize, bool opaque, bool pattern)
{
// Setup for texture drawing
+ currentBrush = noBrush;
shaderManager->setSrcPixelType(pattern ? QGLEngineShaderManager::PatternSrc : QGLEngineShaderManager::ImageSrc);
if (prepareForDraw(opaque))
shaderManager->currentProgram()->setUniformValue(location(QGLEngineShaderManager::ImageTexture), QT_IMAGE_TEXTURE_UNIT);
@@ -1782,6 +1786,7 @@ void QGL2PaintEngineEx::drawPixmaps(const QDrawPixmaps::Data *drawingData, int d
state()->renderHints & QPainter::SmoothPixmapTransform, texture->id);
// Setup for texture drawing
+ d->currentBrush = d->noBrush;
d->shaderManager->setSrcPixelType(isBitmap ? QGLEngineShaderManager::PatternSrc : QGLEngineShaderManager::ImageSrc);
if (d->prepareForDraw(isOpaque))
d->shaderManager->currentProgram()->setUniformValue(d->location(QGLEngineShaderManager::ImageTexture), QT_IMAGE_TEXTURE_UNIT);
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
index f1ec6e6..8de4a82 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
@@ -244,6 +244,7 @@ public:
uint maxClip;
QBrush currentBrush; // May not be the state's brush!
+ const QBrush noBrush;
GLfloat inverseScale;