aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/util
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@jollamobile.com>2014-04-07 12:11:45 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-22 14:09:49 +0200
commitb5c4e28afb0a34922a3c24966959dc6a97783dfb (patch)
treed9b56068c875aed2c4a9bad1aea6f57d21d3fd3b /src/quick/scenegraph/util
parentb8b8c8ca402e58d0114705698769434f8c1262b0 (diff)
Be conservative with atlas allocation for Cover windows.
These are usually small and require a very small amount of textures. Change-Id: I51a1d2965c37ac39c1f1f70d9bb6d7baf41e0562 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/quick/scenegraph/util')
-rw-r--r--src/quick/scenegraph/util/qsgatlastexture.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/quick/scenegraph/util/qsgatlastexture.cpp b/src/quick/scenegraph/util/qsgatlastexture.cpp
index 1ff7d11162..90f4f36ac8 100644
--- a/src/quick/scenegraph/util/qsgatlastexture.cpp
+++ b/src/quick/scenegraph/util/qsgatlastexture.cpp
@@ -48,6 +48,7 @@
#include <QtGui/QGuiApplication>
#include <QtGui/QScreen>
#include <QtGui/QSurface>
+#include <QtGui/QWindow>
#include <QtGui/qpa/qplatformnativeinterface.h>
#include <private/qsgtexture_p.h>
@@ -103,6 +104,15 @@ Manager::Manager()
int w = qMin(max, qsg_envInt("QSG_ATLAS_WIDTH", qMax(512, qsg_powerOfTwo(surfaceSize.width()))));
int h = qMin(max, qsg_envInt("QSG_ATLAS_HEIGHT", qMax(512, qsg_powerOfTwo(surfaceSize.height()))));
+ if (surface->surfaceClass() == QSurface::Window) {
+ QWindow *window = static_cast<QWindow *>(surface);
+ // Coverwindows, optimize for memory rather than speed
+ if ((window->type() & Qt::CoverWindow) == Qt::CoverWindow) {
+ w /= 2;
+ h /= 2;
+ }
+ }
+
m_atlas_size_limit = qsg_envInt("QSG_ATLAS_SIZE_LIMIT", qMax(w, h) / 2);
m_atlas_size = QSize(w, h);