summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTomi Korpipää <tomi.korpipaa@digia.com>2014-01-27 06:50:42 +0200
committerTomi Korpipää <tomi.korpipaa@digia.com>2014-01-27 06:54:05 +0200
commit86cc8bfa76061adfa29b48f80b426c6198de6a53 (patch)
treed1c20d51da117ddd0bb8b1bc3506abac92c70872 /src
parent289584f6e4434577abea050855fb59ef84417070 (diff)
iOS fixes
+ texture power-of-two added + input handling changes - surface crashes, will be fixed in separate commit Task-number: QTRD-2802 Change-Id: I1913aec60c4e986b02f307d832dc55dea0be4348 Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/datavisualization/input/q3dinputhandler.cpp6
-rw-r--r--src/datavisualization/utils/texturehelper.cpp2
-rw-r--r--src/datavisualization/utils/utils.cpp4
3 files changed, 6 insertions, 6 deletions
diff --git a/src/datavisualization/input/q3dinputhandler.cpp b/src/datavisualization/input/q3dinputhandler.cpp
index 17f5aee5..dcdb984e 100644
--- a/src/datavisualization/input/q3dinputhandler.cpp
+++ b/src/datavisualization/input/q3dinputhandler.cpp
@@ -88,7 +88,7 @@ Q3DInputHandler::~Q3DInputHandler()
*/
void Q3DInputHandler::mousePressEvent(QMouseEvent *event, const QPoint &mousePos)
{
-#if defined(Q_OS_ANDROID)
+#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
Q_UNUSED(event);
Q_UNUSED(mousePos);
#else
@@ -128,7 +128,7 @@ void Q3DInputHandler::mousePressEvent(QMouseEvent *event, const QPoint &mousePos
void Q3DInputHandler::mouseReleaseEvent(QMouseEvent *event, const QPoint &mousePos)
{
Q_UNUSED(event);
-#if defined (Q_OS_ANDROID)
+#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
Q_UNUSED(mousePos);
#else
if (QAbstract3DInputHandlerPrivate::InputStateRotating == d_ptr->m_inputState) {
@@ -147,7 +147,7 @@ void Q3DInputHandler::mouseReleaseEvent(QMouseEvent *event, const QPoint &mouseP
void Q3DInputHandler::mouseMoveEvent(QMouseEvent *event, const QPoint &mousePos)
{
Q_UNUSED(event);
-#if defined (Q_OS_ANDROID)
+#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
Q_UNUSED(mousePos);
#else
if (QAbstract3DInputHandlerPrivate::InputStateRotating == d_ptr->m_inputState) {
diff --git a/src/datavisualization/utils/texturehelper.cpp b/src/datavisualization/utils/texturehelper.cpp
index 6498fce4..df7ff0c1 100644
--- a/src/datavisualization/utils/texturehelper.cpp
+++ b/src/datavisualization/utils/texturehelper.cpp
@@ -43,7 +43,7 @@ GLuint TextureHelper::create2DTexture(const QImage &image, bool useTrilinearFilt
QImage texImage = image;
-#if defined(Q_OS_ANDROID)
+#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
GLuint temp;
//qDebug() << "old size" << image.size();
GLuint imageWidth = Utils::getNearestPowerOfTwo(image.width(), temp);
diff --git a/src/datavisualization/utils/utils.cpp b/src/datavisualization/utils/utils.cpp
index 78978c3c..83a7f051 100644
--- a/src/datavisualization/utils/utils.cpp
+++ b/src/datavisualization/utils/utils.cpp
@@ -66,7 +66,7 @@ QImage Utils::printTextToImage(const QFont &font, const QString &text, const QCo
valueStrWidth += paddingWidth / 2; // Fix clipping problem with skewed fonts (italic or italic-style)
QSize labelSize;
-#if defined(Q_OS_ANDROID)
+#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
// Android can't handle textures with dimensions not in power of 2. Resize labels accordingly.
// Add some padding before converting to power of two to avoid too tight fit
GLuint prePadding = 5;
@@ -95,7 +95,7 @@ QImage Utils::printTextToImage(const QFont &font, const QString &text, const QCo
painter.setFont(valueFont);
if (!labelBackground) {
painter.setPen(txtColor);
-#if defined(Q_OS_ANDROID)
+#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
painter.drawText((labelSize.width() - valueStrWidth) / 2.0f,
(labelSize.height() - valueStrHeight) / 2.0f,
valueStrWidth, valueStrHeight,