[cairo] Cairo 1.10.0 iPhone

Pavel Kanzelsberger kanzels at gmail.com
Sun Sep 26 03:14:00 PDT 2010


Great, thanks for those tips. I'll check and will also mail you the config.log file tommorrow when I'm in the office.

Anyway meantime I notice that Cairo seems to be much faster compared to Quartz. When I compile my program with my own cairo backend on MacOSX, CPU is at 7% but when I compile it with Quartz backend CPU will go to 50-55%

I'm probably doing something wrong since Quartz is supposed to be hw accelerated and Cairo with standard image surface isn't accelerated. Maybe Quartz BitmapContext isn't accelerated as well and I should use something else....

Pavel

On 26.9.2010, at 11:57, Andrea Canciani wrote:

> On Tue, Sep 21, 2010 at 1:17 PM, Pavel Kanzelsberger <kanzels at gmail.com> wrote:
>> Hello,
>> I'm working a lot with Cairo and Quartz surfaces on MacOSX and decided to
>> port one of my projects to iPhone as well. Version compiled for iPhone
>> Simulator works perfect, but I'm now fighting with cross-compilation of
>> Cairo library to armv7 and using iPhoneOS3.2.sdk ... anybody tried this
>> already? Or is there any simplified way to achieve libcairo.a for armv7?
>> See below a script that tries to build it:
>> I'm also passing following to configure script "--enable-fc=no
>> --enable-ft=no --enable-xlib=no" since I'm using CoreText directlry to
>> display my texts, I'm just using Cairo as a wrapper for Quartz 2D.
>> #!/bin/sh
>> # Select the desired iPhone SDK
>> export DEVROOT=/Developer/Platforms/iPhoneOS.platform/Developer
>> export SDKROOT=$DEVROOT/SDKs/iPhoneOS3.2.sdk
>> # Set up relevant environment variables
>> export CPPFLAGS="-I$SDKROOT/usr/lib/gcc/arm-apple-darwin10/4.2.1/include/
>> -I$SDKROOT/usr/include/
>> -I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk/System/Library/Frameworks/"
>> export CFLAGS="$CPPFLAGS -arch armv7 -pipe -no-cpp-precomp -isysroot
>> $SDKROOT"
>> export CPP="$DEVROOT/usr/bin/cpp $CPPFLAGS"
>> export CXXFLAGS="$CFLAGS"
>> LIBNAME="cairo"
>> ./configure CXX=$DEVROOT/usr/bin/arm-apple-darwin10-g++-4.0.1
>> CC=$DEVROOT/usr/bin/arm-apple-darwin10-gcc-4.0.1 LD=$DEVROOT/usr/bin/ld
>> --host=arm-apple-darwin $1 $2 $3 $4 $5 $6
>> make
>> 
>> 
>> 
>> Configure will complain these:
>> checking ApplicationServices/ApplicationServices.h usability... no
>> checking ApplicationServices/ApplicationServices.h presence... no
>> checking for ApplicationServices/ApplicationServices.h... no
>> checking CoreGraphics/CoreGraphics.h usability... yes
>> checking CoreGraphics/CoreGraphics.h presence... no
>> configure: WARNING: CoreGraphics/CoreGraphics.h: accepted by the compiler,
>> rejected by the preprocessor!
>> configure: WARNING: CoreGraphics/CoreGraphics.h: proceeding with the
>> compiler's result
>> checking for CoreGraphics/CoreGraphics.h... yes
>> checking whether cairo's Quartz surface backend feature could be enabled...
>> no (requires ApplicationServices framework)
>> checking for cairo's Quartz font backend feature...
>> checking whether cairo's Quartz font backend feature could be enabled... no
>> (requires ApplicationServices framework)
> 
> config.log will contain additional informations about what exactly fails in the
> automatic detection of the availability of CoreGraphics.
> 
> On MacOS X 10.6 CoreGraphics is provided by ApplicationServices, but
> on iOS it should be in its own framework.
> 
> It looks like both configure.ac and src/cairo-quartz.h will need to be fixed to
> work as expected on iOS.
> 
> I will try to make cairo work on iOS soon-ish, but in the meantime I would
> be happy to review patches to fix the build process.
> 
> I would also like to see the config.log and the make warning/errors (expecially
> because cairo should compile even if you disable all the native backends).
> 
> Andrea



More information about the cairo mailing list