diff options
author | Kim Motoyoshi Kalland <kim.kalland@nokia.com> | 2009-10-15 08:33:25 (GMT) |
---|---|---|
committer | Kim Motoyoshi Kalland <kim.kalland@nokia.com> | 2009-10-15 08:42:44 (GMT) |
commit | d83761cf3ddd301545ebd9981b9d0547e636e3b4 (patch) | |
tree | e2d6618d6bf2c0fb37296c48922529f9acfdb2f5 /src/opengl/qpaintengine_opengl.cpp | |
parent | 9a3cdecc11e8dabaf2390eaab2c71e64f6521e69 (diff) | |
download | Qt-d83761cf3ddd301545ebd9981b9d0547e636e3b4.zip Qt-d83761cf3ddd301545ebd9981b9d0547e636e3b4.tar.gz Qt-d83761cf3ddd301545ebd9981b9d0547e636e3b4.tar.bz2 |
Fixed bitmap brushes and tiled bitmaps in the OpenGL1 paint engine.
Fixed drawing of bitmap brushes and tiled bitmaps so that they are
painted with the brush colour or pen colour instead of black.
Reviewed-by: Trond
Diffstat (limited to 'src/opengl/qpaintengine_opengl.cpp')
-rw-r--r-- | src/opengl/qpaintengine_opengl.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp index fc1695d..1a586d3 100644 --- a/src/opengl/qpaintengine_opengl.cpp +++ b/src/opengl/qpaintengine_opengl.cpp @@ -1222,7 +1222,7 @@ inline void QOpenGLPaintEnginePrivate::setGradientOps(const QBrush &brush, const fragment_brush = FRAGMENT_PROGRAM_BRUSH_CONICAL; else if (current_style == Qt::SolidPattern) fragment_brush = FRAGMENT_PROGRAM_BRUSH_SOLID; - else if (current_style == Qt::TexturePattern) + else if (current_style == Qt::TexturePattern && !brush.texture().isQBitmap()) fragment_brush = FRAGMENT_PROGRAM_BRUSH_TEXTURE; else fragment_brush = FRAGMENT_PROGRAM_BRUSH_PATTERN; @@ -4311,6 +4311,16 @@ void QOpenGLPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QR void QOpenGLPaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &offset) { Q_D(QOpenGLPaintEngine); + if (pm.depth() == 1) { + QPixmap tpx(pm.size()); + tpx.fill(Qt::transparent); + QPainter p(&tpx); + p.setPen(d->cpen); + p.drawPixmap(0, 0, pm); + p.end(); + drawTiledPixmap(r, tpx, offset); + return; + } QImage scaled; const int sz = d->max_texture_size; @@ -5207,7 +5217,7 @@ void QOpenGLPaintEnginePrivate::composite(GLuint primitive, const q_vertexType * device->context()->d_func()->bindTexture(cbrush.textureImage(), GL_TEXTURE_2D, GL_RGBA, QGLContext::InternalBindOption); else - device->context()->d_func()->bindTexture(qt_imageForBrush(current_style, true), + device->context()->d_func()->bindTexture(qt_imageForBrush(current_style, false), GL_TEXTURE_2D, GL_RGBA, QGLContext::InternalBindOption); |