build cairo on android
Change-Id: Ie2f7662a4cc3955963517f265894b8f6a495ece8 Reviewed-on: https://gerrit.libreoffice.org/19991 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
parent
dc65f048fd
commit
fb7d4ba1cb
@ -1272,6 +1272,24 @@ endef
|
||||
|
||||
endif # SYSTEM_CAIRO
|
||||
|
||||
else ifeq ($(OS),ANDROID)
|
||||
|
||||
define gb_LinkTarget__use_cairo
|
||||
$(call gb_LinkTarget_use_package,$(1),cairo)
|
||||
$(call gb_LinkTarget_use_package,$(1),pixman)
|
||||
$(call gb_LinkTarget_use_external,$(1),freetype_headers)
|
||||
$(call gb_LinkTarget_set_include,$(1),\
|
||||
-I$(call gb_UnpackedTarball_get_dir,cairo) \
|
||||
-I$(call gb_UnpackedTarball_get_dir,cairo)/src \
|
||||
$$(INCLUDE) \
|
||||
)
|
||||
$(call gb_LinkTarget_add_libs,$(1),\
|
||||
-L$(call gb_UnpackedTarball_get_dir,cairo)/src/.libs -lcairo \
|
||||
-L$(call gb_UnpackedTarball_get_dir,pixman)/pixman/.libs -lpixman-1 \
|
||||
)
|
||||
|
||||
endef
|
||||
|
||||
endif # CAIRO
|
||||
|
||||
ifneq ($(SYSTEM_FREETYPE),)
|
||||
|
@ -39,6 +39,8 @@ ANDROID)
|
||||
oslibs="$WORKDIR/UnpackedTarball/curl/lib/.libs/*.a"
|
||||
oslibs="$oslibs $WORKDIR/UnpackedTarball/fontconfig/src/.libs/libfontconfig.a"
|
||||
oslibs="$oslibs $WORKDIR/UnpackedTarball/freetype/objs/.libs/libfreetype.a"
|
||||
oslibs="$oslibs $WORKDIR/UnpackedTarball/pixman/pixman/.libs/libpixman-1.a"
|
||||
oslibs="$oslibs $WORKDIR/UnpackedTarball/cairo/src/.libs/libcairo.a"
|
||||
# Only liblo-bootstrap.a ends up here:
|
||||
oslibs="$oslibs $WORKDIR/LinkTarget/Library/lib*.a"
|
||||
;;
|
||||
|
@ -828,7 +828,7 @@ linux-android*)
|
||||
fi
|
||||
|
||||
AC_DEFINE(HAVE_FT_FACE_GETCHARVARIANTINDEX)
|
||||
BUILD_TYPE="$BUILD_TYPE FONTCONFIG FREETYPE"
|
||||
BUILD_TYPE="$BUILD_TYPE CAIRO FONTCONFIG FREETYPE"
|
||||
;;
|
||||
|
||||
emscripten*)
|
||||
|
4
external/cairo/ExternalPackage_cairo.mk
vendored
4
external/cairo/ExternalPackage_cairo.mk
vendored
@ -11,6 +11,10 @@ $(eval $(call gb_ExternalPackage_ExternalPackage,cairo,cairo))
|
||||
|
||||
$(eval $(call gb_ExternalPackage_use_external_project,cairo,cairo))
|
||||
|
||||
ifneq ($(OS),ANDROID)
|
||||
|
||||
$(eval $(call gb_ExternalPackage_add_file,cairo,$(LIBO_LIB_FOLDER)/libcairo.so.2,src/.libs/libcairo.so.2.11000.2))
|
||||
|
||||
endif
|
||||
|
||||
# vim: set noet sw=4 ts=4:
|
||||
|
5
external/cairo/ExternalPackage_pixman.mk
vendored
5
external/cairo/ExternalPackage_pixman.mk
vendored
@ -11,6 +11,11 @@ $(eval $(call gb_ExternalPackage_ExternalPackage,pixman,pixman))
|
||||
|
||||
$(eval $(call gb_ExternalPackage_use_external_project,pixman,pixman))
|
||||
|
||||
ifneq ($(OS),ANDROID)
|
||||
|
||||
$(eval $(call gb_ExternalPackage_add_file,pixman,$(LIBO_LIB_FOLDER)/libpixman-1.so.0,pixman/.libs/libpixman-1.so.0.24.4))
|
||||
|
||||
endif
|
||||
|
||||
|
||||
# vim: set noet sw=4 ts=4:
|
||||
|
5
external/cairo/ExternalProject_cairo.mk
vendored
5
external/cairo/ExternalProject_cairo.mk
vendored
@ -32,7 +32,7 @@ $(call gb_ExternalProject_get_state_target,cairo,build) :
|
||||
$(call gb_ExternalProject_run,build,\
|
||||
./configure \
|
||||
$(if $(debug),STRIP=" ") \
|
||||
CFLAGS="$(if $(debug),-g) $(ZLIB_CFLAGS)" \
|
||||
CFLAGS="$(if $(debug),-g) $(ZLIB_CFLAGS) $(gb_VISIBILITY_FLAGS)" \
|
||||
$(if $(filter ANDROID IOS,$(OS)),PKG_CONFIG=./dummy_pkg_config) \
|
||||
pixman_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,pixman)/pixman" \
|
||||
pixman_LIBS="-L$(call gb_UnpackedTarball_get_dir,pixman)/pixman/.libs -lpixman-1" \
|
||||
@ -40,7 +40,10 @@ $(call gb_ExternalProject_get_state_target,cairo,build) :
|
||||
ZLIB3RDLIB="$(if $(SYSTEM_ZLIB),,-L$(WORKDIR)/LinkTarget/StaticLibrary) -lz" \
|
||||
png_REQUIRES="trick_configure_into_using_png_CFLAGS_and_LIBS" \
|
||||
png_CFLAGS="$(LIBPNG_CFLAGS)" png_LIBS="$(LIBPNG_LIBS)" \
|
||||
FREETYPE_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,freetype)/include" \
|
||||
FONTCONFIG_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,fontconfig)" \
|
||||
$(if $(filter IOS,$(OS)),--disable-shared,--disable-static) \
|
||||
$(if $(filter ANDROID,$(OS)),--disable-shared,--disable-static) \
|
||||
$(if $(filter ANDROID IOS,$(OS)),--disable-xlib,--enable-xlib) \
|
||||
$(if $(filter IOS,$(OS)),--enable-quartz --enable-quartz-font) \
|
||||
--disable-valgrind \
|
||||
|
2
external/cairo/ExternalProject_pixman.mk
vendored
2
external/cairo/ExternalProject_pixman.mk
vendored
@ -32,7 +32,7 @@ else
|
||||
$(call gb_ExternalProject_get_state_target,pixman,build) :
|
||||
$(call gb_ExternalProject_run,build,\
|
||||
./configure \
|
||||
$(if $(filter MACOSX IOS,$(OS)),--disable-shared,--disable-static) \
|
||||
$(if $(filter MACOSX IOS ANDROID,$(OS)),--disable-shared,--disable-static) \
|
||||
$(if $(filter ANDROID,$(OS)),--disable-arm-simd --disable-arm-neon --disable-arm-iwmmxt) \
|
||||
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
|
||||
&& $(MAKE) \
|
||||
|
@ -624,6 +624,7 @@ $(eval $(call gb_Library_use_libraries,vcl,\
|
||||
))
|
||||
|
||||
$(eval $(call gb_Library_use_externals,vcl,\
|
||||
cairo \
|
||||
freetype \
|
||||
))
|
||||
ifneq ($(OS),EMSCRIPTEN)
|
||||
@ -654,6 +655,7 @@ $(eval $(call gb_Library_use_static_libraries,vcl,\
|
||||
))
|
||||
|
||||
$(eval $(call gb_Library_use_externals,vcl,\
|
||||
cairo \
|
||||
fontconfig \
|
||||
freetype \
|
||||
expat \
|
||||
|
@ -33,9 +33,7 @@
|
||||
#include <basegfx/polygon/b2dpolygontools.hxx>
|
||||
#include <basebmp/scanlineformats.hxx>
|
||||
|
||||
#if ENABLE_CAIRO_CANVAS
|
||||
#include <cairo.h>
|
||||
#endif
|
||||
|
||||
#if OSL_DEBUG_LEVEL > 2
|
||||
#include <basebmp/debug.hxx>
|
||||
@ -95,8 +93,6 @@ bool SvpSalGraphics::drawTransformedBitmap(
|
||||
return false;
|
||||
}
|
||||
|
||||
#if ENABLE_CAIRO_CANVAS
|
||||
|
||||
namespace
|
||||
{
|
||||
bool isCairoCompatible(const basebmp::BitmapDeviceSharedPtr &rBuffer)
|
||||
@ -134,18 +130,15 @@ void SvpSalGraphics::clipRegion(cairo_t* cr)
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
bool SvpSalGraphics::drawAlphaRect(long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency)
|
||||
{
|
||||
bool bRet = false;
|
||||
(void)nX; (void)nY; (void)nWidth; (void)nHeight; (void)nTransparency;
|
||||
#if ENABLE_CAIRO_CANVAS
|
||||
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 10, 0)
|
||||
if (m_bUseLineColor || !m_bUseFillColor)
|
||||
return bRet;
|
||||
|
||||
cairo_t* cr = createCairoContext(m_aDevice);
|
||||
cairo_t* cr = getCairoContext();
|
||||
if (!cr)
|
||||
return bRet;
|
||||
|
||||
@ -194,7 +187,6 @@ bool SvpSalGraphics::drawAlphaRect(long nX, long nY, long nWidth, long nHeight,
|
||||
extents.y + extents.height));
|
||||
}
|
||||
bRet = true;
|
||||
#endif
|
||||
#endif
|
||||
return bRet;
|
||||
}
|
||||
@ -817,8 +809,6 @@ bool SvpSalGraphics::drawEPS( long, long, long, long, void*, sal_uLong )
|
||||
return false;
|
||||
}
|
||||
|
||||
#if ENABLE_CAIRO_CANVAS
|
||||
|
||||
cairo_t* SvpSalGraphics::createCairoContext(const basebmp::BitmapDeviceSharedPtr &rBuffer)
|
||||
{
|
||||
if (!isCairoCompatible(rBuffer))
|
||||
@ -838,6 +828,12 @@ cairo_t* SvpSalGraphics::createCairoContext(const basebmp::BitmapDeviceSharedPtr
|
||||
return cr;
|
||||
}
|
||||
|
||||
cairo_t* SvpSalGraphics::getCairoContext() const
|
||||
{
|
||||
return SvpSalGraphics::createCairoContext(m_aOrigDevice);
|
||||
}
|
||||
|
||||
#if ENABLE_CAIRO_CANVAS
|
||||
bool SvpSalGraphics::SupportsCairo() const
|
||||
{
|
||||
return false;
|
||||
@ -874,14 +870,9 @@ SystemGraphicsData SvpSalGraphics::GetGraphicsData() const
|
||||
|
||||
bool SvpSalGraphics::supportsOperation(OutDevSupportType eType) const
|
||||
{
|
||||
#if ENABLE_CAIRO_CANVAS
|
||||
return m_aDrawMode != basebmp::DrawMode::XOR &&
|
||||
OutDevSupport_TransparentRect == eType &&
|
||||
isCairoCompatible(m_aDevice);
|
||||
#else
|
||||
(void)eType;
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -202,13 +202,12 @@ public:
|
||||
virtual cairo::SurfaceSharedPtr CreateSurface(const OutputDevice& rRefDevice, int x, int y, int width, int height) const override;
|
||||
virtual cairo::SurfaceSharedPtr CreateBitmapSurface(const OutputDevice& rRefDevice, const BitmapSystemData& rData, const Size& rSize) const override;
|
||||
virtual css::uno::Any GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& rSurface, const basegfx::B2ISize& rSize) const override;
|
||||
|
||||
virtual SystemFontData GetSysFontData( int nFallbacklevel ) const override;
|
||||
#endif // ENABLE_CAIRO_CANVAS
|
||||
|
||||
cairo_t* getCairoContext() const;
|
||||
static cairo_t* createCairoContext(const basebmp::BitmapDeviceSharedPtr& rBuffer);
|
||||
void clipRegion(cairo_t* cr);
|
||||
|
||||
#endif // ENABLE_CAIRO_CANVAS
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -59,8 +59,6 @@ public:
|
||||
static void refreshFontconfig( GtkSettings *pSettings );
|
||||
static void signalSettingsNotify( GObject*, GParamSpec *pSpec, gpointer );
|
||||
|
||||
cairo_t* getCairoContext() const;
|
||||
|
||||
virtual void GetResolution(sal_Int32& rDPIX, sal_Int32& rDPIY) override;
|
||||
private:
|
||||
GtkWidget *mpWindow;
|
||||
|
@ -8,34 +8,35 @@
|
||||
*/
|
||||
|
||||
#include "gtk3cairotextrender.hxx"
|
||||
#include "headless/svpgdi.hxx"
|
||||
|
||||
GtkCairoTextRender::GtkCairoTextRender(GtkSalGraphics& rParent)
|
||||
SvpCairoTextRender::SvpCairoTextRender(SvpSalGraphics& rParent)
|
||||
: mrParent(rParent)
|
||||
{
|
||||
}
|
||||
|
||||
GlyphCache& GtkCairoTextRender::getPlatformGlyphCache()
|
||||
GlyphCache& SvpCairoTextRender::getPlatformGlyphCache()
|
||||
{
|
||||
return SvpSalGraphics::getPlatformGlyphCache();
|
||||
}
|
||||
|
||||
cairo_t* GtkCairoTextRender::getCairoContext()
|
||||
cairo_t* SvpCairoTextRender::getCairoContext()
|
||||
{
|
||||
return mrParent.getCairoContext();
|
||||
}
|
||||
|
||||
void GtkCairoTextRender::getSurfaceOffset(double& nDX, double& nDY)
|
||||
void SvpCairoTextRender::getSurfaceOffset(double& nDX, double& nDY)
|
||||
{
|
||||
nDX = 0;
|
||||
nDY = 0;
|
||||
}
|
||||
|
||||
void GtkCairoTextRender::clipRegion(cairo_t* cr)
|
||||
void SvpCairoTextRender::clipRegion(cairo_t* cr)
|
||||
{
|
||||
mrParent.clipRegion(cr);
|
||||
}
|
||||
|
||||
void GtkCairoTextRender::drawSurface(cairo_t* /*cr*/)
|
||||
void SvpCairoTextRender::drawSurface(cairo_t* /*cr*/)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -11,15 +11,16 @@
|
||||
#define INCLUDED_VCL_UNX_GTK3_GDI_GTK3CAIROTEXTRENDER_HXX
|
||||
|
||||
#include "cairotextrender.hxx"
|
||||
#include <unx/gtk/gtkgdi.hxx>
|
||||
|
||||
class GtkCairoTextRender : public CairoTextRender
|
||||
class SvpSalGraphics;
|
||||
|
||||
class SvpCairoTextRender : public CairoTextRender
|
||||
{
|
||||
protected:
|
||||
GtkSalGraphics& mrParent;
|
||||
SvpSalGraphics& mrParent;
|
||||
|
||||
public:
|
||||
explicit GtkCairoTextRender(GtkSalGraphics& rParent);
|
||||
explicit SvpCairoTextRender(SvpSalGraphics& rParent);
|
||||
|
||||
virtual GlyphCache& getPlatformGlyphCache() override;
|
||||
virtual cairo_t* getCairoContext() override;
|
||||
|
@ -1999,7 +1999,7 @@ GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow )
|
||||
mpFrame( pFrame ),
|
||||
mpWindow( pWindow )
|
||||
{
|
||||
m_xTextRenderImpl.reset(new GtkCairoTextRender(*this));
|
||||
m_xTextRenderImpl.reset(new SvpCairoTextRender(*this));
|
||||
|
||||
if(style_loaded)
|
||||
return;
|
||||
@ -2124,11 +2124,6 @@ GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow )
|
||||
gtk_widget_show_all(gDumbContainer);
|
||||
}
|
||||
|
||||
cairo_t* GtkSalGraphics::getCairoContext() const
|
||||
{
|
||||
return mpFrame->getCairoContext();
|
||||
}
|
||||
|
||||
void GtkSalGraphics::GetResolution(sal_Int32& rDPIX, sal_Int32& rDPIY)
|
||||
{
|
||||
char* pForceDpi;
|
||||
|
Loading…
x
Reference in New Issue
Block a user