228 lines
8.4 KiB
Diff
228 lines
8.4 KiB
Diff
From 03b028dbf7c66949a1365cb6a927874c1318840e Mon Sep 17 00:00:00 2001
|
|
From: Bas Couwenberg <sebastic@xs4all.nl>
|
|
Date: Fri, 28 Mar 2014 10:37:13 +0100
|
|
Subject: [PATCH 1/3] On armel/armhf qreal is typedef'ed to float not double.
|
|
|
|
This patch adds qreal versions of some functions on arm. It was originally
|
|
writen by Konstantinos Margaritis and later fixed by Peter Michael Green.
|
|
|
|
Bug-Debian: http://bugs.debian.org/691333
|
|
---
|
|
src/core/qgscoordinatetransform.cpp | 11 +++++++++++
|
|
src/core/qgscoordinatetransform.h | 3 +++
|
|
src/core/qgsmaptopixel.cpp | 9 +++++++++
|
|
src/core/qgsmaptopixel.h | 3 +++
|
|
4 files changed, 26 insertions(+)
|
|
|
|
diff --git a/src/core/qgscoordinatetransform.cpp b/src/core/qgscoordinatetransform.cpp
|
|
index 42427f9..58fb557 100644
|
|
--- a/src/core/qgscoordinatetransform.cpp
|
|
+++ b/src/core/qgscoordinatetransform.cpp
|
|
@@ -434,6 +434,17 @@ void QgsCoordinateTransform::transformInPlace(
|
|
}
|
|
}
|
|
|
|
+#ifdef QT_ARCH_ARM
|
|
+void QgsCoordinateTransform::transformInPlace( qreal& x, qreal& y, double& z,
|
|
+ TransformDirection direction ) const
|
|
+{
|
|
+ double xd = (double) x, yd = (double) y;
|
|
+ transformInPlace(xd, yd, z, direction);
|
|
+ x=xd;
|
|
+ y=yd;
|
|
+}
|
|
+#endif
|
|
+
|
|
#ifdef ANDROID
|
|
void QgsCoordinateTransform::transformInPlace( float& x, float& y, float& z,
|
|
TransformDirection direction ) const
|
|
diff --git a/src/core/qgscoordinatetransform.h b/src/core/qgscoordinatetransform.h
|
|
index df9c314..20bb04a 100644
|
|
--- a/src/core/qgscoordinatetransform.h
|
|
+++ b/src/core/qgscoordinatetransform.h
|
|
@@ -156,6 +156,9 @@ class CORE_EXPORT QgsCoordinateTransform : public QObject
|
|
// and y variables in place. The second one works with good old-fashioned
|
|
// C style arrays.
|
|
void transformInPlace( double& x, double& y, double &z, TransformDirection direction = ForwardTransform ) const;
|
|
+#ifdef QT_ARCH_ARM
|
|
+ void transformInPlace( qreal& x, qreal& y, double &z, TransformDirection direction = ForwardTransform ) const;
|
|
+#endif
|
|
|
|
//! @note not available in python bindings
|
|
void transformInPlace( QVector<double>& x, QVector<double>& y, QVector<double>& z,
|
|
diff --git a/src/core/qgsmaptopixel.cpp b/src/core/qgsmaptopixel.cpp
|
|
index 6dff6f1..fab4848 100644
|
|
--- a/src/core/qgsmaptopixel.cpp
|
|
+++ b/src/core/qgsmaptopixel.cpp
|
|
@@ -138,6 +138,14 @@ void QgsMapToPixel::transformInPlace( double& x, double& y ) const
|
|
y = yMax - ( y - yMin ) / mMapUnitsPerPixel;
|
|
}
|
|
|
|
+#ifdef QT_ARCH_ARM
|
|
+void QgsMapToPixel::transformInPlace( qreal& x, qreal& y ) const
|
|
+{
|
|
+ x = ( x - xMin ) / mMapUnitsPerPixel;
|
|
+ y = yMax - ( y - yMin ) / mMapUnitsPerPixel;
|
|
+}
|
|
+#endif
|
|
+
|
|
void QgsMapToPixel::transformInPlace( QVector<double>& x,
|
|
QVector<double>& y ) const
|
|
{
|
|
@@ -161,3 +169,4 @@ void QgsMapToPixel::transformInPlace( QVector<float>& x,
|
|
transformInPlace( x[i], y[i] );
|
|
}
|
|
#endif
|
|
+
|
|
diff --git a/src/core/qgsmaptopixel.h b/src/core/qgsmaptopixel.h
|
|
index fb3c317..8377282 100644
|
|
--- a/src/core/qgsmaptopixel.h
|
|
+++ b/src/core/qgsmaptopixel.h
|
|
@@ -66,6 +66,9 @@ class CORE_EXPORT QgsMapToPixel
|
|
given coordinates in place. Intended as a fast way to do the
|
|
transform. */
|
|
void transformInPlace( double& x, double& y ) const;
|
|
+#ifdef QT_ARCH_ARM
|
|
+ void transformInPlace( qreal& x, qreal& y ) const;
|
|
+#endif
|
|
|
|
/* Transform device coordinates to map coordinates. Modifies the
|
|
given coordinates in place. Intended as a fast way to do the
|
|
--
|
|
1.8.5.5
|
|
|
|
|
|
From 7db6ae54124a2f2213c0609490904653c6c798af Mon Sep 17 00:00:00 2001
|
|
From: Bas Couwenberg <sebastic@xs4all.nl>
|
|
Date: Fri, 28 Mar 2014 10:39:35 +0100
|
|
Subject: [PATCH 2/3] Fix qreal vs double.
|
|
|
|
In qt4 on arm architectures qreal is defined as float while on other
|
|
architectures it is defined as double. This can cause problems if qreal
|
|
and double are carelessly mixed.
|
|
|
|
In this particular case the problem is that qMin/qMax are templates defined
|
|
to take two parameters of the same type. If two different types are passed
|
|
in then C++ can't resolve what type the template parameter should be and
|
|
bails out. The fix is simple, typecast one of the parameters so they
|
|
match.
|
|
|
|
Author: Peter Michael Green <plugwash@debian.org>
|
|
Bug-Debian: http://bugs.debian.org/737814
|
|
---
|
|
src/app/gps/qwtpolar-1.0/qwt_polar_curve.cpp | 2 +-
|
|
src/app/gps/qwtpolar-1.0/qwt_polar_layout.cpp | 4 ++--
|
|
2 files changed, 3 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/src/app/gps/qwtpolar-1.0/qwt_polar_curve.cpp b/src/app/gps/qwtpolar-1.0/qwt_polar_curve.cpp
|
|
index d63206a..7c18777 100644
|
|
--- a/src/app/gps/qwtpolar-1.0/qwt_polar_curve.cpp
|
|
+++ b/src/app/gps/qwtpolar-1.0/qwt_polar_curve.cpp
|
|
@@ -433,7 +433,7 @@ void QwtPolarCurve::drawLines( QPainter *painter,
|
|
|
|
if ( !clipRect.isEmpty() )
|
|
{
|
|
- double off = qCeil( qMax( 1.0, painter->pen().widthF() ) );
|
|
+ double off = qCeil( qMax((qreal)1.0,painter->pen().widthF() ) );
|
|
clipRect = clipRect.toRect().adjusted( -off, -off, off, off );
|
|
polyline = QwtClipper::clipPolygonF( clipRect, polyline );
|
|
}
|
|
diff --git a/src/app/gps/qwtpolar-1.0/qwt_polar_layout.cpp b/src/app/gps/qwtpolar-1.0/qwt_polar_layout.cpp
|
|
index 1db2379..b4a43b0 100644
|
|
--- a/src/app/gps/qwtpolar-1.0/qwt_polar_layout.cpp
|
|
+++ b/src/app/gps/qwtpolar-1.0/qwt_polar_layout.cpp
|
|
@@ -278,7 +278,7 @@ QRectF QwtPolarLayout::layoutLegend( Options options, QRectF &rect ) const
|
|
// We don't allow vertical legends to take more than
|
|
// half of the available space.
|
|
|
|
- dim = qMin( hint.width(), rect.width() * d_data->legendRatio );
|
|
+ dim = qMin( hint.width(), (qreal)(rect.width() * d_data->legendRatio) );
|
|
|
|
if ( !( options & IgnoreScrollbars ) )
|
|
{
|
|
@@ -293,7 +293,7 @@ QRectF QwtPolarLayout::layoutLegend( Options options, QRectF &rect ) const
|
|
}
|
|
else
|
|
{
|
|
- dim = qMin( hint.height(), rect.height() * d_data->legendRatio );
|
|
+ dim = qMin( hint.height(), (qreal)(rect.height() * d_data->legendRatio) );
|
|
dim = qMax( dim, d_data->layoutData.legend.hScrollBarHeight );
|
|
}
|
|
|
|
--
|
|
1.8.5.5
|
|
|
|
|
|
From 3d44c5934aba0c4a1e0919549f50f1650140de57 Mon Sep 17 00:00:00 2001
|
|
From: Bas Couwenberg <sebastic@xs4all.nl>
|
|
Date: Fri, 28 Mar 2014 10:41:22 +0100
|
|
Subject: [PATCH 3/3] Disable features on ARM.
|
|
|
|
Building QGIS on ARM produces the error:
|
|
|
|
sip: qgis/python/core/qgsclipper.sip:44: \
|
|
QgsClipper::trimFeature() unsupported function argument type - provide %MethodCode and a C++ signature
|
|
|
|
For the Android builds this was fixed in commit 2cc684793ceb29d8600d71564fb38f92c998f588.
|
|
|
|
This patch adapts the Android fix, by disabling the SIP features on all ARM systems.
|
|
|
|
Bug-Debian: http://bugs.debian.org/737814
|
|
---
|
|
python/CMakeLists.txt | 5 +++++
|
|
python/core/composer/qgscomposerscalebar.sip | 2 +-
|
|
python/core/qgsclipper.sip | 4 +++-
|
|
3 files changed, 9 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
|
|
index 044f65e..158e4fa 100644
|
|
--- a/python/CMakeLists.txt
|
|
+++ b/python/CMakeLists.txt
|
|
@@ -55,6 +55,11 @@ IF(NOT ANDROID)
|
|
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} ANDROID)
|
|
ENDIF(NOT ANDROID)
|
|
|
|
+IF(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
|
|
+ELSE(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
|
|
+ SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} ARM)
|
|
+ENDIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
|
|
+
|
|
IF(NOT WITH_TOUCH)
|
|
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} HAVE_TOUCH)
|
|
ENDIF(NOT WITH_TOUCH)
|
|
diff --git a/python/core/composer/qgscomposerscalebar.sip b/python/core/composer/qgscomposerscalebar.sip
|
|
index 727c10f..9a0e034 100644
|
|
--- a/python/core/composer/qgscomposerscalebar.sip
|
|
+++ b/python/core/composer/qgscomposerscalebar.sip
|
|
@@ -109,7 +109,7 @@ class QgsComposerScaleBar: QgsComposerItem
|
|
of the segment
|
|
@note python bindings not available on android
|
|
*/
|
|
-%If (!ANDROID)
|
|
+%If (!ARM)
|
|
void segmentPositions( QList<QPair<double, double> >& posWidthList ) const;
|
|
%End
|
|
|
|
diff --git a/python/core/qgsclipper.sip b/python/core/qgsclipper.sip
|
|
index 847123c..90c920b 100644
|
|
--- a/python/core/qgsclipper.sip
|
|
+++ b/python/core/qgsclipper.sip
|
|
@@ -1,3 +1,5 @@
|
|
+%Feature ARM
|
|
+
|
|
class QgsClipper
|
|
{
|
|
%TypeHeaderCode
|
|
@@ -34,7 +36,7 @@ class QgsClipper
|
|
// A handy way to refer to the four boundaries
|
|
enum Boundary {XMax, XMin, YMax, YMin};
|
|
|
|
-%If (!ANDROID)
|
|
+%If (!ARM)
|
|
// Trims the given feature to a rectangular box. Returns the trimmed
|
|
// feature in x and y. The shapeOpen parameter determines whether
|
|
// the function treats the points as a closed shape (polygon), or as
|
|
--
|
|
1.8.5.5
|
|
|