summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qplatformbackingstore.cpp22
-rw-r--r--src/gui/painting/qplatformbackingstore.h11
-rw-r--r--src/gui/painting/qtextureglyphcache.cpp2
-rw-r--r--src/gui/painting/qtextureglyphcache_p.h1
4 files changed, 26 insertions, 10 deletions
diff --git a/src/gui/painting/qplatformbackingstore.cpp b/src/gui/painting/qplatformbackingstore.cpp
index e87f796888..76269f6e65 100644
--- a/src/gui/painting/qplatformbackingstore.cpp
+++ b/src/gui/painting/qplatformbackingstore.cpp
@@ -82,9 +82,10 @@ public:
struct QBackingstoreTextureInfo
{
+ QWidget *widget; // may be null
GLuint textureId;
QRect rect;
- bool stacksOnTop;
+ QPlatformTextureList::Flags flags;
};
Q_DECLARE_TYPEINFO(QBackingstoreTextureInfo, Q_MOVABLE_TYPE);
@@ -122,10 +123,16 @@ GLuint QPlatformTextureList::textureId(int index) const
return d->textures.at(index).textureId;
}
-bool QPlatformTextureList::stacksOnTop(int index) const
+QWidget *QPlatformTextureList::widget(int index)
{
Q_D(const QPlatformTextureList);
- return d->textures.at(index).stacksOnTop;
+ return d->textures.at(index).widget;
+}
+
+QPlatformTextureList::Flags QPlatformTextureList::flags(int index) const
+{
+ Q_D(const QPlatformTextureList);
+ return d->textures.at(index).flags;
}
QRect QPlatformTextureList::geometry(int index) const
@@ -149,13 +156,14 @@ bool QPlatformTextureList::isLocked() const
return d->locked;
}
-void QPlatformTextureList::appendTexture(GLuint textureId, const QRect &geometry, bool stacksOnTop)
+void QPlatformTextureList::appendTexture(QWidget *widget, GLuint textureId, const QRect &geometry, Flags flags)
{
Q_D(QPlatformTextureList);
QBackingstoreTextureInfo bi;
+ bi.widget = widget;
bi.textureId = textureId;
bi.rect = geometry;
- bi.stacksOnTop = stacksOnTop;
+ bi.flags = flags;
d->textures.append(bi);
}
@@ -245,7 +253,7 @@ void QPlatformBackingStore::composeAndFlush(QWindow *window, const QRegion &regi
// Textures for renderToTexture widgets.
for (int i = 0; i < textures->count(); ++i) {
- if (!textures->stacksOnTop(i)) {
+ if (!textures->flags(i).testFlag(QPlatformTextureList::StacksOnTop)) {
QRect targetRect = deviceRect(textures->geometry(i), window);
QMatrix4x4 target = QOpenGLTextureBlitter::targetTransform(targetRect, windowRect);
d_ptr->blitter->blit(textures->textureId(i), target, QOpenGLTextureBlitter::OriginBottomLeft);
@@ -272,7 +280,7 @@ void QPlatformBackingStore::composeAndFlush(QWindow *window, const QRegion &regi
// Textures for renderToTexture widgets that have WA_AlwaysStackOnTop set.
for (int i = 0; i < textures->count(); ++i) {
- if (textures->stacksOnTop(i)) {
+ if (textures->flags(i).testFlag(QPlatformTextureList::StacksOnTop)) {
QRect targetRect = deviceRect(textures->geometry(i), window);
QMatrix4x4 target = QOpenGLTextureBlitter::targetTransform(targetRect, windowRect);
d_ptr->blitter->blit(textures->textureId(i), target, QOpenGLTextureBlitter::OriginBottomLeft);
diff --git a/src/gui/painting/qplatformbackingstore.h b/src/gui/painting/qplatformbackingstore.h
index 52c263f05d..c69612ca44 100644
--- a/src/gui/painting/qplatformbackingstore.h
+++ b/src/gui/painting/qplatformbackingstore.h
@@ -69,6 +69,11 @@ class Q_GUI_EXPORT QPlatformTextureList : public QObject
Q_OBJECT
Q_DECLARE_PRIVATE(QPlatformTextureList)
public:
+ enum Flag {
+ StacksOnTop = 0x01
+ };
+ Q_DECLARE_FLAGS(Flags, Flag)
+
explicit QPlatformTextureList(QObject *parent = 0);
~QPlatformTextureList();
@@ -76,16 +81,18 @@ public:
bool isEmpty() const { return count() == 0; }
GLuint textureId(int index) const;
QRect geometry(int index) const;
- bool stacksOnTop(int index) const;
+ QWidget *widget(int index);
+ Flags flags(int index) const;
void lock(bool on);
bool isLocked() const;
- void appendTexture(GLuint textureId, const QRect &geometry, bool stacksOnTop = false);
+ void appendTexture(QWidget *widget, GLuint textureId, const QRect &geometry, Flags flags = 0);
void clear();
Q_SIGNALS:
void locked(bool);
};
+Q_DECLARE_OPERATORS_FOR_FLAGS(QPlatformTextureList::Flags)
#endif
class Q_GUI_EXPORT QPlatformBackingStore
diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp
index 79ebf12fec..38e714bfcc 100644
--- a/src/gui/painting/qtextureglyphcache.cpp
+++ b/src/gui/painting/qtextureglyphcache.cpp
@@ -222,7 +222,7 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const
void QTextureGlyphCache::fillInPendingGlyphs()
{
- if (m_pendingGlyphs.isEmpty())
+ if (!hasPendingGlyphs())
return;
int requiredHeight = m_h;
diff --git a/src/gui/painting/qtextureglyphcache_p.h b/src/gui/painting/qtextureglyphcache_p.h
index 2963c41f5c..efa3b8d902 100644
--- a/src/gui/painting/qtextureglyphcache_p.h
+++ b/src/gui/painting/qtextureglyphcache_p.h
@@ -104,6 +104,7 @@ public:
bool populate(QFontEngine *fontEngine, int numGlyphs, const glyph_t *glyphs,
const QFixedPoint *positions);
+ bool hasPendingGlyphs() const { return !m_pendingGlyphs.isEmpty(); };
void fillInPendingGlyphs();
virtual void createTextureData(int width, int height) = 0;