summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>2009-10-01 11:36:57 (GMT)
committerKim Motoyoshi Kalland <kim.kalland@nokia.com>2009-10-02 15:57:19 (GMT)
commit5a26fa6da1986bdb507391fd8784c51258e81d80 (patch)
treee1c0d4aac597cc0ace85e0619d46648a8ce75038 /src/opengl
parent385176ad28b3a79bcd196d2d529c4bf7abd4fcc0 (diff)
downloadQt-5a26fa6da1986bdb507391fd8784c51258e81d80.zip
Qt-5a26fa6da1986bdb507391fd8784c51258e81d80.tar.gz
Qt-5a26fa6da1986bdb507391fd8784c51258e81d80.tar.bz2
Changed implementation of qDrawBorderPixmap() to use qDrawPixmaps().
Reviewed-by: Trond
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp18
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h2
2 files changed, 12 insertions, 8 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 12a8ed8..992d47d 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -1428,11 +1428,11 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(const QPointF &p, QFontEngineGly
glDrawArrays(GL_TRIANGLES, 0, 6 * glyphs.size());
}
-void QGL2PaintEngineEx::drawPixmaps(const QDrawPixmapsData *drawingData, int dataCount, const QPixmap &pixmap)
+void QGL2PaintEngineEx::drawPixmaps(const QDrawPixmaps::Data *drawingData, int dataCount, const QPixmap &pixmap, QDrawPixmaps::DrawingHints hints)
{
// Use fallback for extended composition modes.
if (state()->composition_mode > QPainter::CompositionMode_Plus) {
- QPaintEngineEx::drawPixmaps(drawingData, dataCount, pixmap);
+ QPaintEngineEx::drawPixmaps(drawingData, dataCount, pixmap, hints);
return;
}
@@ -1448,11 +1448,15 @@ void QGL2PaintEngineEx::drawPixmaps(const QDrawPixmapsData *drawingData, int dat
bool allOpaque = true;
for (int i = 0; i < dataCount; ++i) {
- qreal s = 0.5 * qSin(drawingData[i].rotation * Q_PI / 180);
- qreal c = 0.5 * qCos(drawingData[i].rotation * Q_PI / 180);
+ qreal s = 0;
+ qreal c = 1;
+ if (drawingData[i].rotation != 0) {
+ s = qFastSin(drawingData[i].rotation * Q_PI / 180);
+ c = qFastCos(drawingData[i].rotation * Q_PI / 180);
+ }
- qreal right = drawingData[i].scaleX * drawingData[i].source.width();
- qreal bottom = drawingData[i].scaleY * drawingData[i].source.height();
+ qreal right = 0.5 * drawingData[i].scaleX * drawingData[i].source.width();
+ qreal bottom = 0.5 * drawingData[i].scaleY * drawingData[i].source.height();
QGLPoint bottomRight(right * c - bottom * s, right * s + bottom * c);
QGLPoint bottomLeft(-right * c - bottom * s, -right * s + bottom * c);
@@ -1496,7 +1500,7 @@ void QGL2PaintEngineEx::drawPixmaps(const QDrawPixmapsData *drawingData, int dat
d->transferMode(ImageArrayDrawingMode);
bool isBitmap = pixmap.isQBitmap();
- bool isOpaque = !isBitmap && !pixmap.hasAlphaChannel() && allOpaque;
+ bool isOpaque = !isBitmap && (!pixmap.hasAlphaChannel() || (hints & QDrawPixmaps::OpaqueHint)) && allOpaque;
d->updateTextureFilter(GL_TEXTURE_2D, GL_CLAMP_TO_EDGE,
state()->renderHints & QPainter::SmoothPixmapTransform, texture->id);
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
index 9d40726..4f42082 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
@@ -128,7 +128,7 @@ public:
virtual void drawTextItem(const QPointF &p, const QTextItem &textItem);
- virtual void drawPixmaps(const QDrawPixmapsData *drawingData, int dataCount, const QPixmap &pixmap);
+ virtual void drawPixmaps(const QDrawPixmaps::Data *drawingData, int dataCount, const QPixmap &pixmap, QDrawPixmaps::DrawingHints hints);
Type type() const { return OpenGL2; }