summaryrefslogtreecommitdiff
path: root/canvas
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2011-07-21 18:56:16 +0200
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2011-07-21 18:56:16 +0200
commita233dac0653f3f3054f7ad2da114ed989747e89a (patch)
treebf1e11438321c06125a94308649c496648061ccb /canvas
parentacb6133d89abe071108577f821d7eaa381378879 (diff)
parente5647de7dd26775e45af24f11ac4f82a5518bd9e (diff)
resyncing to master
Diffstat (limited to 'canvas')
-rw-r--r--canvas/prj/build.lst2
-rw-r--r--canvas/prj/d.lst1
-rw-r--r--canvas/source/cairo/cairo_canvashelper.cxx10
-rw-r--r--canvas/source/cairo/cairo_quartz_cairo.cxx15
-rw-r--r--canvas/source/cairo/cairo_quartz_cairo.hxx6
-rw-r--r--canvas/source/cairo/cairo_spritecanvashelper.cxx4
-rw-r--r--canvas/source/cairo/cairo_textlayout.cxx7
-rw-r--r--canvas/source/factory/cf_service.cxx6
8 files changed, 31 insertions, 20 deletions
diff --git a/canvas/prj/build.lst b/canvas/prj/build.lst
index 79acfc94af5f..7d6a51be6a5f 100644
--- a/canvas/prj/build.lst
+++ b/canvas/prj/build.lst
@@ -1,3 +1,3 @@
-cv canvas : javaunohelper comphelper cppuhelper offuh unoil tools svtools vcl basegfx CAIRO:cairo LIBXSLT:libxslt NULL
+cv canvas : javaunohelper comphelper cppuhelper offapi unoil tools svtools vcl basegfx CAIRO:cairo LIBXSLT:libxslt NULL
cv canvas\prj nmake - all cv_prj NULL
diff --git a/canvas/prj/d.lst b/canvas/prj/d.lst
index e69de29bb2d1..cde5ebec26c2 100644
--- a/canvas/prj/d.lst
+++ b/canvas/prj/d.lst
@@ -0,0 +1 @@
+..\%__SRC%\lib\*.a %_DEST%\lib\*.a
diff --git a/canvas/source/cairo/cairo_canvashelper.cxx b/canvas/source/cairo/cairo_canvashelper.cxx
index 2f1e39b8a19e..ebf0e1aac3e4 100644
--- a/canvas/source/cairo/cairo_canvashelper.cxx
+++ b/canvas/source/cairo/cairo_canvashelper.cxx
@@ -128,13 +128,11 @@ namespace cairocanvas
{
if( rColor.getLength() > 3 )
{
- const double alpha = rColor[3];
-
cairo_set_source_rgba( pCairo,
- alpha*rColor[0],
- alpha*rColor[1],
- alpha*rColor[2],
- alpha );
+ rColor[0],
+ rColor[1],
+ rColor[2],
+ rColor[3] );
}
else if( rColor.getLength() == 3 )
cairo_set_source_rgb( pCairo,
diff --git a/canvas/source/cairo/cairo_quartz_cairo.cxx b/canvas/source/cairo/cairo_quartz_cairo.cxx
index e24ba9c3ab80..23702f64b3ac 100644
--- a/canvas/source/cairo/cairo_quartz_cairo.cxx
+++ b/canvas/source/cairo/cairo_quartz_cairo.cxx
@@ -29,9 +29,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_canvas.hxx"
-#ifdef QUARTZ
+#if defined QUARTZ || defined IOS
/************************************************************************
- * Mac OS X/Quartz surface backend for OpenOffice.org Cairo Canvas *
+ * Mac OS X/Quartz and iOS surface backend for OpenOffice.org Cairo Canvas *
************************************************************************/
#include <osl/diagnose.h>
@@ -205,13 +205,19 @@ namespace cairo
CGContextRef mrContext = getCGContext();
if (!mrContext) return;
-
+#ifndef IOS
[mpView lockFocus];
+#endif
+#ifndef IOS
/**
* This code is using same screen update code as in VCL (esp. AquaSalGraphics::UpdateWindow() )
*/
CGContextRef rViewContext = reinterpret_cast<CGContextRef>([[NSGraphicsContext currentContext] graphicsPort]);
+#else
+ // Just guessing for now...
+ CGContextRef rViewContext = UIGraphicsGetCurrentContext();
+#endif
CGImageRef xImage = CGBitmapContextCreateImage(mrContext);
CGContextDrawImage(rViewContext,
CGRectMake( 0, 0,
@@ -220,8 +226,9 @@ namespace cairo
xImage);
CGImageRelease( xImage );
CGContextFlush( rViewContext );
-
+#ifndef IOS
[mpView unlockFocus];
+#endif
}
/**
diff --git a/canvas/source/cairo/cairo_quartz_cairo.hxx b/canvas/source/cairo/cairo_quartz_cairo.hxx
index 0c6a7d56db95..5d131d735ab9 100644
--- a/canvas/source/cairo/cairo_quartz_cairo.hxx
+++ b/canvas/source/cairo/cairo_quartz_cairo.hxx
@@ -32,7 +32,13 @@
#include "cairo_cairo.hxx"
#include "premac.h"
+#include <TargetConditionals.h>
+#if !defined(TARGET_OS_IPHONE) || !TARGET_OS_IPHONE
#include <Cocoa/Cocoa.h>
+#else
+#include <UIKit/UIKit.h>
+#define NSView UIView
+#endif
#include <cairo-quartz.h>
#include "postmac.h"
diff --git a/canvas/source/cairo/cairo_spritecanvashelper.cxx b/canvas/source/cairo/cairo_spritecanvashelper.cxx
index cdac16cbf8b7..75a8884df252 100644
--- a/canvas/source/cairo/cairo_spritecanvashelper.cxx
+++ b/canvas/source/cairo/cairo_spritecanvashelper.cxx
@@ -524,8 +524,8 @@ namespace cairocanvas
::cairo::SurfaceSharedPtr SpriteCanvasHelper::getCompositingSurface( const ::basegfx::B2ISize& rNeededSize )
{
- if( rNeededSize.getX() < maCompositingSurfaceSize.getX() ||
- rNeededSize.getY() < maCompositingSurfaceSize.getY() )
+ if( rNeededSize.getX() > maCompositingSurfaceSize.getX() ||
+ rNeededSize.getY() > maCompositingSurfaceSize.getY() )
{
// need to give buffer more size
mpCompositingSurface.reset();
diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx
index 9c1501a8245b..eb5a3358b460 100644
--- a/canvas/source/cairo/cairo_textlayout.cxx
+++ b/canvas/source/cairo/cairo_textlayout.cxx
@@ -352,7 +352,7 @@ namespace cairocanvas
**/
bool TextLayout::isCairoRenderable(SystemFontData aSysFontData) const
{
-#if defined UNX && !defined QUARTZ
+#if defined UNX && !defined QUARTZ && !defined IOS
// is font usable?
if (!aSysFontData.nFontId) return false;
#endif
@@ -502,9 +502,14 @@ namespace cairocanvas
cairo_font_face_t* font_face = NULL;
#ifdef CAIRO_HAS_QUARTZ_SURFACE
+
+ #ifdef QUARTZ
// TODO: use cairo_quartz_font_face_create_for_cgfont(cgFont)
// when CGFont (Mac OS X 10.5 API) is provided by the AQUA VCL backend.
font_face = cairo_quartz_font_face_create_for_atsu_font_id((ATSUFontID) rSysFontData.aATSUFontID);
+ #else // iOS
+ font_face = cairo_quartz_font_face_create_for_cgfont( rSysFontData.rFont);
+ #endif
#elif defined CAIRO_HAS_WIN32_SURFACE
#if (OSL_DEBUG_LEVEL > 1)
diff --git a/canvas/source/factory/cf_service.cxx b/canvas/source/factory/cf_service.cxx
index e96f31f5ba7a..316c4b7aecff 100644
--- a/canvas/source/factory/cf_service.cxx
+++ b/canvas/source/factory/cf_service.cxx
@@ -527,12 +527,6 @@ const ::cppu::ImplementationEntry s_entries [] = {
extern "C" {
-SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
- const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ )
-{
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
-}
-
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
sal_Char const * pImplName,
lang::XMultiServiceFactory * pServiceManager,