summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/egl/qegl.cpp2
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp3
-rw-r--r--src/gui/image/qimage.cpp7
-rw-r--r--src/gui/painting/qtextureglyphcache.cpp14
-rw-r--r--src/gui/painting/qtextureglyphcache_p.h3
5 files changed, 14 insertions, 15 deletions
diff --git a/src/gui/egl/qegl.cpp b/src/gui/egl/qegl.cpp
index 498245c..6f215cc 100644
--- a/src/gui/egl/qegl.cpp
+++ b/src/gui/egl/qegl.cpp
@@ -556,7 +556,7 @@ EGLDisplay QEgl::display()
}
// Resolve the egl extension function pointers:
-#if !defined(EGL_KHR_image) && !defined(EGL_KHR_image_base)
+#if (defined(EGL_KHR_image) || defined(EGL_KHR_image_base)) && !defined(EGL_EGLEXT_PROTOTYPES)
if (QEgl::hasExtension("EGL_KHR_image") || QEgl::hasExtension("EGL_KHR_image_base")) {
eglCreateImageKHR = (_eglCreateImageKHR) eglGetProcAddress("eglCreateImageKHR");
eglDestroyImageKHR = (_eglDestroyImageKHR) eglGetProcAddress("eglDestroyImageKHR");
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index f106b3d..d6daf4d 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -7112,7 +7112,8 @@ void QGraphicsItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
// Root items that ignore transformations need to
// calculate their diff by mapping viewport coordinates
// directly to parent coordinates.
- QTransform viewToParentTransform = (item->transform().translate(item->d_ptr->pos.x(), item->d_ptr->pos.y()))
+ // COMBINE
+ QTransform viewToParentTransform = (item->d_func()->transformData->computedFullTransform().translate(item->d_ptr->pos.x(), item->d_ptr->pos.y()))
* (item->sceneTransform() * view->viewportTransform()).inverted();
currentParentPos = viewToParentTransform.map(QPointF(view->mapFromGlobal(event->screenPos())));
buttonDownParentPos = viewToParentTransform.map(QPointF(view->mapFromGlobal(event->buttonDownScreenPos(Qt::LeftButton))));
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 233c58d..ce1d6d3 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -5704,9 +5704,10 @@ void QImage::setAlphaChannel(const QImage &alphaChannel)
return;
}
- detach();
-
- *this = convertToFormat(QImage::Format_ARGB32_Premultiplied);
+ if (d->format == QImage::Format_ARGB32_Premultiplied)
+ detach();
+ else
+ *this = convertToFormat(QImage::Format_ARGB32_Premultiplied);
// Slight optimization since alphachannels are returned as 8-bit grays.
if (alphaChannel.d->depth == 8 && alphaChannel.isGrayscale()) {
diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp
index cf545be..9eda0ef 100644
--- a/src/gui/painting/qtextureglyphcache.cpp
+++ b/src/gui/painting/qtextureglyphcache.cpp
@@ -133,10 +133,13 @@ void QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const
while (iter != listItemCoordinates.end()) {
Coord c = iter.value();
+ m_currentRowHeight = qMax(m_currentRowHeight, c.h + margin * 2);
+
if (m_cx + c.w > m_w) {
// no room on the current line, start new glyph strip
m_cx = 0;
- m_cy += rowHeight;
+ m_cy += m_currentRowHeight;
+ m_currentRowHeight = 0; // New row
}
if (m_cy + c.h > m_h) {
int new_height = m_h*2;
@@ -153,14 +156,7 @@ void QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const
fillTexture(c, iter.key());
coords.insert(iter.key(), c);
- if (m_cx + c.w > m_w) {
- m_cx = 0;
- m_cy += rowHeight;
- } else {
- // for the Mono case, glyph_width is 8-bit aligned,
- // and therefore so will m_cx
- m_cx += c.w;
- }
+ m_cx += c.w;
++iter;
}
diff --git a/src/gui/painting/qtextureglyphcache_p.h b/src/gui/painting/qtextureglyphcache_p.h
index 803e71b..8c2f5b4 100644
--- a/src/gui/painting/qtextureglyphcache_p.h
+++ b/src/gui/painting/qtextureglyphcache_p.h
@@ -77,7 +77,7 @@ class Q_GUI_EXPORT QTextureGlyphCache : public QFontEngineGlyphCache
public:
QTextureGlyphCache(QFontEngineGlyphCache::Type type, const QTransform &matrix)
: QFontEngineGlyphCache(matrix, type), m_current_fontengine(0),
- m_w(0), m_h(0), m_cx(0), m_cy(0)
+ m_w(0), m_h(0), m_cx(0), m_cy(0), m_currentRowHeight(0)
{ }
virtual ~QTextureGlyphCache() { }
@@ -120,6 +120,7 @@ protected:
int m_h; // image height
int m_cx; // current x
int m_cy; // current y
+ int m_currentRowHeight; // Height of last row
};