diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2009-07-17 00:26:25 (GMT) |
---|---|---|
committer | Alan Alpert <alan.alpert@nokia.com> | 2009-07-17 00:26:25 (GMT) |
commit | 4200dec4f01d8181a39704c149bc49c9a8882274 (patch) | |
tree | 6a17d899567c5569ad47673bd734c9221f1e9fc9 /src/declarative/fx/qfxpainteditem.cpp | |
parent | 46fa97f020a310de3ad6f92860dffdb402955b14 (diff) | |
parent | b1690ae329a3b81628d3ac6c19b24960177b6e73 (diff) | |
download | Qt-4200dec4f01d8181a39704c149bc49c9a8882274.zip Qt-4200dec4f01d8181a39704c149bc49c9a8882274.tar.gz Qt-4200dec4f01d8181a39704c149bc49c9a8882274.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative/fx/qfxpainteditem.cpp')
-rw-r--r-- | src/declarative/fx/qfxpainteditem.cpp | 46 |
1 files changed, 1 insertions, 45 deletions
diff --git a/src/declarative/fx/qfxpainteditem.cpp b/src/declarative/fx/qfxpainteditem.cpp index 0a13dc4..c79abbd 100644 --- a/src/declarative/fx/qfxpainteditem.cpp +++ b/src/declarative/fx/qfxpainteditem.cpp @@ -49,11 +49,6 @@ #include <QApplication> #include <QGraphicsSceneMouseEvent> -#if defined(QFX_RENDER_OPENGL2) -#include <QtOpenGL/qglframebufferobject.h> -#include <glsave.h> -#endif - QT_BEGIN_NAMESPACE /*! @@ -210,26 +205,16 @@ void QFxPaintedItem::init() connect(this,SIGNAL(visibleChanged()),this,SLOT(clearCache())); } -#if defined(QFX_RENDER_QPAINTER) /*! \reimp */ void QFxPaintedItem::paintContents(QPainter &p) -#elif defined(QFX_RENDER_OPENGL) -/*! - \reimp -*/ -void QFxPaintedItem::paintGLContents(GLPainter &p) -#else -#error "What render?" -#endif { Q_D(QFxPaintedItem); const QRect content(QPoint(0,0),d->contentsSize); if (content.width() <= 0 || content.height() <= 0) return; -#if defined(QFX_RENDER_QPAINTER) bool oldAntiAliasing = p.testRenderHint(QPainter::Antialiasing); bool oldSmoothPixmap = p.testRenderHint(QPainter::SmoothPixmapTransform); if (oldAntiAliasing) @@ -242,29 +227,12 @@ void QFxPaintedItem::paintGLContents(GLPainter &p) else clipf = mapToScene(clipf); -#elif defined(QFX_RENDER_OPENGL2) - p.useTextureShader(); - const QRectF clipf = p.sceneClipRect; - -#elif defined(QFX_RENDER_OPENGL1) - p.useTextureShader(); - const QRectF clipf = p.sceneClipRect; -#endif - const QRect clip = mapFromScene(clipf).toRect(); QRegion topaint(clip); topaint &= content; QRegion uncached(content); -#if defined(QFX_RENDER_OPENGL2) - glEnableVertexAttribArray(SingleTextureShader::Vertices); - glEnableVertexAttribArray(SingleTextureShader::TextureCoords); -#elif defined(QFX_RENDER_OPENGL1) - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); -#endif - int cachesize=0; for (int i=0; i<d->imagecache.count(); ++i) { QRect area = d->imagecache[i]->area; @@ -312,29 +280,17 @@ void QFxPaintedItem::paintGLContents(GLPainter &p) } QFxPaintedItemPrivate::ImageCacheItem *newitem = new QFxPaintedItemPrivate::ImageCacheItem; newitem->area = r; -#if defined(QFX_RENDER_QPAINTER) newitem->image = img; -#else - newitem->image.setImage(img.toImage()); -#endif d->imagecache.append(newitem); QRectF target(r.x(), r.y(), r.width(), r.height()); p.drawPixmap(target.toRect(), newitem->image); } } -#if defined(QFX_RENDER_OPENGL2) - glDisableVertexAttribArray(SingleTextureShader::Vertices); - glDisableVertexAttribArray(SingleTextureShader::TextureCoords); -#elif defined(QFX_RENDER_OPENGL1) - glDisableClientState(GL_VERTEX_ARRAY); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); -#endif -#if defined(QFX_RENDER_QPAINTER) + if (oldAntiAliasing) p.setRenderHints(QPainter::Antialiasing, oldAntiAliasing); if (d->smooth) p.setRenderHints(QPainter::SmoothPixmapTransform, oldSmoothPixmap); -#endif } /*! |