Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #1275 from sebastic/arm
Browse files Browse the repository at this point in the history
Support building QGIS on ARM (#9917)
  • Loading branch information
jef-n committed Mar 28, 2014
2 parents a82aeb0 + 3d44c59 commit c324895
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 5 deletions.
5 changes: 5 additions & 0 deletions python/CMakeLists.txt
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion python/core/composer/qgscomposerscalebar.sip
Expand Up @@ -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

Expand Down
4 changes: 3 additions & 1 deletion python/core/qgsclipper.sip
@@ -1,3 +1,5 @@
%Feature ARM

class QgsClipper
{
%TypeHeaderCode
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/app/gps/qwtpolar-1.0/qwt_polar_curve.cpp
Expand Up @@ -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 );
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/gps/qwtpolar-1.0/qwt_polar_layout.cpp
Expand Up @@ -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 ) )
{
Expand All @@ -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 );
}

Expand Down
11 changes: 11 additions & 0 deletions src/core/qgscoordinatetransform.cpp
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/core/qgscoordinatetransform.h
Expand Up @@ -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,
Expand Down
9 changes: 9 additions & 0 deletions src/core/qgsmaptopixel.cpp
Expand Up @@ -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
{
Expand All @@ -161,3 +169,4 @@ void QgsMapToPixel::transformInPlace( QVector<float>& x,
transformInPlace( x[i], y[i] );
}
#endif

3 changes: 3 additions & 0 deletions src/core/qgsmaptopixel.h
Expand Up @@ -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
Expand Down

0 comments on commit c324895

Please sign in to comment.