move cairo helpers to vcl and make per-plug
Change-Id: I4de4d5c3a191784598e93a8cf70e45a3f59ae857 Reviewed-on: https://gerrit.libreoffice.org/14907 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
@@ -47,7 +47,6 @@ $(eval $(call gb_Library_use_libraries,cairocanvas,\
|
|||||||
|
|
||||||
$(eval $(call gb_Library_add_exception_objects,cairocanvas,\
|
$(eval $(call gb_Library_add_exception_objects,cairocanvas,\
|
||||||
canvas/source/cairo/cairo_cachedbitmap \
|
canvas/source/cairo/cairo_cachedbitmap \
|
||||||
canvas/source/cairo/cairo_cairo \
|
|
||||||
canvas/source/cairo/cairo_canvas \
|
canvas/source/cairo/cairo_canvas \
|
||||||
canvas/source/cairo/cairo_canvasbitmap \
|
canvas/source/cairo/cairo_canvasbitmap \
|
||||||
canvas/source/cairo/cairo_canvascustomsprite \
|
canvas/source/cairo/cairo_canvascustomsprite \
|
||||||
@@ -68,35 +67,4 @@ $(eval $(call gb_Library_use_externals,cairocanvas,\
|
|||||||
cairo \
|
cairo \
|
||||||
))
|
))
|
||||||
|
|
||||||
ifeq ($(OS),WNT)
|
|
||||||
|
|
||||||
$(eval $(call gb_Library_add_exception_objects,cairocanvas,\
|
|
||||||
canvas/source/cairo/cairo_win32_cairo \
|
|
||||||
))
|
|
||||||
$(eval $(call gb_Library_use_libraries,cairocanvas,\
|
|
||||||
gdi32 \
|
|
||||||
))
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
ifneq (,$(filter MACOSX IOS,$(OS)))
|
|
||||||
$(eval $(call gb_Library_add_exception_objects,cairocanvas,\
|
|
||||||
canvas/source/cairo/cairo_quartz_cairo \
|
|
||||||
))
|
|
||||||
else ifeq ($(GUIBASE),unx)
|
|
||||||
$(eval $(call gb_Library_add_exception_objects,cairocanvas,\
|
|
||||||
canvas/source/cairo/cairo_xlib_cairo \
|
|
||||||
))
|
|
||||||
|
|
||||||
# freetype? fontconfig? -> test on Solaris
|
|
||||||
$(eval $(call gb_Library_add_libs,cairocanvas,\
|
|
||||||
-lX11 \
|
|
||||||
))
|
|
||||||
$(eval $(call gb_Library_use_externals,cairocanvas,\
|
|
||||||
Xrender \
|
|
||||||
))
|
|
||||||
endif
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
# vim: set noet sw=4 ts=4:
|
# vim: set noet sw=4 ts=4:
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#include <canvas/base/cachedprimitivebase.hxx>
|
#include <canvas/base/cachedprimitivebase.hxx>
|
||||||
|
|
||||||
#include "cairo_cairo.hxx"
|
#include <vcl/cairo.hxx>
|
||||||
|
|
||||||
/* Definition of CachedBitmap class */
|
/* Definition of CachedBitmap class */
|
||||||
|
|
||||||
|
@@ -138,7 +138,7 @@ namespace cairocanvas
|
|||||||
return maDeviceHelper.getSurface();
|
return maDeviceHelper.getSurface();
|
||||||
}
|
}
|
||||||
|
|
||||||
SurfaceSharedPtr Canvas::createSurface( const ::basegfx::B2ISize& rSize, Content aContent )
|
SurfaceSharedPtr Canvas::createSurface( const ::basegfx::B2ISize& rSize, int aContent )
|
||||||
{
|
{
|
||||||
return maDeviceHelper.createSurface( rSize, aContent );
|
return maDeviceHelper.createSurface( rSize, aContent );
|
||||||
}
|
}
|
||||||
|
@@ -135,7 +135,7 @@ namespace cairocanvas
|
|||||||
|
|
||||||
// SurfaceProvider
|
// SurfaceProvider
|
||||||
virtual ::cairo::SurfaceSharedPtr getSurface() SAL_OVERRIDE;
|
virtual ::cairo::SurfaceSharedPtr getSurface() SAL_OVERRIDE;
|
||||||
virtual ::cairo::SurfaceSharedPtr createSurface( const ::basegfx::B2ISize& rSize, ::cairo::Content aContent = CAIRO_CONTENT_COLOR_ALPHA ) SAL_OVERRIDE;
|
virtual ::cairo::SurfaceSharedPtr createSurface( const ::basegfx::B2ISize& rSize, int aContent = CAIRO_CONTENT_COLOR_ALPHA ) SAL_OVERRIDE;
|
||||||
virtual ::cairo::SurfaceSharedPtr createSurface( ::Bitmap& rBitmap ) SAL_OVERRIDE;
|
virtual ::cairo::SurfaceSharedPtr createSurface( ::Bitmap& rBitmap ) SAL_OVERRIDE;
|
||||||
virtual ::cairo::SurfaceSharedPtr changeSurface( bool bHasAlpha, bool bCopyContent ) SAL_OVERRIDE;
|
virtual ::cairo::SurfaceSharedPtr changeSurface( bool bHasAlpha, bool bCopyContent ) SAL_OVERRIDE;
|
||||||
virtual OutputDevice* getOutputDevice() SAL_OVERRIDE;
|
virtual OutputDevice* getOutputDevice() SAL_OVERRIDE;
|
||||||
|
@@ -27,46 +27,9 @@
|
|||||||
#include <vcl/bmpacc.hxx>
|
#include <vcl/bmpacc.hxx>
|
||||||
#include <vcl/bitmapex.hxx>
|
#include <vcl/bitmapex.hxx>
|
||||||
|
|
||||||
#ifdef CAIRO_HAS_XLIB_SURFACE
|
|
||||||
# include "cairo_xlib_cairo.hxx"
|
|
||||||
#elif defined CAIRO_HAS_QUARTZ_SURFACE
|
|
||||||
# include "cairo_quartz_cairo.hxx"
|
|
||||||
#elif defined CAIRO_HAS_WIN32_SURFACE
|
|
||||||
# include "cairo_win32_cairo.hxx"
|
|
||||||
# include <cairo-win32.h>
|
|
||||||
#else
|
|
||||||
# error Native API needed.
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ::cairo;
|
using namespace ::cairo;
|
||||||
using namespace ::com::sun::star;
|
using namespace ::com::sun::star;
|
||||||
|
|
||||||
#ifdef CAIRO_HAS_WIN32_SURFACE
|
|
||||||
namespace
|
|
||||||
{
|
|
||||||
HBITMAP surface2HBitmap( const SurfaceSharedPtr& rSurface, const basegfx::B2ISize& rSize )
|
|
||||||
{
|
|
||||||
// can't seem to retrieve HBITMAP from cairo. copy content then
|
|
||||||
HDC hScreenDC=GetDC(NULL);
|
|
||||||
HBITMAP hBmpBitmap = CreateCompatibleBitmap( hScreenDC,
|
|
||||||
rSize.getX(),
|
|
||||||
rSize.getY() );
|
|
||||||
|
|
||||||
HDC hBmpDC = CreateCompatibleDC( 0 );
|
|
||||||
HBITMAP hBmpOld = (HBITMAP) SelectObject( hBmpDC, hBmpBitmap );
|
|
||||||
|
|
||||||
BitBlt( hBmpDC, 0, 0, rSize.getX(), rSize.getX(),
|
|
||||||
cairo_win32_surface_get_dc(rSurface->getCairoSurface().get()),
|
|
||||||
0, 0, SRCCOPY );
|
|
||||||
|
|
||||||
SelectObject( hBmpDC, hBmpOld );
|
|
||||||
DeleteDC( hBmpDC );
|
|
||||||
|
|
||||||
return hBmpBitmap;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace cairocanvas
|
namespace cairocanvas
|
||||||
{
|
{
|
||||||
CanvasBitmap::CanvasBitmap( const ::basegfx::B2ISize& rSize,
|
CanvasBitmap::CanvasBitmap( const ::basegfx::B2ISize& rSize,
|
||||||
@@ -112,7 +75,7 @@ namespace cairocanvas
|
|||||||
return mpBufferSurface;
|
return mpBufferSurface;
|
||||||
}
|
}
|
||||||
|
|
||||||
SurfaceSharedPtr CanvasBitmap::createSurface( const ::basegfx::B2ISize& rSize, Content aContent )
|
SurfaceSharedPtr CanvasBitmap::createSurface( const ::basegfx::B2ISize& rSize, int aContent )
|
||||||
{
|
{
|
||||||
return mpSurfaceProvider->createSurface(rSize,aContent);
|
return mpSurfaceProvider->createSurface(rSize,aContent);
|
||||||
}
|
}
|
||||||
@@ -222,31 +185,7 @@ namespace cairocanvas
|
|||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
#ifdef CAIRO_HAS_XLIB_SURFACE
|
aRV = getOutputDevice()->GetNativeSurfaceHandle(mpBufferSurface, maSize);
|
||||||
X11Surface& rXlibSurface=dynamic_cast<X11Surface&>(*mpBufferSurface.get());
|
|
||||||
uno::Sequence< uno::Any > args( 3 );
|
|
||||||
args[0] = uno::Any( false ); // do not call XFreePixmap on it
|
|
||||||
args[1] = uno::Any( rXlibSurface.getPixmap()->mhDrawable );
|
|
||||||
args[2] = uno::Any( sal_Int32( rXlibSurface.getDepth() ) );
|
|
||||||
|
|
||||||
aRV = uno::Any( args );
|
|
||||||
#elif defined CAIRO_HAS_QUARTZ_SURFACE
|
|
||||||
QuartzSurface* pQuartzSurface = dynamic_cast<QuartzSurface*>(mpBufferSurface.get());
|
|
||||||
OSL_ASSERT(pQuartzSurface);
|
|
||||||
uno::Sequence< uno::Any > args( 1 );
|
|
||||||
args[0] = uno::Any( sal_IntPtr (pQuartzSurface->getCGContext()) );
|
|
||||||
aRV = uno::Any( args );
|
|
||||||
#elif defined CAIRO_HAS_WIN32_SURFACE
|
|
||||||
// TODO(F2): check whether under all circumstances,
|
|
||||||
// the alpha channel is ignored here.
|
|
||||||
uno::Sequence< uno::Any > args( 1 );
|
|
||||||
args[1] = uno::Any( sal_Int64(surface2HBitmap(mpBufferSurface,maSize)) );
|
|
||||||
|
|
||||||
aRV = uno::Any( args );
|
|
||||||
// caller frees the bitmap
|
|
||||||
#else
|
|
||||||
# error Please define fast prop retrieval for your platform!
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 2:
|
case 2:
|
||||||
|
@@ -35,7 +35,6 @@
|
|||||||
#include <canvas/base/basemutexhelper.hxx>
|
#include <canvas/base/basemutexhelper.hxx>
|
||||||
#include <canvas/base/integerbitmapbase.hxx>
|
#include <canvas/base/integerbitmapbase.hxx>
|
||||||
|
|
||||||
#include "cairo_cairo.hxx"
|
|
||||||
#include "cairo_canvashelper.hxx"
|
#include "cairo_canvashelper.hxx"
|
||||||
#include "cairo_repainttarget.hxx"
|
#include "cairo_repainttarget.hxx"
|
||||||
#include "cairo_spritecanvas.hxx"
|
#include "cairo_spritecanvas.hxx"
|
||||||
@@ -96,7 +95,7 @@ namespace cairocanvas
|
|||||||
|
|
||||||
// SurfaceProvider
|
// SurfaceProvider
|
||||||
virtual ::cairo::SurfaceSharedPtr getSurface() SAL_OVERRIDE;
|
virtual ::cairo::SurfaceSharedPtr getSurface() SAL_OVERRIDE;
|
||||||
virtual ::cairo::SurfaceSharedPtr createSurface( const ::basegfx::B2ISize& rSize, ::cairo::Content aContent = CAIRO_CONTENT_COLOR_ALPHA ) SAL_OVERRIDE;
|
virtual ::cairo::SurfaceSharedPtr createSurface( const ::basegfx::B2ISize& rSize, int aContent = CAIRO_CONTENT_COLOR_ALPHA ) SAL_OVERRIDE;
|
||||||
virtual ::cairo::SurfaceSharedPtr createSurface( ::Bitmap& rBitmap ) SAL_OVERRIDE;
|
virtual ::cairo::SurfaceSharedPtr createSurface( ::Bitmap& rBitmap ) SAL_OVERRIDE;
|
||||||
virtual ::cairo::SurfaceSharedPtr changeSurface( bool bHasAlpha, bool bCopyContent ) SAL_OVERRIDE;
|
virtual ::cairo::SurfaceSharedPtr changeSurface( bool bHasAlpha, bool bCopyContent ) SAL_OVERRIDE;
|
||||||
virtual OutputDevice* getOutputDevice() SAL_OVERRIDE;
|
virtual OutputDevice* getOutputDevice() SAL_OVERRIDE;
|
||||||
|
@@ -109,7 +109,7 @@ namespace cairocanvas
|
|||||||
return mpBufferSurface;
|
return mpBufferSurface;
|
||||||
}
|
}
|
||||||
|
|
||||||
SurfaceSharedPtr CanvasCustomSprite::createSurface( const ::basegfx::B2ISize& rSize, Content aContent )
|
SurfaceSharedPtr CanvasCustomSprite::createSurface( const ::basegfx::B2ISize& rSize, int aContent )
|
||||||
{
|
{
|
||||||
return mpSpriteCanvas->createSurface(rSize,aContent);
|
return mpSpriteCanvas->createSurface(rSize,aContent);
|
||||||
}
|
}
|
||||||
|
@@ -36,8 +36,9 @@
|
|||||||
#include <canvas/base/basemutexhelper.hxx>
|
#include <canvas/base/basemutexhelper.hxx>
|
||||||
#include <canvas/base/canvascustomspritebase.hxx>
|
#include <canvas/base/canvascustomspritebase.hxx>
|
||||||
|
|
||||||
|
#include <vcl/cairo.hxx>
|
||||||
|
|
||||||
#include "cairo_sprite.hxx"
|
#include "cairo_sprite.hxx"
|
||||||
#include "cairo_cairo.hxx"
|
|
||||||
#include "cairo_canvashelper.hxx"
|
#include "cairo_canvashelper.hxx"
|
||||||
#include "cairo_repainttarget.hxx"
|
#include "cairo_repainttarget.hxx"
|
||||||
#include "cairo_spritehelper.hxx"
|
#include "cairo_spritehelper.hxx"
|
||||||
@@ -130,7 +131,7 @@ namespace cairocanvas
|
|||||||
|
|
||||||
// SurfaceProvider
|
// SurfaceProvider
|
||||||
virtual ::cairo::SurfaceSharedPtr getSurface() SAL_OVERRIDE;
|
virtual ::cairo::SurfaceSharedPtr getSurface() SAL_OVERRIDE;
|
||||||
virtual ::cairo::SurfaceSharedPtr createSurface( const ::basegfx::B2ISize& rSize, ::cairo::Content aContent = CAIRO_CONTENT_COLOR_ALPHA ) SAL_OVERRIDE;
|
virtual ::cairo::SurfaceSharedPtr createSurface( const ::basegfx::B2ISize& rSize, int aContent = CAIRO_CONTENT_COLOR_ALPHA ) SAL_OVERRIDE;
|
||||||
virtual ::cairo::SurfaceSharedPtr createSurface( ::Bitmap& rBitmap ) SAL_OVERRIDE;
|
virtual ::cairo::SurfaceSharedPtr createSurface( ::Bitmap& rBitmap ) SAL_OVERRIDE;
|
||||||
virtual ::cairo::SurfaceSharedPtr changeSurface( bool bHasAlpha, bool bCopyContent ) SAL_OVERRIDE;
|
virtual ::cairo::SurfaceSharedPtr changeSurface( bool bHasAlpha, bool bCopyContent ) SAL_OVERRIDE;
|
||||||
virtual OutputDevice* getOutputDevice() SAL_OVERRIDE;
|
virtual OutputDevice* getOutputDevice() SAL_OVERRIDE;
|
||||||
|
@@ -110,7 +110,7 @@ namespace cairocanvas
|
|||||||
mpCairo = pSurface->getCairo();
|
mpCairo = pSurface->getCairo();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setColor( Cairo* pCairo,
|
static void setColor( cairo_t* pCairo,
|
||||||
const uno::Sequence<double>& rColor )
|
const uno::Sequence<double>& rColor )
|
||||||
{
|
{
|
||||||
if( rColor.getLength() > 3 )
|
if( rColor.getLength() > 3 )
|
||||||
@@ -132,9 +132,9 @@ namespace cairocanvas
|
|||||||
const rendering::RenderState& renderState,
|
const rendering::RenderState& renderState,
|
||||||
bool bSetColor )
|
bool bSetColor )
|
||||||
{
|
{
|
||||||
Matrix aViewMatrix;
|
cairo_matrix_t aViewMatrix;
|
||||||
Matrix aRenderMatrix;
|
cairo_matrix_t aRenderMatrix;
|
||||||
Matrix aCombinedMatrix;
|
cairo_matrix_t aCombinedMatrix;
|
||||||
|
|
||||||
cairo_matrix_init( &aViewMatrix,
|
cairo_matrix_init( &aViewMatrix,
|
||||||
viewState.AffineTransform.m00, viewState.AffineTransform.m10, viewState.AffineTransform.m01,
|
viewState.AffineTransform.m00, viewState.AffineTransform.m10, viewState.AffineTransform.m01,
|
||||||
@@ -643,7 +643,7 @@ namespace cairocanvas
|
|||||||
if( pAlphaReadAcc )
|
if( pAlphaReadAcc )
|
||||||
aAlpha.ReleaseAccess( pAlphaReadAcc );
|
aAlpha.ReleaseAccess( pAlphaReadAcc );
|
||||||
|
|
||||||
SurfaceSharedPtr pImageSurface = createSurface(
|
SurfaceSharedPtr pImageSurface = rSurfaceProvider->getOutputDevice()->CreateSurface(
|
||||||
CairoSurfaceSharedPtr(
|
CairoSurfaceSharedPtr(
|
||||||
cairo_image_surface_create_for_data(
|
cairo_image_surface_create_for_data(
|
||||||
data,
|
data,
|
||||||
@@ -661,7 +661,7 @@ namespace cairocanvas
|
|||||||
return pSurface;
|
return pSurface;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void addColorStops( Pattern* pPattern, const uno::Sequence< uno::Sequence< double > >& rColors, const uno::Sequence< double >& rStops, bool bReverseStops = false )
|
static void addColorStops( cairo_pattern_t* pPattern, const uno::Sequence< uno::Sequence< double > >& rColors, const uno::Sequence< double >& rStops, bool bReverseStops = false )
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -705,9 +705,9 @@ namespace cairocanvas
|
|||||||
return uno::Sequence<double>();
|
return uno::Sequence<double>();
|
||||||
}
|
}
|
||||||
|
|
||||||
static Pattern* patternFromParametricPolyPolygon( ::canvas::ParametricPolyPolygon& rPolygon )
|
static cairo_pattern_t* patternFromParametricPolyPolygon( ::canvas::ParametricPolyPolygon& rPolygon )
|
||||||
{
|
{
|
||||||
Pattern* pPattern = NULL;
|
cairo_pattern_t* pPattern = NULL;
|
||||||
const ::canvas::ParametricPolyPolygon::Values aValues = rPolygon.getValues();
|
const ::canvas::ParametricPolyPolygon::Values aValues = rPolygon.getValues();
|
||||||
double x0, x1, y0, y1, cx, cy, r0, r1;
|
double x0, x1, y0, y1, cx, cy, r0, r1;
|
||||||
|
|
||||||
@@ -739,7 +739,7 @@ namespace cairocanvas
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void doOperation( Operation aOperation,
|
static void doOperation( Operation aOperation,
|
||||||
Cairo* pCairo,
|
cairo_t* pCairo,
|
||||||
const uno::Sequence< rendering::Texture >* pTextures,
|
const uno::Sequence< rendering::Texture >* pTextures,
|
||||||
const SurfaceProviderRef& pDevice,
|
const SurfaceProviderRef& pDevice,
|
||||||
const basegfx::B2DRange& rBounds )
|
const basegfx::B2DRange& rBounds )
|
||||||
@@ -764,7 +764,7 @@ namespace cairocanvas
|
|||||||
cairo_save( pCairo );
|
cairo_save( pCairo );
|
||||||
|
|
||||||
::com::sun::star::geometry::AffineMatrix2D aTransform( aTexture.AffineTransform );
|
::com::sun::star::geometry::AffineMatrix2D aTransform( aTexture.AffineTransform );
|
||||||
Matrix aScaleMatrix, aTextureMatrix, aScaledTextureMatrix;
|
cairo_matrix_t aScaleMatrix, aTextureMatrix, aScaledTextureMatrix;
|
||||||
|
|
||||||
cairo_matrix_init( &aTextureMatrix,
|
cairo_matrix_init( &aTextureMatrix,
|
||||||
aTransform.m00, aTransform.m10, aTransform.m01,
|
aTransform.m00, aTransform.m10, aTransform.m01,
|
||||||
@@ -827,7 +827,7 @@ namespace cairocanvas
|
|||||||
|
|
||||||
::canvas::ParametricPolyPolygon* pPolyImpl = static_cast< ::canvas::ParametricPolyPolygon* >( aTexture.Gradient.get() );
|
::canvas::ParametricPolyPolygon* pPolyImpl = static_cast< ::canvas::ParametricPolyPolygon* >( aTexture.Gradient.get() );
|
||||||
::com::sun::star::geometry::AffineMatrix2D aTransform( aTexture.AffineTransform );
|
::com::sun::star::geometry::AffineMatrix2D aTransform( aTexture.AffineTransform );
|
||||||
Matrix aTextureMatrix;
|
cairo_matrix_t aTextureMatrix;
|
||||||
|
|
||||||
cairo_matrix_init( &aTextureMatrix,
|
cairo_matrix_init( &aTextureMatrix,
|
||||||
aTransform.m00, aTransform.m10, aTransform.m01,
|
aTransform.m00, aTransform.m10, aTransform.m01,
|
||||||
@@ -882,7 +882,7 @@ namespace cairocanvas
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Pattern* pPattern = patternFromParametricPolyPolygon( *pPolyImpl );
|
cairo_pattern_t* pPattern = patternFromParametricPolyPolygon( *pPolyImpl );
|
||||||
|
|
||||||
if( pPattern )
|
if( pPattern )
|
||||||
{
|
{
|
||||||
@@ -916,10 +916,10 @@ namespace cairocanvas
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void clipNULL( Cairo *pCairo )
|
static void clipNULL( cairo_t *pCairo )
|
||||||
{
|
{
|
||||||
SAL_INFO( "canvas.cairo", "clipNULL");
|
SAL_INFO( "canvas.cairo", "clipNULL");
|
||||||
Matrix aOrigMatrix, aIdentityMatrix;
|
cairo_matrix_t aOrigMatrix, aIdentityMatrix;
|
||||||
|
|
||||||
/* we set identity matrix here to overcome bug in cairo 0.9.2
|
/* we set identity matrix here to overcome bug in cairo 0.9.2
|
||||||
where XCreatePixmap is called with zero width and height.
|
where XCreatePixmap is called with zero width and height.
|
||||||
@@ -942,7 +942,7 @@ namespace cairocanvas
|
|||||||
|
|
||||||
void doPolyPolygonImplementation( ::basegfx::B2DPolyPolygon aPolyPolygon,
|
void doPolyPolygonImplementation( ::basegfx::B2DPolyPolygon aPolyPolygon,
|
||||||
Operation aOperation,
|
Operation aOperation,
|
||||||
Cairo* pCairo,
|
cairo_t* pCairo,
|
||||||
const uno::Sequence< rendering::Texture >* pTextures,
|
const uno::Sequence< rendering::Texture >* pTextures,
|
||||||
const SurfaceProviderRef& pDevice,
|
const SurfaceProviderRef& pDevice,
|
||||||
rendering::FillRule eFillrule )
|
rendering::FillRule eFillrule )
|
||||||
@@ -952,7 +952,7 @@ namespace cairocanvas
|
|||||||
"CanvasHelper::fillTexturedPolyPolygon: empty texture sequence");
|
"CanvasHelper::fillTexturedPolyPolygon: empty texture sequence");
|
||||||
|
|
||||||
bool bOpToDo = false;
|
bool bOpToDo = false;
|
||||||
Matrix aOrigMatrix, aIdentityMatrix;
|
cairo_matrix_t aOrigMatrix, aIdentityMatrix;
|
||||||
double nX, nY, nBX, nBY, nAX, nAY;
|
double nX, nY, nBX, nBY, nAX, nAY;
|
||||||
|
|
||||||
cairo_get_matrix( pCairo, &aOrigMatrix );
|
cairo_get_matrix( pCairo, &aOrigMatrix );
|
||||||
@@ -1073,7 +1073,7 @@ namespace cairocanvas
|
|||||||
Operation aOperation,
|
Operation aOperation,
|
||||||
bool bNoLineJoin,
|
bool bNoLineJoin,
|
||||||
const uno::Sequence< rendering::Texture >* pTextures,
|
const uno::Sequence< rendering::Texture >* pTextures,
|
||||||
Cairo* pCairo ) const
|
cairo_t* pCairo ) const
|
||||||
{
|
{
|
||||||
const ::basegfx::B2DPolyPolygon& rPolyPoly(
|
const ::basegfx::B2DPolyPolygon& rPolyPoly(
|
||||||
::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(xPolyPolygon) );
|
::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(xPolyPolygon) );
|
||||||
@@ -1172,7 +1172,7 @@ namespace cairocanvas
|
|||||||
|
|
||||||
useStates( viewState, renderState, true );
|
useStates( viewState, renderState, true );
|
||||||
|
|
||||||
Matrix aMatrix;
|
cairo_matrix_t aMatrix;
|
||||||
double w = strokeAttributes.StrokeWidth, h = 0;
|
double w = strokeAttributes.StrokeWidth, h = 0;
|
||||||
cairo_get_matrix( mpCairo.get(), &aMatrix );
|
cairo_get_matrix( mpCairo.get(), &aMatrix );
|
||||||
cairo_matrix_transform_distance( &aMatrix, &w, &h );
|
cairo_matrix_transform_distance( &aMatrix, &w, &h );
|
||||||
@@ -1351,7 +1351,7 @@ namespace cairocanvas
|
|||||||
|
|
||||||
useStates( viewState, renderState, true );
|
useStates( viewState, renderState, true );
|
||||||
|
|
||||||
Matrix aMatrix;
|
cairo_matrix_t aMatrix;
|
||||||
|
|
||||||
cairo_get_matrix( mpCairo.get(), &aMatrix );
|
cairo_get_matrix( mpCairo.get(), &aMatrix );
|
||||||
if( ! ::rtl::math::approxEqual( aMatrix.xx, 1 ) &&
|
if( ! ::rtl::math::approxEqual( aMatrix.xx, 1 ) &&
|
||||||
@@ -1552,7 +1552,7 @@ namespace cairocanvas
|
|||||||
{
|
{
|
||||||
const sal_Int32 nWidth( rect.X2 - rect.X1 );
|
const sal_Int32 nWidth( rect.X2 - rect.X1 );
|
||||||
const sal_Int32 nHeight( rect.Y2 - rect.Y1 );
|
const sal_Int32 nHeight( rect.Y2 - rect.Y1 );
|
||||||
const Format eFormat( mbHaveAlpha ? CAIRO_FORMAT_ARGB32 : CAIRO_FORMAT_RGB24 );
|
const cairo_format_t eFormat( mbHaveAlpha ? CAIRO_FORMAT_ARGB32 : CAIRO_FORMAT_RGB24 );
|
||||||
uno::Sequence< sal_Int8 > aRes( 4*nWidth*nHeight );
|
uno::Sequence< sal_Int8 > aRes( 4*nWidth*nHeight );
|
||||||
sal_Int8* pData = aRes.getArray();
|
sal_Int8* pData = aRes.getArray();
|
||||||
cairo_surface_t* pImageSurface = cairo_image_surface_create_for_data( reinterpret_cast<unsigned char *>(pData),
|
cairo_surface_t* pImageSurface = cairo_image_surface_create_for_data( reinterpret_cast<unsigned char *>(pData),
|
||||||
@@ -2294,7 +2294,7 @@ namespace cairocanvas
|
|||||||
|
|
||||||
useStates( viewState, renderState, true );
|
useStates( viewState, renderState, true );
|
||||||
|
|
||||||
Matrix aMatrix;
|
cairo_matrix_t aMatrix;
|
||||||
|
|
||||||
cairo_get_matrix( mpCairo.get(), &aMatrix );
|
cairo_get_matrix( mpCairo.get(), &aMatrix );
|
||||||
aMatrix.xx = aMatrix.yy = 1;
|
aMatrix.xx = aMatrix.yy = 1;
|
||||||
|
@@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#include <boost/utility.hpp>
|
#include <boost/utility.hpp>
|
||||||
|
|
||||||
#include "cairo_cairo.hxx"
|
#include <vcl/cairo.hxx>
|
||||||
#include "cairo_surfaceprovider.hxx"
|
#include "cairo_surfaceprovider.hxx"
|
||||||
|
|
||||||
class VirtualDevice;
|
class VirtualDevice;
|
||||||
@@ -236,7 +236,7 @@ namespace cairocanvas
|
|||||||
Operation aOperation,
|
Operation aOperation,
|
||||||
bool bNoLineJoin = false,
|
bool bNoLineJoin = false,
|
||||||
const ::com::sun::star::uno::Sequence< ::com::sun::star::rendering::Texture >* pTextures=NULL,
|
const ::com::sun::star::uno::Sequence< ::com::sun::star::rendering::Texture >* pTextures=NULL,
|
||||||
::cairo::Cairo* pCairo=NULL ) const;
|
cairo_t* pCairo=NULL ) const;
|
||||||
|
|
||||||
::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > implDrawBitmapSurface(
|
::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > implDrawBitmapSurface(
|
||||||
const ::com::sun::star::rendering::XCanvas* pCanvas,
|
const ::com::sun::star::rendering::XCanvas* pCanvas,
|
||||||
@@ -291,7 +291,7 @@ namespace cairocanvas
|
|||||||
/// also needed from SpriteHelper
|
/// also needed from SpriteHelper
|
||||||
void doPolyPolygonImplementation( ::basegfx::B2DPolyPolygon aPolyPolygon,
|
void doPolyPolygonImplementation( ::basegfx::B2DPolyPolygon aPolyPolygon,
|
||||||
Operation aOperation,
|
Operation aOperation,
|
||||||
::cairo::Cairo* pCairo,
|
cairo_t* pCairo,
|
||||||
const ::com::sun::star::uno::Sequence< ::com::sun::star::rendering::Texture >* pTextures,
|
const ::com::sun::star::uno::Sequence< ::com::sun::star::rendering::Texture >* pTextures,
|
||||||
const SurfaceProviderRef& pDevice,
|
const SurfaceProviderRef& pDevice,
|
||||||
::com::sun::star::rendering::FillRule eFillrule );
|
::com::sun::star::rendering::FillRule eFillrule );
|
||||||
|
@@ -65,12 +65,11 @@ namespace cairocanvas
|
|||||||
{
|
{
|
||||||
implInit(rSurfaceProvider, rRefDevice);
|
implInit(rSurfaceProvider, rRefDevice);
|
||||||
|
|
||||||
OutputDevice* pOutDev=getOutputDevice();
|
OutputDevice* pOutDev = getOutputDevice();
|
||||||
mpSurface = cairo::createSurface( *pOutDev,
|
mpSurface = pOutDev->CreateSurface(pOutDev->GetOutOffXPixel(),
|
||||||
pOutDev->GetOutOffXPixel(),
|
pOutDev->GetOutOffYPixel(),
|
||||||
pOutDev->GetOutOffYPixel(),
|
pOutDev->GetOutputWidthPixel(),
|
||||||
pOutDev->GetOutputWidthPixel(),
|
pOutDev->GetOutputHeightPixel());
|
||||||
pOutDev->GetOutputHeightPixel() );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeviceHelper::disposing()
|
void DeviceHelper::disposing()
|
||||||
@@ -99,8 +98,7 @@ namespace cairocanvas
|
|||||||
|
|
||||||
if (!bReuseSurface)
|
if (!bReuseSurface)
|
||||||
{
|
{
|
||||||
mpSurface = cairo::createSurface(
|
mpSurface = pOutDev->CreateSurface(
|
||||||
*pOutDev,
|
|
||||||
pOutDev->GetOutOffXPixel(),
|
pOutDev->GetOutOffXPixel(),
|
||||||
pOutDev->GetOutOffYPixel(),
|
pOutDev->GetOutOffYPixel(),
|
||||||
rSize.getX(), rSize.getY() );
|
rSize.getX(), rSize.getY() );
|
||||||
@@ -260,7 +258,7 @@ namespace cairocanvas
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SurfaceSharedPtr DeviceHelper::createSurface( const ::basegfx::B2ISize& rSize, Content aContent )
|
SurfaceSharedPtr DeviceHelper::createSurface( const ::basegfx::B2ISize& rSize, int aContent )
|
||||||
{
|
{
|
||||||
if( mpSurface )
|
if( mpSurface )
|
||||||
return mpSurface->getSimilar( aContent, rSize.getX(), rSize.getY() );
|
return mpSurface->getSimilar( aContent, rSize.getX(), rSize.getY() );
|
||||||
@@ -270,8 +268,8 @@ namespace cairocanvas
|
|||||||
|
|
||||||
SurfaceSharedPtr DeviceHelper::createSurface( BitmapSystemData& rData, const Size& rSize )
|
SurfaceSharedPtr DeviceHelper::createSurface( BitmapSystemData& rData, const Size& rSize )
|
||||||
{
|
{
|
||||||
if( mpRefDevice )
|
if (mpRefDevice)
|
||||||
return createBitmapSurface( *mpRefDevice, rData, rSize );
|
return mpRefDevice->CreateBitmapSurface(rData, rSize);
|
||||||
|
|
||||||
return SurfaceSharedPtr();
|
return SurfaceSharedPtr();
|
||||||
}
|
}
|
||||||
|
@@ -29,7 +29,6 @@
|
|||||||
#include <vcl/window.hxx>
|
#include <vcl/window.hxx>
|
||||||
#include <vcl/bitmap.hxx>
|
#include <vcl/bitmap.hxx>
|
||||||
|
|
||||||
#include "cairo_cairo.hxx"
|
|
||||||
#include "cairo_surfaceprovider.hxx"
|
#include "cairo_surfaceprovider.hxx"
|
||||||
|
|
||||||
/* Definition of DeviceHelper class */
|
/* Definition of DeviceHelper class */
|
||||||
@@ -91,7 +90,7 @@ namespace cairocanvas
|
|||||||
|
|
||||||
OutputDevice* getOutputDevice() const { return mpRefDevice; }
|
OutputDevice* getOutputDevice() const { return mpRefDevice; }
|
||||||
::cairo::SurfaceSharedPtr getSurface() { return mpSurface; }
|
::cairo::SurfaceSharedPtr getSurface() { return mpSurface; }
|
||||||
::cairo::SurfaceSharedPtr createSurface( const ::basegfx::B2ISize& rSize, ::cairo::Content aContent = CAIRO_CONTENT_COLOR_ALPHA );
|
::cairo::SurfaceSharedPtr createSurface( const ::basegfx::B2ISize& rSize, int aContent = CAIRO_CONTENT_COLOR_ALPHA );
|
||||||
::cairo::SurfaceSharedPtr createSurface( BitmapSystemData& rData, const Size& rSize );
|
::cairo::SurfaceSharedPtr createSurface( BitmapSystemData& rData, const Size& rSize );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#include <rtl/ref.hxx>
|
#include <rtl/ref.hxx>
|
||||||
|
|
||||||
#include "cairo_cairo.hxx"
|
#include <vcl/cairo.hxx>
|
||||||
|
|
||||||
namespace cairocanvas
|
namespace cairocanvas
|
||||||
{
|
{
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#include <canvas/base/sprite.hxx>
|
#include <canvas/base/sprite.hxx>
|
||||||
|
|
||||||
#include "cairo_cairo.hxx"
|
#include <vcl/cairo.hxx>
|
||||||
|
|
||||||
namespace cairocanvas
|
namespace cairocanvas
|
||||||
{
|
{
|
||||||
|
@@ -151,7 +151,7 @@ namespace cairocanvas
|
|||||||
return maDeviceHelper.getBufferSurface();
|
return maDeviceHelper.getBufferSurface();
|
||||||
}
|
}
|
||||||
|
|
||||||
SurfaceSharedPtr SpriteCanvas::createSurface( const ::basegfx::B2ISize& rSize, Content aContent )
|
SurfaceSharedPtr SpriteCanvas::createSurface( const ::basegfx::B2ISize& rSize, int aContent )
|
||||||
{
|
{
|
||||||
return maDeviceHelper.createSurface( rSize, aContent );
|
return maDeviceHelper.createSurface( rSize, aContent );
|
||||||
}
|
}
|
||||||
|
@@ -134,7 +134,7 @@ namespace cairocanvas
|
|||||||
|
|
||||||
// SurfaceProvider
|
// SurfaceProvider
|
||||||
virtual ::cairo::SurfaceSharedPtr getSurface() SAL_OVERRIDE;
|
virtual ::cairo::SurfaceSharedPtr getSurface() SAL_OVERRIDE;
|
||||||
virtual ::cairo::SurfaceSharedPtr createSurface( const ::basegfx::B2ISize& rSize, ::cairo::Content aContent = CAIRO_CONTENT_COLOR_ALPHA ) SAL_OVERRIDE;
|
virtual ::cairo::SurfaceSharedPtr createSurface( const ::basegfx::B2ISize& rSize, int aContent = CAIRO_CONTENT_COLOR_ALPHA ) SAL_OVERRIDE;
|
||||||
virtual ::cairo::SurfaceSharedPtr createSurface( ::Bitmap& rBitmap ) SAL_OVERRIDE;
|
virtual ::cairo::SurfaceSharedPtr createSurface( ::Bitmap& rBitmap ) SAL_OVERRIDE;
|
||||||
virtual ::cairo::SurfaceSharedPtr changeSurface( bool bHasAlpha, bool bCopyContent ) SAL_OVERRIDE;
|
virtual ::cairo::SurfaceSharedPtr changeSurface( bool bHasAlpha, bool bCopyContent ) SAL_OVERRIDE;
|
||||||
virtual OutputDevice* getOutputDevice() SAL_OVERRIDE;
|
virtual OutputDevice* getOutputDevice() SAL_OVERRIDE;
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
#include <canvas/spriteredrawmanager.hxx>
|
#include <canvas/spriteredrawmanager.hxx>
|
||||||
|
|
||||||
#include "cairo_cairo.hxx"
|
#include <vcl/cairo.hxx>
|
||||||
#include "cairo_canvashelper.hxx"
|
#include "cairo_canvashelper.hxx"
|
||||||
|
|
||||||
namespace basegfx
|
namespace basegfx
|
||||||
|
@@ -31,12 +31,12 @@
|
|||||||
#include <basegfx/tools/unopolypolygon.hxx>
|
#include <basegfx/tools/unopolypolygon.hxx>
|
||||||
|
|
||||||
#include <vcl/syschild.hxx>
|
#include <vcl/syschild.hxx>
|
||||||
|
#include <vcl/cairo.hxx>
|
||||||
#include <vcl/canvastools.hxx>
|
#include <vcl/canvastools.hxx>
|
||||||
|
|
||||||
#include "cairo_spritecanvas.hxx"
|
#include "cairo_spritecanvas.hxx"
|
||||||
#include "cairo_canvasbitmap.hxx"
|
#include "cairo_canvasbitmap.hxx"
|
||||||
#include "cairo_devicehelper.hxx"
|
#include "cairo_devicehelper.hxx"
|
||||||
#include "cairo_cairo.hxx"
|
|
||||||
|
|
||||||
using namespace ::cairo;
|
using namespace ::cairo;
|
||||||
using namespace ::com::sun::star;
|
using namespace ::com::sun::star;
|
||||||
@@ -134,7 +134,7 @@ namespace cairocanvas
|
|||||||
return DeviceHelper::getSurface();
|
return DeviceHelper::getSurface();
|
||||||
}
|
}
|
||||||
|
|
||||||
SurfaceSharedPtr SpriteDeviceHelper::createSurface( const ::basegfx::B2ISize& rSize, Content aContent )
|
SurfaceSharedPtr SpriteDeviceHelper::createSurface( const ::basegfx::B2ISize& rSize, int aContent )
|
||||||
{
|
{
|
||||||
if( mpBufferSurface )
|
if( mpBufferSurface )
|
||||||
return mpBufferSurface->getSimilar( aContent, rSize.getX(), rSize.getY() );
|
return mpBufferSurface->getSimilar( aContent, rSize.getX(), rSize.getY() );
|
||||||
@@ -144,13 +144,12 @@ namespace cairocanvas
|
|||||||
|
|
||||||
SurfaceSharedPtr SpriteDeviceHelper::createSurface( BitmapSystemData& rData, const Size& rSize )
|
SurfaceSharedPtr SpriteDeviceHelper::createSurface( BitmapSystemData& rData, const Size& rSize )
|
||||||
{
|
{
|
||||||
if( getOutputDevice() )
|
OutputDevice *pDevice = getOutputDevice();
|
||||||
return createBitmapSurface( *getOutputDevice(), rData, rSize );
|
if (pDevice)
|
||||||
|
return pDevice->CreateBitmapSurface(rData, rSize);
|
||||||
return SurfaceSharedPtr();
|
return SurfaceSharedPtr();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** SpriteDeviceHelper::flush Flush the platform native window
|
/** SpriteDeviceHelper::flush Flush the platform native window
|
||||||
*
|
*
|
||||||
* Flushes the window by using the internally stored mpSysData.
|
* Flushes the window by using the internally stored mpSysData.
|
||||||
|
@@ -28,8 +28,8 @@
|
|||||||
|
|
||||||
#include <vcl/window.hxx>
|
#include <vcl/window.hxx>
|
||||||
#include <vcl/bitmap.hxx>
|
#include <vcl/bitmap.hxx>
|
||||||
|
#include <vcl/cairo.hxx>
|
||||||
|
|
||||||
#include "cairo_cairo.hxx"
|
|
||||||
#include "cairo_devicehelper.hxx"
|
#include "cairo_devicehelper.hxx"
|
||||||
|
|
||||||
/* Definition of DeviceHelper class */
|
/* Definition of DeviceHelper class */
|
||||||
@@ -64,7 +64,7 @@ namespace cairocanvas
|
|||||||
|
|
||||||
::cairo::SurfaceSharedPtr getBufferSurface() { return mpBufferSurface; }
|
::cairo::SurfaceSharedPtr getBufferSurface() { return mpBufferSurface; }
|
||||||
::cairo::SurfaceSharedPtr getWindowSurface();
|
::cairo::SurfaceSharedPtr getWindowSurface();
|
||||||
::cairo::SurfaceSharedPtr createSurface( const ::basegfx::B2ISize& rSize, ::cairo::Content aContent = CAIRO_CONTENT_COLOR_ALPHA );
|
::cairo::SurfaceSharedPtr createSurface( const ::basegfx::B2ISize& rSize, int aContent = CAIRO_CONTENT_COLOR_ALPHA );
|
||||||
::cairo::SurfaceSharedPtr createSurface( BitmapSystemData& rData, const Size& rSize );
|
::cairo::SurfaceSharedPtr createSurface( BitmapSystemData& rData, const Size& rSize );
|
||||||
const ::basegfx::B2ISize& getSizePixel() { return maSize; }
|
const ::basegfx::B2ISize& getSizePixel() { return maSize; }
|
||||||
void flush();
|
void flush();
|
||||||
|
@@ -23,7 +23,8 @@
|
|||||||
#include <rtl/ref.hxx>
|
#include <rtl/ref.hxx>
|
||||||
#include <com/sun/star/uno/XInterface.hpp>
|
#include <com/sun/star/uno/XInterface.hpp>
|
||||||
|
|
||||||
#include "cairo_cairo.hxx"
|
#include <vcl/cairo.hxx>
|
||||||
|
#include <cairo.h>
|
||||||
|
|
||||||
class OutputDevice;
|
class OutputDevice;
|
||||||
class Bitmap;
|
class Bitmap;
|
||||||
@@ -52,7 +53,7 @@ namespace cairocanvas
|
|||||||
|
|
||||||
/// create new surface in given size
|
/// create new surface in given size
|
||||||
virtual ::cairo::SurfaceSharedPtr createSurface( const ::basegfx::B2ISize& rSize,
|
virtual ::cairo::SurfaceSharedPtr createSurface( const ::basegfx::B2ISize& rSize,
|
||||||
::cairo::Content aContent = CAIRO_CONTENT_COLOR_ALPHA ) = 0;
|
int aContent = CAIRO_CONTENT_COLOR_ALPHA ) = 0;
|
||||||
/// create new surface from given bitmap
|
/// create new surface from given bitmap
|
||||||
virtual ::cairo::SurfaceSharedPtr createSurface( ::Bitmap& rBitmap ) = 0;
|
virtual ::cairo::SurfaceSharedPtr createSurface( ::Bitmap& rBitmap ) = 0;
|
||||||
|
|
||||||
|
@@ -46,7 +46,7 @@
|
|||||||
#include "cairo_spritecanvas.hxx"
|
#include "cairo_spritecanvas.hxx"
|
||||||
|
|
||||||
#ifdef CAIRO_HAS_QUARTZ_SURFACE
|
#ifdef CAIRO_HAS_QUARTZ_SURFACE
|
||||||
# include "cairo_quartz_cairo.hxx"
|
#include <cairo-quartz.h>
|
||||||
#elif defined CAIRO_HAS_WIN32_SURFACE
|
#elif defined CAIRO_HAS_WIN32_SURFACE
|
||||||
# include "cairo_win32_cairo.hxx"
|
# include "cairo_win32_cairo.hxx"
|
||||||
# include <cairo-win32.h>
|
# include <cairo-win32.h>
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
#include <boost/utility.hpp>
|
#include <boost/utility.hpp>
|
||||||
|
|
||||||
#include "cairo_cairo.hxx"
|
#include <vcl/cairo.hxx>
|
||||||
#include "cairo_canvasfont.hxx"
|
#include "cairo_canvasfont.hxx"
|
||||||
|
|
||||||
|
|
||||||
|
6
config_host/config_cairo_canvas.h.in
Normal file
6
config_host/config_cairo_canvas.h.in
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#ifndef CONFIG_CAIRO_CANVAS_H
|
||||||
|
#define CONFIG_CAIRO_CANVAS_H
|
||||||
|
|
||||||
|
#define ENABLE_CAIRO_CANVAS 0
|
||||||
|
|
||||||
|
#endif
|
@@ -10171,6 +10171,7 @@ ENABLE_CAIRO_CANVAS=""
|
|||||||
if test "$enable_cairo_canvas" = "yes"; then
|
if test "$enable_cairo_canvas" = "yes"; then
|
||||||
test_cairo=yes
|
test_cairo=yes
|
||||||
ENABLE_CAIRO_CANVAS="TRUE"
|
ENABLE_CAIRO_CANVAS="TRUE"
|
||||||
|
AC_DEFINE(ENABLE_CAIRO_CANVAS)
|
||||||
fi
|
fi
|
||||||
AC_SUBST(ENABLE_CAIRO_CANVAS)
|
AC_SUBST(ENABLE_CAIRO_CANVAS)
|
||||||
|
|
||||||
@@ -12911,6 +12912,7 @@ AC_CONFIG_FILES([config_host.mk
|
|||||||
AC_CONFIG_HEADERS([config_host/config_buildid.h])
|
AC_CONFIG_HEADERS([config_host/config_buildid.h])
|
||||||
AC_CONFIG_HEADERS([config_host/config_clang.h])
|
AC_CONFIG_HEADERS([config_host/config_clang.h])
|
||||||
AC_CONFIG_HEADERS([config_host/config_eot.h])
|
AC_CONFIG_HEADERS([config_host/config_eot.h])
|
||||||
|
AC_CONFIG_HEADERS([config_host/config_cairo_canvas.h])
|
||||||
AC_CONFIG_HEADERS([config_host/config_cups.h])
|
AC_CONFIG_HEADERS([config_host/config_cups.h])
|
||||||
AC_CONFIG_HEADERS([config_host/config_features.h])
|
AC_CONFIG_HEADERS([config_host/config_features.h])
|
||||||
AC_CONFIG_HEADERS([config_host/config_folders.h])
|
AC_CONFIG_HEADERS([config_host/config_folders.h])
|
||||||
|
@@ -17,33 +17,21 @@
|
|||||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef INCLUDED_CANVAS_SOURCE_CAIRO_CAIRO_CAIRO_HXX
|
#ifndef INCLUDED_VCL_CAIRO_HXX
|
||||||
#define INCLUDED_CANVAS_SOURCE_CAIRO_CAIRO_CAIRO_HXX
|
#define INCLUDED_VCL_CAIRO_HXX
|
||||||
|
|
||||||
#include <sal/config.h>
|
#include <sal/config.h>
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
|
|
||||||
struct SystemEnvData;
|
typedef struct _cairo_surface cairo_surface_t;
|
||||||
struct BitmapSystemData;
|
typedef struct _cairo cairo_t;
|
||||||
struct SystemGraphicsData;
|
|
||||||
class VirtualDevice;
|
|
||||||
class OutputDevice;
|
|
||||||
namespace vcl { class Window; }
|
|
||||||
class Size;
|
|
||||||
|
|
||||||
#include <cairo.h>
|
class VirtualDevice;
|
||||||
|
|
||||||
namespace cairo {
|
namespace cairo {
|
||||||
typedef cairo_t Cairo;
|
|
||||||
typedef cairo_matrix_t Matrix;
|
|
||||||
typedef cairo_format_t Format;
|
|
||||||
typedef cairo_content_t Content;
|
|
||||||
typedef cairo_pattern_t Pattern;
|
|
||||||
|
|
||||||
typedef boost::shared_ptr<cairo_surface_t> CairoSurfaceSharedPtr;
|
typedef boost::shared_ptr<cairo_surface_t> CairoSurfaceSharedPtr;
|
||||||
typedef boost::shared_ptr<Cairo> CairoSharedPtr;
|
typedef boost::shared_ptr<cairo_t> CairoSharedPtr;
|
||||||
|
|
||||||
const SystemEnvData* GetSysData(const vcl::Window *pOutputWindow);
|
|
||||||
|
|
||||||
/** Cairo surface interface
|
/** Cairo surface interface
|
||||||
|
|
||||||
@@ -58,13 +46,13 @@ namespace cairo {
|
|||||||
// Query methods
|
// Query methods
|
||||||
virtual CairoSharedPtr getCairo() const = 0;
|
virtual CairoSharedPtr getCairo() const = 0;
|
||||||
virtual CairoSurfaceSharedPtr getCairoSurface() const = 0;
|
virtual CairoSurfaceSharedPtr getCairoSurface() const = 0;
|
||||||
virtual boost::shared_ptr<Surface> getSimilar( Content aContent, int width, int height ) const = 0;
|
virtual boost::shared_ptr<Surface> getSimilar(int cairo_content_type, int width, int height) const = 0;
|
||||||
|
|
||||||
/// factory for VirDev on this surface
|
/// factory for VirDev on this surface
|
||||||
virtual boost::shared_ptr<VirtualDevice> createVirtualDevice() const = 0;
|
virtual boost::shared_ptr<VirtualDevice> createVirtualDevice() const = 0;
|
||||||
|
|
||||||
/// Resize the surface (possibly destroying content), only possible for X11 typically
|
/// Resize the surface (possibly destroying content), only possible for X11 typically
|
||||||
/// so on failure create a new surface instead
|
/// so on failure caller must create a new surface instead
|
||||||
virtual bool Resize( int /*width*/, int /*height*/ ) { return false; }
|
virtual bool Resize( int /*width*/, int /*height*/ ) { return false; }
|
||||||
|
|
||||||
/// Flush all pending output to surface
|
/// Flush all pending output to surface
|
||||||
@@ -72,16 +60,6 @@ namespace cairo {
|
|||||||
};
|
};
|
||||||
|
|
||||||
typedef boost::shared_ptr<Surface> SurfaceSharedPtr;
|
typedef boost::shared_ptr<Surface> SurfaceSharedPtr;
|
||||||
|
|
||||||
/// Create Surface from given cairo surface
|
|
||||||
SurfaceSharedPtr createSurface( const CairoSurfaceSharedPtr& rSurface );
|
|
||||||
/// Create surface with given dimensions
|
|
||||||
SurfaceSharedPtr createSurface( const OutputDevice& rRefDevice,
|
|
||||||
int x, int y, int width, int height );
|
|
||||||
/// Create Surface for given bitmap data
|
|
||||||
SurfaceSharedPtr createBitmapSurface( const OutputDevice& rRefDevice,
|
|
||||||
const BitmapSystemData& rData,
|
|
||||||
const Size& rSize );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
@@ -26,6 +26,7 @@
|
|||||||
#include <tools/color.hxx>
|
#include <tools/color.hxx>
|
||||||
#include <tools/poly.hxx>
|
#include <tools/poly.hxx>
|
||||||
|
|
||||||
|
#include <vcl/cairo.hxx>
|
||||||
#include <vcl/devicecoordinate.hxx>
|
#include <vcl/devicecoordinate.hxx>
|
||||||
#include <vcl/dllapi.h>
|
#include <vcl/dllapi.h>
|
||||||
#include <vcl/font.hxx>
|
#include <vcl/font.hxx>
|
||||||
@@ -120,6 +121,8 @@ namespace basegfx {
|
|||||||
class B2DHomMatrix;
|
class B2DHomMatrix;
|
||||||
class B2DPolygon;
|
class B2DPolygon;
|
||||||
class B2DPolyPolygon;
|
class B2DPolyPolygon;
|
||||||
|
class B2IVector;
|
||||||
|
typedef B2IVector B2ISize;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace com {
|
namespace com {
|
||||||
@@ -233,6 +236,7 @@ class FontSelectPattern;
|
|||||||
class ImplFontMetricData;
|
class ImplFontMetricData;
|
||||||
class VCLXGraphics;
|
class VCLXGraphics;
|
||||||
class OutDevStateStack;
|
class OutDevStateStack;
|
||||||
|
struct BitmapSystemData;
|
||||||
|
|
||||||
typedef boost::intrusive_ptr< FontCharMap > FontCharMapPtr;
|
typedef boost::intrusive_ptr< FontCharMap > FontCharMapPtr;
|
||||||
|
|
||||||
@@ -377,6 +381,14 @@ public:
|
|||||||
|
|
||||||
SystemGraphicsData GetSystemGfxData() const;
|
SystemGraphicsData GetSystemGfxData() const;
|
||||||
bool SupportsCairo() const;
|
bool SupportsCairo() const;
|
||||||
|
/// Create Surface from given cairo surface
|
||||||
|
cairo::SurfaceSharedPtr CreateSurface(const cairo::CairoSurfaceSharedPtr& rSurface) const;
|
||||||
|
/// Create surface with given dimensions
|
||||||
|
cairo::SurfaceSharedPtr CreateSurface(int x, int y, int width, int height) const;
|
||||||
|
/// Create Surface for given bitmap data
|
||||||
|
cairo::SurfaceSharedPtr CreateBitmapSurface(const BitmapSystemData& rData, const Size& rSize) const;
|
||||||
|
/// Return native handle for underlying surface
|
||||||
|
css::uno::Any GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& rSurface, const ::basegfx::B2ISize& rSize) const;
|
||||||
css::uno::Any GetSystemGfxDataAny() const;
|
css::uno::Any GetSystemGfxDataAny() const;
|
||||||
|
|
||||||
void SetRefPoint();
|
void SetRefPoint();
|
||||||
|
@@ -135,6 +135,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
|
|||||||
vcl/opengl/texture \
|
vcl/opengl/texture \
|
||||||
vcl/source/opengl/OpenGLContext \
|
vcl/source/opengl/OpenGLContext \
|
||||||
vcl/source/opengl/OpenGLHelper \
|
vcl/source/opengl/OpenGLHelper \
|
||||||
|
vcl/source/window/cairo_cairo \
|
||||||
vcl/source/window/openglwin \
|
vcl/source/window/openglwin \
|
||||||
vcl/source/window/settings \
|
vcl/source/window/settings \
|
||||||
vcl/source/window/paint \
|
vcl/source/window/paint \
|
||||||
@@ -496,6 +497,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
|
|||||||
vcl/osx/PictToBmpFlt \
|
vcl/osx/PictToBmpFlt \
|
||||||
vcl/osx/clipboard \
|
vcl/osx/clipboard \
|
||||||
vcl/osx/service_entry \
|
vcl/osx/service_entry \
|
||||||
|
vcl/quartz/cairo_quartz_cairo \
|
||||||
$(vcl_quartz_code) \
|
$(vcl_quartz_code) \
|
||||||
vcl/quartz/salgdiutils \
|
vcl/quartz/salgdiutils \
|
||||||
vcl/osx/salnativewidgets \
|
vcl/osx/salnativewidgets \
|
||||||
@@ -665,6 +667,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
|
|||||||
vcl/win/source/app/salinst \
|
vcl/win/source/app/salinst \
|
||||||
vcl/win/source/app/salshl \
|
vcl/win/source/app/salshl \
|
||||||
vcl/win/source/app/saltimer \
|
vcl/win/source/app/saltimer \
|
||||||
|
vcl/win/source/gdi/cairo_win32_cairo \
|
||||||
vcl/win/source/gdi/gdiimpl \
|
vcl/win/source/gdi/gdiimpl \
|
||||||
vcl/win/source/gdi/salbmp \
|
vcl/win/source/gdi/salbmp \
|
||||||
vcl/win/source/gdi/salgdi \
|
vcl/win/source/gdi/salgdi \
|
||||||
|
@@ -89,6 +89,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_gen,\
|
|||||||
vcl/unx/generic/dtrans/X11_selection \
|
vcl/unx/generic/dtrans/X11_selection \
|
||||||
vcl/unx/generic/dtrans/X11_service \
|
vcl/unx/generic/dtrans/X11_service \
|
||||||
vcl/unx/generic/dtrans/X11_transferable \
|
vcl/unx/generic/dtrans/X11_transferable \
|
||||||
|
vcl/unx/generic/gdi/cairo_xlib_cairo \
|
||||||
vcl/unx/generic/gdi/x11cairotextrender \
|
vcl/unx/generic/gdi/x11cairotextrender \
|
||||||
vcl/unx/generic/gdi/gcach_xpeer \
|
vcl/unx/generic/gdi/gcach_xpeer \
|
||||||
vcl/unx/generic/gdi/gdiimpl \
|
vcl/unx/generic/gdi/gdiimpl \
|
||||||
|
@@ -1214,6 +1214,26 @@ bool GenPspGraphics::SupportsCairo() const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cairo::SurfaceSharedPtr GenPspGraphics::CreateSurface(const cairo::CairoSurfaceSharedPtr& /*rSurface*/) const
|
||||||
|
{
|
||||||
|
return cairo::SurfaceSharedPtr();
|
||||||
|
}
|
||||||
|
|
||||||
|
cairo::SurfaceSharedPtr GenPspGraphics::CreateSurface(const OutputDevice& /*rRefDevice*/, int /*x*/, int /*y*/, int /*width*/, int /*height*/) const
|
||||||
|
{
|
||||||
|
return cairo::SurfaceSharedPtr();
|
||||||
|
}
|
||||||
|
|
||||||
|
cairo::SurfaceSharedPtr GenPspGraphics::CreateBitmapSurface(const OutputDevice& /*rRefDevice*/, const BitmapSystemData& /*rData*/, const Size& /*rSize*/) const
|
||||||
|
{
|
||||||
|
return cairo::SurfaceSharedPtr();
|
||||||
|
}
|
||||||
|
|
||||||
|
css::uno::Any GenPspGraphics::GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& /*rSurface*/, const basegfx::B2ISize& /*rSize*/) const
|
||||||
|
{
|
||||||
|
return css::uno::Any();
|
||||||
|
}
|
||||||
|
|
||||||
SystemFontData GenPspGraphics::GetSysFontData( int /* nFallbacklevel */ ) const
|
SystemFontData GenPspGraphics::GetSysFontData( int /* nFallbacklevel */ ) const
|
||||||
{
|
{
|
||||||
return SystemFontData();
|
return SystemFontData();
|
||||||
|
@@ -738,4 +738,24 @@ bool SvpSalGraphics::SupportsCairo() const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cairo::SurfaceSharedPtr SvpSalGraphics::CreateSurface(const cairo::CairoSurfaceSharedPtr& /*rSurface*/) const
|
||||||
|
{
|
||||||
|
return cairo::SurfaceSharedPtr();
|
||||||
|
}
|
||||||
|
|
||||||
|
cairo::SurfaceSharedPtr SvpSalGraphics::CreateSurface(const OutputDevice& /*rRefDevice*/, int /*x*/, int /*y*/, int /*width*/, int /*height*/) const
|
||||||
|
{
|
||||||
|
return cairo::SurfaceSharedPtr();
|
||||||
|
}
|
||||||
|
|
||||||
|
cairo::SurfaceSharedPtr SvpSalGraphics::CreateBitmapSurface(const OutputDevice& /*rRefDevice*/, const BitmapSystemData& /*rData*/, const Size& /*rSize*/) const
|
||||||
|
{
|
||||||
|
return cairo::SurfaceSharedPtr();
|
||||||
|
}
|
||||||
|
|
||||||
|
css::uno::Any SvpSalGraphics::GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& /*rSurface*/, const basegfx::B2ISize& /*rSize*/) const
|
||||||
|
{
|
||||||
|
return css::uno::Any();
|
||||||
|
}
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
|
36
vcl/inc/cairo_cairo.hxx
Normal file
36
vcl/inc/cairo_cairo.hxx
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||||
|
/*
|
||||||
|
* This file is part of the LibreOffice project.
|
||||||
|
*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
*
|
||||||
|
* This file incorporates work covered by the following license notice:
|
||||||
|
*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
* contributor license agreements. See the NOTICE file distributed
|
||||||
|
* with this work for additional information regarding copyright
|
||||||
|
* ownership. The ASF licenses this file to you under the Apache
|
||||||
|
* License, Version 2.0 (the "License"); you may not use this file
|
||||||
|
* except in compliance with the License. You may obtain a copy of
|
||||||
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef INCLUDED_CANVAS_SOURCE_CAIRO_CAIRO_CAIRO_HXX
|
||||||
|
#define INCLUDED_CANVAS_SOURCE_CAIRO_CAIRO_CAIRO_HXX
|
||||||
|
|
||||||
|
#include <sal/config.h>
|
||||||
|
#include <vcl/cairo.hxx>
|
||||||
|
#include "vcl/dllapi.h"
|
||||||
|
|
||||||
|
struct SystemEnvData;
|
||||||
|
namespace vcl { class Window; }
|
||||||
|
|
||||||
|
namespace cairo {
|
||||||
|
VCL_PLUGIN_PUBLIC const SystemEnvData* GetSysData(const vcl::Window *pOutputWindow);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@@ -202,6 +202,10 @@ public:
|
|||||||
|
|
||||||
virtual SystemGraphicsData GetGraphicsData() const SAL_OVERRIDE;
|
virtual SystemGraphicsData GetGraphicsData() const SAL_OVERRIDE;
|
||||||
virtual bool SupportsCairo() const SAL_OVERRIDE;
|
virtual bool SupportsCairo() const SAL_OVERRIDE;
|
||||||
|
virtual cairo::SurfaceSharedPtr CreateSurface(const cairo::CairoSurfaceSharedPtr& rSurface) const SAL_OVERRIDE;
|
||||||
|
virtual cairo::SurfaceSharedPtr CreateSurface(const OutputDevice& rRefDevice, int x, int y, int width, int height) const SAL_OVERRIDE;
|
||||||
|
virtual cairo::SurfaceSharedPtr CreateBitmapSurface(const OutputDevice& rRefDevice, const BitmapSystemData& rData, const Size& rSize) const SAL_OVERRIDE;
|
||||||
|
virtual css::uno::Any GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& rSurface, const basegfx::B2ISize& rSize) const SAL_OVERRIDE;
|
||||||
|
|
||||||
virtual SystemFontData GetSysFontData( int nFallbacklevel ) const SAL_OVERRIDE;
|
virtual SystemFontData GetSysFontData( int nFallbacklevel ) const SAL_OVERRIDE;
|
||||||
|
|
||||||
|
@@ -200,6 +200,10 @@ public:
|
|||||||
|
|
||||||
virtual SystemGraphicsData GetGraphicsData() const SAL_OVERRIDE;
|
virtual SystemGraphicsData GetGraphicsData() const SAL_OVERRIDE;
|
||||||
virtual bool SupportsCairo() const SAL_OVERRIDE;
|
virtual bool SupportsCairo() const SAL_OVERRIDE;
|
||||||
|
virtual cairo::SurfaceSharedPtr CreateSurface(const cairo::CairoSurfaceSharedPtr& rSurface) const SAL_OVERRIDE;
|
||||||
|
virtual cairo::SurfaceSharedPtr CreateSurface(const OutputDevice& rRefDevice, int x, int y, int width, int height) const SAL_OVERRIDE;
|
||||||
|
virtual cairo::SurfaceSharedPtr CreateBitmapSurface(const OutputDevice& rRefDevice, const BitmapSystemData& rData, const Size& rSize) const SAL_OVERRIDE;
|
||||||
|
virtual css::uno::Any GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& rSurface, const basegfx::B2ISize& rSize) const SAL_OVERRIDE;
|
||||||
|
|
||||||
virtual SystemFontData GetSysFontData( int nFallbacklevel ) const SAL_OVERRIDE;
|
virtual SystemFontData GetSysFontData( int nFallbacklevel ) const SAL_OVERRIDE;
|
||||||
|
|
||||||
|
@@ -419,6 +419,10 @@ public:
|
|||||||
virtual SystemGraphicsData
|
virtual SystemGraphicsData
|
||||||
GetGraphicsData() const SAL_OVERRIDE;
|
GetGraphicsData() const SAL_OVERRIDE;
|
||||||
virtual bool SupportsCairo() const SAL_OVERRIDE;
|
virtual bool SupportsCairo() const SAL_OVERRIDE;
|
||||||
|
virtual cairo::SurfaceSharedPtr CreateSurface(const cairo::CairoSurfaceSharedPtr& rSurface) const SAL_OVERRIDE;
|
||||||
|
virtual cairo::SurfaceSharedPtr CreateSurface(const OutputDevice& rRefDevice, int x, int y, int width, int height) const SAL_OVERRIDE;
|
||||||
|
virtual cairo::SurfaceSharedPtr CreateBitmapSurface(const OutputDevice& rRefDevice, const BitmapSystemData& rData, const Size& rSize) const SAL_OVERRIDE;
|
||||||
|
virtual css::uno::Any GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& rSurface, const ::basegfx::B2ISize& rSize) const SAL_OVERRIDE;
|
||||||
virtual SystemFontData GetSysFontData( int /* nFallbacklevel */ ) const SAL_OVERRIDE;
|
virtual SystemFontData GetSysFontData( int /* nFallbacklevel */ ) const SAL_OVERRIDE;
|
||||||
|
|
||||||
virtual void BeginPaint() SAL_OVERRIDE { };
|
virtual void BeginPaint() SAL_OVERRIDE { };
|
||||||
|
@@ -440,6 +440,13 @@ public:
|
|||||||
|
|
||||||
/// Check whether cairo will work
|
/// Check whether cairo will work
|
||||||
virtual bool SupportsCairo() const = 0;
|
virtual bool SupportsCairo() const = 0;
|
||||||
|
/// Create Surface from given cairo surface
|
||||||
|
virtual cairo::SurfaceSharedPtr CreateSurface(const cairo::CairoSurfaceSharedPtr& rSurface) const = 0;
|
||||||
|
/// Create surface with given dimensions
|
||||||
|
virtual cairo::SurfaceSharedPtr CreateSurface(const OutputDevice& rRefDevice, int x, int y, int width, int height) const = 0;
|
||||||
|
/// Create Surface for given bitmap data
|
||||||
|
virtual cairo::SurfaceSharedPtr CreateBitmapSurface(const OutputDevice& rRefDevice, const BitmapSystemData& rData, const Size& rSize) const = 0;
|
||||||
|
virtual css::uno::Any GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& rSurface, const ::basegfx::B2ISize& rSize) const = 0;
|
||||||
|
|
||||||
virtual SystemFontData GetSysFontData( int nFallbacklevel ) const = 0;
|
virtual SystemFontData GetSysFontData( int nFallbacklevel ) const = 0;
|
||||||
|
|
||||||
|
@@ -263,6 +263,10 @@ public:
|
|||||||
|
|
||||||
virtual SystemGraphicsData GetGraphicsData() const SAL_OVERRIDE;
|
virtual SystemGraphicsData GetGraphicsData() const SAL_OVERRIDE;
|
||||||
virtual bool SupportsCairo() const SAL_OVERRIDE;
|
virtual bool SupportsCairo() const SAL_OVERRIDE;
|
||||||
|
virtual cairo::SurfaceSharedPtr CreateSurface(const cairo::CairoSurfaceSharedPtr& rSurface) const SAL_OVERRIDE;
|
||||||
|
virtual cairo::SurfaceSharedPtr CreateSurface(const OutputDevice& rRefDevice, int x, int y, int width, int height) const SAL_OVERRIDE;
|
||||||
|
virtual cairo::SurfaceSharedPtr CreateBitmapSurface(const OutputDevice& rRefDevice, const BitmapSystemData& rData, const Size& rSize) const SAL_OVERRIDE;
|
||||||
|
virtual css::uno::Any GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& rSurface, const basegfx::B2ISize& rSize) const SAL_OVERRIDE;
|
||||||
virtual SystemFontData GetSysFontData( int nFallbackLevel ) const SAL_OVERRIDE;
|
virtual SystemFontData GetSysFontData( int nFallbackLevel ) const SAL_OVERRIDE;
|
||||||
|
|
||||||
virtual void BeginPaint() SAL_OVERRIDE;
|
virtual void BeginPaint() SAL_OVERRIDE;
|
||||||
|
@@ -449,6 +449,10 @@ public:
|
|||||||
|
|
||||||
virtual SystemGraphicsData GetGraphicsData() const SAL_OVERRIDE;
|
virtual SystemGraphicsData GetGraphicsData() const SAL_OVERRIDE;
|
||||||
virtual bool SupportsCairo() const SAL_OVERRIDE;
|
virtual bool SupportsCairo() const SAL_OVERRIDE;
|
||||||
|
virtual cairo::SurfaceSharedPtr CreateSurface(const cairo::CairoSurfaceSharedPtr& rSurface) const SAL_OVERRIDE;
|
||||||
|
virtual cairo::SurfaceSharedPtr CreateSurface(const OutputDevice& rRefDevice, int x, int y, int width, int height) const SAL_OVERRIDE;
|
||||||
|
virtual cairo::SurfaceSharedPtr CreateBitmapSurface(const OutputDevice& rRefDevice, const BitmapSystemData& rData, const Size& rSize) const SAL_OVERRIDE;
|
||||||
|
virtual css::uno::Any GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& rSurface, const ::basegfx::B2ISize& rSize) const SAL_OVERRIDE;
|
||||||
virtual SystemFontData GetSysFontData( int nFallbacklevel ) const SAL_OVERRIDE;
|
virtual SystemFontData GetSysFontData( int nFallbacklevel ) const SAL_OVERRIDE;
|
||||||
|
|
||||||
virtual void BeginPaint() SAL_OVERRIDE;
|
virtual void BeginPaint() SAL_OVERRIDE;
|
||||||
|
@@ -17,7 +17,9 @@
|
|||||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined MACOSX || defined IOS
|
#include <config_cairo_canvas.h>
|
||||||
|
|
||||||
|
#if ENABLE_CAIRO_CANVAS
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Mac OS X/Quartz and iOS surface backend for LibreOffice Cairo Canvas *
|
* Mac OS X/Quartz and iOS surface backend for LibreOffice Cairo Canvas *
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
@@ -29,7 +31,7 @@
|
|||||||
|
|
||||||
#include "cairo_cairo.hxx"
|
#include "cairo_cairo.hxx"
|
||||||
|
|
||||||
#if defined CAIRO_HAS_QUARTZ_SURFACE
|
#include <config_cairo_canvas.h>
|
||||||
|
|
||||||
#include "cairo_quartz_cairo.hxx"
|
#include "cairo_quartz_cairo.hxx"
|
||||||
|
|
||||||
@@ -251,81 +253,8 @@ namespace cairo
|
|||||||
new VirtualDevice( &aSystemGraphicsData, Size(1, 1), getDepth() ));
|
new VirtualDevice( &aSystemGraphicsData, Size(1, 1), getDepth() ));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* cairo::createSurface: Create generic Canvas surface using given Cairo Surface
|
|
||||||
*
|
|
||||||
* @param rSurface Cairo Surface
|
|
||||||
*
|
|
||||||
* @return new Surface
|
|
||||||
*/
|
|
||||||
SurfaceSharedPtr createSurface( const CairoSurfaceSharedPtr& rSurface )
|
|
||||||
{
|
|
||||||
return SurfaceSharedPtr(new QuartzSurface(rSurface));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* cairo::createSurface: Create Canvas surface using given VCL Window or Virtualdevice
|
|
||||||
*
|
|
||||||
* @param rSurface Cairo Surface
|
|
||||||
*
|
|
||||||
* For VCL Window, use platform native system environment data (struct SystemEnvData in vcl/inc/sysdata.hxx)
|
|
||||||
* For VCL Virtualdevice, use platform native system graphics data (struct SystemGraphicsData in vcl/inc/sysdata.hxx)
|
|
||||||
*
|
|
||||||
* @return new Surface
|
|
||||||
*/
|
|
||||||
SurfaceSharedPtr createSurface( const OutputDevice& rRefDevice,
|
|
||||||
int x, int y, int width, int height )
|
|
||||||
{
|
|
||||||
SurfaceSharedPtr surf;
|
|
||||||
|
|
||||||
if( rRefDevice.GetOutDevType() == OUTDEV_WINDOW )
|
|
||||||
{
|
|
||||||
const vcl::Window &rWindow = (const vcl::Window &) rRefDevice;
|
|
||||||
const SystemEnvData* pSysData = GetSysData(&rWindow);
|
|
||||||
if (pSysData)
|
|
||||||
surf = SurfaceSharedPtr(new QuartzSurface(pSysData->pView, x, y, width, height));
|
|
||||||
}
|
|
||||||
else if( rRefDevice.GetOutDevType() == OUTDEV_VIRDEV )
|
|
||||||
{
|
|
||||||
SystemGraphicsData aSysData = ((const VirtualDevice&) rRefDevice).GetSystemGfxData();
|
|
||||||
|
|
||||||
if (aSysData.rCGContext)
|
|
||||||
surf = SurfaceSharedPtr(new QuartzSurface(aSysData.rCGContext, x, y, width, height));
|
|
||||||
}
|
|
||||||
return surf;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* cairo::createBitmapSurface: Create platform native Canvas surface from BitmapSystemData
|
|
||||||
* @param OutputDevice (not used)
|
|
||||||
* @param rData Platform native image data (struct BitmapSystemData in vcl/inc/bitmap.hxx)
|
|
||||||
* @param rSize width and height of the new surface
|
|
||||||
*
|
|
||||||
* Create a surface based on image data on rData
|
|
||||||
*
|
|
||||||
* @return new surface or empty surface
|
|
||||||
**/
|
|
||||||
SurfaceSharedPtr createBitmapSurface( const OutputDevice& /* rRefDevice */,
|
|
||||||
const BitmapSystemData& rData,
|
|
||||||
const Size& rSize )
|
|
||||||
{
|
|
||||||
OSL_TRACE( "requested size: %d x %d available size: %d x %d",
|
|
||||||
rSize.Width(), rSize.Height(), rData.mnWidth, rData.mnHeight );
|
|
||||||
|
|
||||||
if ( rData.mnWidth == rSize.Width() && rData.mnHeight == rSize.Height() )
|
|
||||||
{
|
|
||||||
CGContextRef rContext = (CGContextRef)rData.rImageContext;
|
|
||||||
OSL_TRACE("Canvas::cairo::createBitmapSurface(): New native image surface, context = %p.", rData.rImageContext);
|
|
||||||
|
|
||||||
return SurfaceSharedPtr(new QuartzSurface(rContext, 0, 0, rData.mnWidth, rData.mnHeight));
|
|
||||||
}
|
|
||||||
return SurfaceSharedPtr();
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace cairo
|
} // namespace cairo
|
||||||
|
|
||||||
#endif // CAIRO_HAS_QUARTZ_SURFACE
|
#endif
|
||||||
|
|
||||||
#endif // QUARTZ
|
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@@ -39,6 +39,11 @@
|
|||||||
#include <vcl/sysdata.hxx>
|
#include <vcl/sysdata.hxx>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <config_cairo_canvas.h>
|
||||||
|
#if ENABLE_CAIRO_CANVAS
|
||||||
|
#include "cairo_quartz_cairo.hxx"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(IOS) && defined(DBG_UTIL)
|
#if defined(IOS) && defined(DBG_UTIL)
|
||||||
|
|
||||||
// Variables in TiledView.m
|
// Variables in TiledView.m
|
||||||
@@ -1447,7 +1452,115 @@ SystemGraphicsData AquaSalGraphics::GetGraphicsData() const
|
|||||||
|
|
||||||
bool AquaSalGraphics::SupportsCairo() const
|
bool AquaSalGraphics::SupportsCairo() const
|
||||||
{
|
{
|
||||||
|
#if ENABLE_CAIRO_CANVAS
|
||||||
return true;
|
return true;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* cairo::createSurface: Create generic Canvas surface using given Cairo Surface
|
||||||
|
*
|
||||||
|
* @param rSurface Cairo Surface
|
||||||
|
*
|
||||||
|
* @return new Surface
|
||||||
|
*/
|
||||||
|
cairo::SurfaceSharedPtr AquaSalGraphics::CreateSurface(const cairo::CairoSurfaceSharedPtr& rSurface) const
|
||||||
|
{
|
||||||
|
#if ENABLE_CAIRO_CANVAS
|
||||||
|
return cairo::SurfaceSharedPtr(new cairo::QuartzSurface(rSurface));
|
||||||
|
#else
|
||||||
|
(void)rSurface;
|
||||||
|
return cairo::SurfaceSharedPtr();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* cairo::createSurface: Create Canvas surface using given VCL Window or Virtualdevice
|
||||||
|
*
|
||||||
|
* @param rSurface Cairo Surface
|
||||||
|
*
|
||||||
|
* For VCL Window, use platform native system environment data (struct SystemEnvData in vcl/inc/sysdata.hxx)
|
||||||
|
* For VCL Virtualdevice, use platform native system graphics data (struct SystemGraphicsData in vcl/inc/sysdata.hxx)
|
||||||
|
*
|
||||||
|
* @return new Surface
|
||||||
|
*/
|
||||||
|
cairo::SurfaceSharedPtr AquaSalGraphics::CreateSurface( const OutputDevice& rRefDevice,
|
||||||
|
int x, int y, int width, int height ) const
|
||||||
|
{
|
||||||
|
cairo::SurfaceSharedPtr surf;
|
||||||
|
#if ENABLE_CAIRO_CANVAS
|
||||||
|
if( rRefDevice.GetOutDevType() == OUTDEV_WINDOW )
|
||||||
|
{
|
||||||
|
const vcl::Window &rWindow = (const vcl::Window &) rRefDevice;
|
||||||
|
const SystemEnvData* pSysData = GetSysData(&rWindow);
|
||||||
|
if (pSysData)
|
||||||
|
surf = cairo::SurfaceSharedPtr(new cairo::QuartzSurface(pSysData->pView, x, y, width, height));
|
||||||
|
}
|
||||||
|
else if( rRefDevice.GetOutDevType() == OUTDEV_VIRDEV )
|
||||||
|
{
|
||||||
|
SystemGraphicsData aSysData = ((const VirtualDevice&) rRefDevice).GetSystemGfxData();
|
||||||
|
|
||||||
|
if (aSysData.rCGContext)
|
||||||
|
surf = cairo::SurfaceSharedPtr(new cairo::QuartzSurface(aSysData.rCGContext, x, y, width, height));
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
(void)rRefDevice;
|
||||||
|
(void)x;
|
||||||
|
(void)y;
|
||||||
|
(void)width;
|
||||||
|
(void)height;
|
||||||
|
#endif
|
||||||
|
return surf;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* cairo::createBitmapSurface: Create platform native Canvas surface from BitmapSystemData
|
||||||
|
* @param OutputDevice (not used)
|
||||||
|
* @param rData Platform native image data (struct BitmapSystemData in vcl/inc/bitmap.hxx)
|
||||||
|
* @param rSize width and height of the new surface
|
||||||
|
*
|
||||||
|
* Create a surface based on image data on rData
|
||||||
|
*
|
||||||
|
* @return new surface or empty surface
|
||||||
|
**/
|
||||||
|
cairo::SurfaceSharedPtr AquaSalGraphics::CreateBitmapSurface( const OutputDevice& /* rRefDevice */,
|
||||||
|
const BitmapSystemData& rData,
|
||||||
|
const Size& rSize ) const
|
||||||
|
{
|
||||||
|
#if ENABLE_CAIRO_CANVAS
|
||||||
|
OSL_TRACE( "requested size: %d x %d available size: %d x %d",
|
||||||
|
rSize.Width(), rSize.Height(), rData.mnWidth, rData.mnHeight );
|
||||||
|
|
||||||
|
if ( rData.mnWidth == rSize.Width() && rData.mnHeight == rSize.Height() )
|
||||||
|
{
|
||||||
|
CGContextRef rContext = (CGContextRef)rData.rImageContext;
|
||||||
|
OSL_TRACE("Canvas::cairo::createBitmapSurface(): New native image surface, context = %p.", rData.rImageContext);
|
||||||
|
|
||||||
|
return cairo::SurfaceSharedPtr(new cairo::QuartzSurface(rContext, 0, 0, rData.mnWidth, rData.mnHeight));
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
(void)rData;
|
||||||
|
(void)rSize;
|
||||||
|
#endif
|
||||||
|
return cairo::SurfaceSharedPtr();
|
||||||
|
}
|
||||||
|
|
||||||
|
css::uno::Any AquaSalGraphics::GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& rSurface, const ::basegfx::B2ISize& /*rSize*/) const
|
||||||
|
{
|
||||||
|
sal_IntPtr handle;
|
||||||
|
#if ENABLE_CAIRO_CANVAS
|
||||||
|
cairo::QuartzSurface* pQuartzSurface = dynamic_cast<cairo::QuartzSurface*>(rSurface.get());
|
||||||
|
OSL_ASSERT(pQuartzSurface);
|
||||||
|
handle = sal_IntPtr (pQuartzSurface->getCGContext());
|
||||||
|
#else
|
||||||
|
handle = 0;
|
||||||
|
(void)rSurface;
|
||||||
|
#endif
|
||||||
|
css::uno::Sequence< css::uno::Any > args( 1 );
|
||||||
|
args[0] = css::uno::Any( handle );
|
||||||
|
return css::uno::Any( args );
|
||||||
}
|
}
|
||||||
|
|
||||||
long AquaSalGraphics::GetGraphicsWidth() const
|
long AquaSalGraphics::GetGraphicsWidth() const
|
||||||
|
@@ -64,6 +64,8 @@
|
|||||||
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
||||||
#include <comphelper/processfactory.hxx>
|
#include <comphelper/processfactory.hxx>
|
||||||
|
|
||||||
|
#include <config_cairo_canvas.h>
|
||||||
|
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
#include <stack>
|
#include <stack>
|
||||||
|
|
||||||
@@ -299,6 +301,7 @@ SystemGraphicsData OutputDevice::GetSystemGfxData() const
|
|||||||
|
|
||||||
bool OutputDevice::SupportsCairo() const
|
bool OutputDevice::SupportsCairo() const
|
||||||
{
|
{
|
||||||
|
#if ENABLE_CAIRO_CANVAS
|
||||||
if (!mpGraphics)
|
if (!mpGraphics)
|
||||||
{
|
{
|
||||||
if (!AcquireGraphics())
|
if (!AcquireGraphics())
|
||||||
@@ -306,6 +309,49 @@ bool OutputDevice::SupportsCairo() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
return mpGraphics->SupportsCairo();
|
return mpGraphics->SupportsCairo();
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
cairo::SurfaceSharedPtr OutputDevice::CreateSurface(const cairo::CairoSurfaceSharedPtr& rSurface) const
|
||||||
|
{
|
||||||
|
if (!mpGraphics)
|
||||||
|
{
|
||||||
|
if (!AcquireGraphics())
|
||||||
|
return cairo::SurfaceSharedPtr();
|
||||||
|
}
|
||||||
|
return mpGraphics->CreateSurface(rSurface);
|
||||||
|
}
|
||||||
|
|
||||||
|
cairo::SurfaceSharedPtr OutputDevice::CreateSurface(int x, int y, int width, int height) const
|
||||||
|
{
|
||||||
|
if (!mpGraphics)
|
||||||
|
{
|
||||||
|
if (!AcquireGraphics())
|
||||||
|
return cairo::SurfaceSharedPtr();
|
||||||
|
}
|
||||||
|
return mpGraphics->CreateSurface(*this, x, y, width, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
cairo::SurfaceSharedPtr OutputDevice::CreateBitmapSurface(const BitmapSystemData& rData, const Size& rSize) const
|
||||||
|
{
|
||||||
|
if (!mpGraphics)
|
||||||
|
{
|
||||||
|
if (!AcquireGraphics())
|
||||||
|
return cairo::SurfaceSharedPtr();
|
||||||
|
}
|
||||||
|
return mpGraphics->CreateBitmapSurface(*this, rData, rSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
css::uno::Any OutputDevice::GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& rSurface, const ::basegfx::B2ISize& rSize) const
|
||||||
|
{
|
||||||
|
if (!mpGraphics)
|
||||||
|
{
|
||||||
|
if (!AcquireGraphics())
|
||||||
|
return css::uno::Any();
|
||||||
|
}
|
||||||
|
return mpGraphics->GetNativeSurfaceHandle(rSurface, rSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
css::uno::Any OutputDevice::GetSystemGfxDataAny() const
|
css::uno::Any OutputDevice::GetSystemGfxDataAny() const
|
||||||
|
@@ -17,10 +17,13 @@
|
|||||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "cairo_cairo.hxx"
|
|
||||||
|
|
||||||
#include <vcl/sysdata.hxx>
|
#include <vcl/sysdata.hxx>
|
||||||
#include <vcl/syschild.hxx>
|
#include <vcl/syschild.hxx>
|
||||||
|
#include "cairo_cairo.hxx"
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <prewin.h>
|
||||||
|
#include <postwin.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace cairo
|
namespace cairo
|
||||||
{
|
{
|
@@ -24,6 +24,7 @@
|
|||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#include <postx.h>
|
#include <postx.h>
|
||||||
|
|
||||||
|
#include "cairo_cairo.hxx"
|
||||||
#include "cairo_xlib_cairo.hxx"
|
#include "cairo_xlib_cairo.hxx"
|
||||||
|
|
||||||
#include <vcl/sysdata.hxx>
|
#include <vcl/sysdata.hxx>
|
||||||
@@ -193,18 +194,18 @@ namespace cairo
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Surface::getSimilar: Create new similar Canvas surface
|
* Surface::getSimilar: Create new similar Canvas surface
|
||||||
* @param aContent format of the new surface (cairo_content_t from cairo/src/cairo.h)
|
* @param cairo_content_type format of the new surface (cairo_content_t from cairo/src/cairo.h)
|
||||||
* @param width width of the new surface
|
* @param width width of the new surface
|
||||||
* @param height height of the new surface
|
* @param height height of the new surface
|
||||||
*
|
*
|
||||||
* Creates a new Canvas surface. This normally creates platform native surface, even though
|
* Creates a new Canvas surface. This normally creates platform native surface, even though
|
||||||
* generic function is used.
|
* generic function is used.
|
||||||
*
|
*
|
||||||
* Cairo surface from aContent (cairo_content_t)
|
* Cairo surface from cairo_content_type (cairo_content_t)
|
||||||
*
|
*
|
||||||
* @return new surface or NULL
|
* @return new surface or NULL
|
||||||
**/
|
**/
|
||||||
SurfaceSharedPtr X11Surface::getSimilar( Content aContent, int width, int height ) const
|
SurfaceSharedPtr X11Surface::getSimilar(int cairo_content_type, int width, int height ) const
|
||||||
{
|
{
|
||||||
Pixmap hPixmap;
|
Pixmap hPixmap;
|
||||||
|
|
||||||
@@ -213,7 +214,7 @@ namespace cairo
|
|||||||
XRenderPictFormat* pFormat;
|
XRenderPictFormat* pFormat;
|
||||||
int nFormat;
|
int nFormat;
|
||||||
|
|
||||||
switch (aContent)
|
switch (cairo_content_type)
|
||||||
{
|
{
|
||||||
case CAIRO_CONTENT_ALPHA:
|
case CAIRO_CONTENT_ALPHA:
|
||||||
nFormat = PictStandardA8;
|
nFormat = PictStandardA8;
|
||||||
@@ -251,7 +252,8 @@ namespace cairo
|
|||||||
new X11Surface( maSysData,
|
new X11Surface( maSysData,
|
||||||
X11PixmapSharedPtr(),
|
X11PixmapSharedPtr(),
|
||||||
CairoSurfaceSharedPtr(
|
CairoSurfaceSharedPtr(
|
||||||
cairo_surface_create_similar( mpSurface.get(), aContent, width, height ),
|
cairo_surface_create_similar( mpSurface.get(),
|
||||||
|
static_cast<cairo_content_t>(cairo_content_type), width, height ),
|
||||||
&cairo_surface_destroy )));
|
&cairo_surface_destroy )));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -304,59 +306,6 @@ namespace cairo
|
|||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
SurfaceSharedPtr createSurface( const CairoSurfaceSharedPtr& rSurface )
|
|
||||||
{
|
|
||||||
return SurfaceSharedPtr(new X11Surface(rSurface));
|
|
||||||
}
|
|
||||||
|
|
||||||
static X11SysData getSysData( const vcl::Window& rWindow )
|
|
||||||
{
|
|
||||||
const SystemEnvData* pSysData = GetSysData(&rWindow);
|
|
||||||
|
|
||||||
if( !pSysData )
|
|
||||||
return X11SysData();
|
|
||||||
else
|
|
||||||
return X11SysData(*pSysData);
|
|
||||||
}
|
|
||||||
|
|
||||||
static X11SysData getSysData( const VirtualDevice& rVirDev )
|
|
||||||
{
|
|
||||||
return X11SysData( rVirDev.GetSystemGfxData() );
|
|
||||||
}
|
|
||||||
|
|
||||||
SurfaceSharedPtr createSurface( const OutputDevice& rRefDevice,
|
|
||||||
int x, int y, int width, int height )
|
|
||||||
{
|
|
||||||
if( rRefDevice.GetOutDevType() == OUTDEV_WINDOW )
|
|
||||||
return SurfaceSharedPtr(new X11Surface(getSysData(static_cast<const vcl::Window&>(rRefDevice)),
|
|
||||||
x,y,width,height));
|
|
||||||
else if( rRefDevice.GetOutDevType() == OUTDEV_VIRDEV )
|
|
||||||
return SurfaceSharedPtr(new X11Surface(getSysData(static_cast<const VirtualDevice&>(rRefDevice)),
|
|
||||||
x,y,width,height));
|
|
||||||
else
|
|
||||||
return SurfaceSharedPtr();
|
|
||||||
}
|
|
||||||
|
|
||||||
SurfaceSharedPtr createBitmapSurface( const OutputDevice& rRefDevice,
|
|
||||||
const BitmapSystemData& rData,
|
|
||||||
const Size& rSize )
|
|
||||||
{
|
|
||||||
SAL_INFO(
|
|
||||||
"canvas.cairo",
|
|
||||||
"requested size: " << rSize.Width() << " x " << rSize.Height()
|
|
||||||
<< " available size: " << rData.mnWidth << " x "
|
|
||||||
<< rData.mnHeight);
|
|
||||||
if ( rData.mnWidth == rSize.Width() && rData.mnHeight == rSize.Height() )
|
|
||||||
{
|
|
||||||
if( rRefDevice.GetOutDevType() == OUTDEV_WINDOW )
|
|
||||||
return SurfaceSharedPtr(new X11Surface(getSysData(static_cast<const vcl::Window&>(rRefDevice)), rData ));
|
|
||||||
else if( rRefDevice.GetOutDevType() == OUTDEV_VIRDEV )
|
|
||||||
return SurfaceSharedPtr(new X11Surface(getSysData(static_cast<const VirtualDevice&>(rRefDevice)), rData ));
|
|
||||||
}
|
|
||||||
|
|
||||||
return SurfaceSharedPtr();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@@ -24,8 +24,9 @@
|
|||||||
|
|
||||||
#include <sal/types.h>
|
#include <sal/types.h>
|
||||||
|
|
||||||
#include "cairo_cairo.hxx"
|
#include <vcl/cairo.hxx>
|
||||||
|
|
||||||
|
class BitmapSystemData;
|
||||||
struct SystemEnvData;
|
struct SystemEnvData;
|
||||||
struct SystemGraphicsData;
|
struct SystemGraphicsData;
|
||||||
|
|
||||||
@@ -84,7 +85,7 @@ namespace cairo {
|
|||||||
// Surface interface
|
// Surface interface
|
||||||
virtual CairoSharedPtr getCairo() const SAL_OVERRIDE;
|
virtual CairoSharedPtr getCairo() const SAL_OVERRIDE;
|
||||||
virtual CairoSurfaceSharedPtr getCairoSurface() const SAL_OVERRIDE { return mpSurface; }
|
virtual CairoSurfaceSharedPtr getCairoSurface() const SAL_OVERRIDE { return mpSurface; }
|
||||||
virtual SurfaceSharedPtr getSimilar( Content aContent, int width, int height ) const SAL_OVERRIDE;
|
virtual SurfaceSharedPtr getSimilar(int cairo_content_type, int width, int height) const SAL_OVERRIDE;
|
||||||
|
|
||||||
virtual boost::shared_ptr<VirtualDevice> createVirtualDevice() const SAL_OVERRIDE;
|
virtual boost::shared_ptr<VirtualDevice> createVirtualDevice() const SAL_OVERRIDE;
|
||||||
|
|
@@ -40,7 +40,8 @@
|
|||||||
#include "basegfx/polygon/b2dpolypolygoncutter.hxx"
|
#include "basegfx/polygon/b2dpolypolygoncutter.hxx"
|
||||||
#include "basegfx/polygon/b2dtrapezoid.hxx"
|
#include "basegfx/polygon/b2dtrapezoid.hxx"
|
||||||
|
|
||||||
#include "vcl/jobdata.hxx"
|
#include <vcl/jobdata.hxx>
|
||||||
|
#include <vcl/virdev.hxx>
|
||||||
|
|
||||||
#include "unx/salunx.h"
|
#include "unx/salunx.h"
|
||||||
#include "unx/saldata.hxx"
|
#include "unx/saldata.hxx"
|
||||||
@@ -61,6 +62,8 @@
|
|||||||
|
|
||||||
#include "generic/printergfx.hxx"
|
#include "generic/printergfx.hxx"
|
||||||
#include "xrender_peer.hxx"
|
#include "xrender_peer.hxx"
|
||||||
|
#include "cairo_cairo.hxx"
|
||||||
|
#include "cairo_xlib_cairo.hxx"
|
||||||
|
|
||||||
#include <vcl/opengl/OpenGLHelper.hxx>
|
#include <vcl/opengl/OpenGLHelper.hxx>
|
||||||
|
|
||||||
@@ -456,6 +459,71 @@ bool X11SalGraphics::SupportsCairo() const
|
|||||||
return XQueryExtension(pDisplay, "RENDER", &nDummy, &nDummy, &nDummy);
|
return XQueryExtension(pDisplay, "RENDER", &nDummy, &nDummy, &nDummy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cairo::SurfaceSharedPtr X11SalGraphics::CreateSurface(const cairo::CairoSurfaceSharedPtr& rSurface) const
|
||||||
|
{
|
||||||
|
return cairo::SurfaceSharedPtr(new cairo::X11Surface(rSurface));
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
static cairo::X11SysData getSysData( const vcl::Window& rWindow )
|
||||||
|
{
|
||||||
|
const SystemEnvData* pSysData = cairo::GetSysData(&rWindow);
|
||||||
|
|
||||||
|
if( !pSysData )
|
||||||
|
return cairo::X11SysData();
|
||||||
|
else
|
||||||
|
return cairo::X11SysData(*pSysData);
|
||||||
|
}
|
||||||
|
|
||||||
|
static cairo::X11SysData getSysData( const VirtualDevice& rVirDev )
|
||||||
|
{
|
||||||
|
return cairo::X11SysData( rVirDev.GetSystemGfxData() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cairo::SurfaceSharedPtr X11SalGraphics::CreateSurface( const OutputDevice& rRefDevice,
|
||||||
|
int x, int y, int width, int height ) const
|
||||||
|
{
|
||||||
|
if( rRefDevice.GetOutDevType() == OUTDEV_WINDOW )
|
||||||
|
return cairo::SurfaceSharedPtr(new cairo::X11Surface(getSysData(static_cast<const vcl::Window&>(rRefDevice)),
|
||||||
|
x,y,width,height));
|
||||||
|
if( rRefDevice.GetOutDevType() == OUTDEV_VIRDEV )
|
||||||
|
return cairo::SurfaceSharedPtr(new cairo::X11Surface(getSysData(static_cast<const VirtualDevice&>(rRefDevice)),
|
||||||
|
x,y,width,height));
|
||||||
|
return cairo::SurfaceSharedPtr();
|
||||||
|
}
|
||||||
|
|
||||||
|
cairo::SurfaceSharedPtr X11SalGraphics::CreateBitmapSurface( const OutputDevice& rRefDevice,
|
||||||
|
const BitmapSystemData& rData,
|
||||||
|
const Size& rSize ) const
|
||||||
|
{
|
||||||
|
SAL_INFO(
|
||||||
|
"canvas.cairo",
|
||||||
|
"requested size: " << rSize.Width() << " x " << rSize.Height()
|
||||||
|
<< " available size: " << rData.mnWidth << " x "
|
||||||
|
<< rData.mnHeight);
|
||||||
|
if ( rData.mnWidth == rSize.Width() && rData.mnHeight == rSize.Height() )
|
||||||
|
{
|
||||||
|
if( rRefDevice.GetOutDevType() == OUTDEV_WINDOW )
|
||||||
|
return cairo::SurfaceSharedPtr(new cairo::X11Surface(getSysData(static_cast<const vcl::Window&>(rRefDevice)), rData ));
|
||||||
|
else if( rRefDevice.GetOutDevType() == OUTDEV_VIRDEV )
|
||||||
|
return cairo::SurfaceSharedPtr(new cairo::X11Surface(getSysData(static_cast<const VirtualDevice&>(rRefDevice)), rData ));
|
||||||
|
}
|
||||||
|
|
||||||
|
return cairo::SurfaceSharedPtr();
|
||||||
|
}
|
||||||
|
|
||||||
|
css::uno::Any X11SalGraphics::GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& rSurface, const ::basegfx::B2ISize& /*rSize*/) const
|
||||||
|
{
|
||||||
|
cairo::X11Surface& rXlibSurface=dynamic_cast<cairo::X11Surface&>(*rSurface.get());
|
||||||
|
css::uno::Sequence< css::uno::Any > args( 3 );
|
||||||
|
args[0] = css::uno::Any( false ); // do not call XFreePixmap on it
|
||||||
|
args[1] = css::uno::Any( rXlibSurface.getPixmap()->mhDrawable );
|
||||||
|
args[2] = css::uno::Any( sal_Int32( rXlibSurface.getDepth() ) );
|
||||||
|
return css::uno::Any(args);
|
||||||
|
}
|
||||||
|
|
||||||
// draw a poly-polygon
|
// draw a poly-polygon
|
||||||
bool X11SalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rOrigPolyPoly, double fTransparency )
|
bool X11SalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rOrigPolyPoly, double fTransparency )
|
||||||
{
|
{
|
||||||
|
@@ -17,7 +17,9 @@
|
|||||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef WNT
|
#include <config_cairo_canvas.h>
|
||||||
|
|
||||||
|
#if ENABLE_CAIRO_CANVAS
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Win32 surface backend for LibreOffice Cairo Canvas *
|
* Win32 surface backend for LibreOffice Cairo Canvas *
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
@@ -29,8 +31,6 @@
|
|||||||
|
|
||||||
#include "cairo_win32_cairo.hxx"
|
#include "cairo_win32_cairo.hxx"
|
||||||
|
|
||||||
#ifdef CAIRO_HAS_WIN32_SURFACE
|
|
||||||
|
|
||||||
namespace cairo
|
namespace cairo
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -130,7 +130,7 @@ namespace cairo
|
|||||||
*
|
*
|
||||||
* @return new surface or NULL
|
* @return new surface or NULL
|
||||||
**/
|
**/
|
||||||
SurfaceSharedPtr Win32Surface::getSimilar( Content aContent, int width, int height ) const
|
SurfaceSharedPtr Win32Surface::getSimilar( int aContent, int width, int height ) const
|
||||||
{
|
{
|
||||||
return SurfaceSharedPtr(
|
return SurfaceSharedPtr(
|
||||||
new Win32Surface(
|
new Win32Surface(
|
||||||
@@ -180,79 +180,8 @@ namespace cairo
|
|||||||
new VirtualDevice( &aSystemGraphicsData, Size(1, 1), sal::static_int_cast<USHORT>(getDepth()) ));
|
new VirtualDevice( &aSystemGraphicsData, Size(1, 1), sal::static_int_cast<USHORT>(getDepth()) ));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* cairo::createSurface: Create generic Canvas surface using given Cairo Surface
|
|
||||||
*
|
|
||||||
* @param rSurface Cairo Surface
|
|
||||||
*
|
|
||||||
* @return new Surface
|
|
||||||
*/
|
|
||||||
SurfaceSharedPtr createSurface( const CairoSurfaceSharedPtr& rSurface )
|
|
||||||
{
|
|
||||||
return SurfaceSharedPtr(new Win32Surface(rSurface));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* cairo::createSurface: Create Canvas surface using given VCL Window or Virtualdevice
|
|
||||||
*
|
|
||||||
* @param rSurface Cairo Surface
|
|
||||||
*
|
|
||||||
* For VCL Window, use platform native system environment data (struct SystemEnvData in vcl/inc/sysdata.hxx)
|
|
||||||
* For VCL Virtualdevice, use platform native system graphics data (struct SystemGraphicsData in vcl/inc/sysdata.hxx)
|
|
||||||
*
|
|
||||||
* @return new Surface
|
|
||||||
*/
|
|
||||||
SurfaceSharedPtr createSurface( const OutputDevice& rRefDevice,
|
|
||||||
int x, int y, int /* width */, int /* height */)
|
|
||||||
{
|
|
||||||
SurfaceSharedPtr surf;
|
|
||||||
|
|
||||||
if( rRefDevice.GetOutDevType() == OUTDEV_WINDOW )
|
|
||||||
{
|
|
||||||
const vcl::Window &rWindow = (const vcl::Window &) rRefDevice;
|
|
||||||
const SystemEnvData* pSysData = GetSysData(&rWindow);
|
|
||||||
if (pSysData && pSysData->hWnd)
|
|
||||||
surf = SurfaceSharedPtr(new Win32Surface(GetDC((HWND) pSysData->hWnd), x, y));
|
|
||||||
}
|
|
||||||
else if( rRefDevice.GetOutDevType() == OUTDEV_VIRDEV )
|
|
||||||
{
|
|
||||||
SystemGraphicsData aSysData = ((const VirtualDevice&) rRefDevice).GetSystemGfxData();
|
|
||||||
if (aSysData.hDC)
|
|
||||||
surf = SurfaceSharedPtr(new Win32Surface((HDC) aSysData.hDC, x, y));
|
|
||||||
}
|
|
||||||
return surf;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* cairo::createBitmapSurface: Create platform native Canvas surface from BitmapSystemData
|
|
||||||
* @param OutputDevice (not used)
|
|
||||||
* @param rData Platform native image data (struct BitmapSystemData in vcl/inc/bitmap.hxx)
|
|
||||||
* @param rSize width and height of the new surface
|
|
||||||
*
|
|
||||||
* Create a surface based on image data on rData
|
|
||||||
*
|
|
||||||
* @return new surface or empty surface
|
|
||||||
**/
|
|
||||||
SurfaceSharedPtr createBitmapSurface( const OutputDevice& /* rRefDevice */,
|
|
||||||
const BitmapSystemData& rData,
|
|
||||||
const Size& rSize )
|
|
||||||
{
|
|
||||||
OSL_TRACE( "requested size: %d x %d available size: %d x %d",
|
|
||||||
rSize.Width(), rSize.Height(), rData.mnWidth, rData.mnHeight );
|
|
||||||
|
|
||||||
if ( rData.mnWidth == rSize.Width() && rData.mnHeight == rSize.Height() )
|
|
||||||
return SurfaceSharedPtr(new Win32Surface( rData ));
|
|
||||||
else
|
|
||||||
return SurfaceSharedPtr();
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace cairo
|
} // namespace cairo
|
||||||
|
|
||||||
#endif // CAIRO_HAS_WIN32_SURFACE
|
#endif // #ENABLE_CAIRO_CANVAS
|
||||||
|
|
||||||
#endif // WNT
|
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@@ -41,7 +41,7 @@ namespace cairo {
|
|||||||
// Surface interface
|
// Surface interface
|
||||||
virtual CairoSharedPtr getCairo() const;
|
virtual CairoSharedPtr getCairo() const;
|
||||||
virtual CairoSurfaceSharedPtr getCairoSurface() const { return mpSurface; }
|
virtual CairoSurfaceSharedPtr getCairoSurface() const { return mpSurface; }
|
||||||
virtual SurfaceSharedPtr getSimilar( Content aContent, int width, int height ) const;
|
virtual SurfaceSharedPtr getSimilar( int aContent, int width, int height ) const;
|
||||||
|
|
||||||
virtual boost::shared_ptr<VirtualDevice> createVirtualDevice() const;
|
virtual boost::shared_ptr<VirtualDevice> createVirtualDevice() const;
|
||||||
|
|
@@ -36,9 +36,14 @@
|
|||||||
#include "salgdiimpl.hxx"
|
#include "salgdiimpl.hxx"
|
||||||
#include "gdiimpl.hxx"
|
#include "gdiimpl.hxx"
|
||||||
#include "opengl/win/gdiimpl.hxx"
|
#include "opengl/win/gdiimpl.hxx"
|
||||||
|
#include <config_cairo_canvas.h>
|
||||||
|
#if ENABLE_CAIRO_CANVAS
|
||||||
|
#include "cairo_win32_cairo.cxx"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <vcl/opengl/OpenGLHelper.hxx>
|
#include <vcl/opengl/OpenGLHelper.hxx>
|
||||||
|
|
||||||
|
|
||||||
#define DITHER_PAL_DELTA 51
|
#define DITHER_PAL_DELTA 51
|
||||||
#define DITHER_PAL_STEPS 6
|
#define DITHER_PAL_STEPS 6
|
||||||
#define DITHER_PAL_COUNT (DITHER_PAL_STEPS*DITHER_PAL_STEPS*DITHER_PAL_STEPS)
|
#define DITHER_PAL_COUNT (DITHER_PAL_STEPS*DITHER_PAL_STEPS*DITHER_PAL_STEPS)
|
||||||
@@ -1075,7 +1080,136 @@ SystemGraphicsData WinSalGraphics::GetGraphicsData() const
|
|||||||
|
|
||||||
bool WinSalGraphics::SupportsCairo() const
|
bool WinSalGraphics::SupportsCairo() const
|
||||||
{
|
{
|
||||||
|
#if ENABLE_CAIRO_CANVAS
|
||||||
return true;
|
return true;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* cairo::createSurface: Create generic Canvas surface using given Cairo Surface
|
||||||
|
*
|
||||||
|
* @param rSurface Cairo Surface
|
||||||
|
*
|
||||||
|
* @return new Surface
|
||||||
|
*/
|
||||||
|
cairo::SurfaceSharedPtr WinSalGraphics::CreateSurface(const cairo::CairoSurfaceSharedPtr& rSurface) const
|
||||||
|
{
|
||||||
|
#if ENABLE_CAIRO_CANVAS
|
||||||
|
return cairo::SurfaceSharedPtr(new cairo::Win32Surface(rSurface));
|
||||||
|
#else
|
||||||
|
(void)rSurface;
|
||||||
|
return cairo::SurfaceSharedPtr();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* cairo::createSurface: Create Canvas surface using given VCL Window or Virtualdevice
|
||||||
|
*
|
||||||
|
* @param rSurface Cairo Surface
|
||||||
|
*
|
||||||
|
* For VCL Window, use platform native system environment data (struct SystemEnvData in vcl/inc/sysdata.hxx)
|
||||||
|
* For VCL Virtualdevice, use platform native system graphics data (struct SystemGraphicsData in vcl/inc/sysdata.hxx)
|
||||||
|
*
|
||||||
|
* @return new Surface
|
||||||
|
*/
|
||||||
|
cairo::SurfaceSharedPtr WinSalGraphics::CreateSurface( const OutputDevice& rRefDevice,
|
||||||
|
int x, int y, int /* width */, int /* height */) const
|
||||||
|
{
|
||||||
|
cairo::SurfaceSharedPtr surf;
|
||||||
|
|
||||||
|
#if ENABLE_CAIRO_CANVAS
|
||||||
|
if( rRefDevice.GetOutDevType() == OUTDEV_WINDOW )
|
||||||
|
{
|
||||||
|
const vcl::Window &rWindow = (const vcl::Window &) rRefDevice;
|
||||||
|
const SystemEnvData* pSysData = GetSysData(&rWindow);
|
||||||
|
if (pSysData && pSysData->hWnd)
|
||||||
|
surf = cairo::SurfaceSharedPtr(new cairo::Win32Surface(GetDC((HWND) pSysData->hWnd), x, y));
|
||||||
|
}
|
||||||
|
else if( rRefDevice.GetOutDevType() == OUTDEV_VIRDEV )
|
||||||
|
{
|
||||||
|
SystemGraphicsData aSysData = ((const VirtualDevice&) rRefDevice).GetSystemGfxData();
|
||||||
|
if (aSysData.hDC)
|
||||||
|
surf = cairo::SurfaceSharedPtr(new cairo::Win32Surface((HDC) aSysData.hDC, x, y));
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
(void)x;
|
||||||
|
(void)y;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return surf;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* cairo::createBitmapSurface: Create platform native Canvas surface from BitmapSystemData
|
||||||
|
* @param OutputDevice (not used)
|
||||||
|
* @param rData Platform native image data (struct BitmapSystemData in vcl/inc/bitmap.hxx)
|
||||||
|
* @param rSize width and height of the new surface
|
||||||
|
*
|
||||||
|
* Create a surface based on image data on rData
|
||||||
|
*
|
||||||
|
* @return new surface or empty surface
|
||||||
|
**/
|
||||||
|
cairo::SurfaceSharedPtr WinSalGraphics::CreateBitmapSurface( const OutputDevice& /* rRefDevice */,
|
||||||
|
const BitmapSystemData& rData,
|
||||||
|
const Size& rSize ) const
|
||||||
|
{
|
||||||
|
OSL_TRACE( "requested size: %d x %d available size: %d x %d",
|
||||||
|
rSize.Width(), rSize.Height(), rData.mnWidth, rData.mnHeight );
|
||||||
|
|
||||||
|
#if ENABLE_CAIRO_CANVAS
|
||||||
|
if ( rData.mnWidth == rSize.Width() && rData.mnHeight == rSize.Height() )
|
||||||
|
return cairo::SurfaceSharedPtr(new cairo::Win32Surface( rData ));
|
||||||
|
#else
|
||||||
|
(void)rData;
|
||||||
|
(void)rSize;
|
||||||
|
#endif
|
||||||
|
return cairo::SurfaceSharedPtr();
|
||||||
|
}
|
||||||
|
|
||||||
|
#if ENABLE_CAIRO_CANVAS
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
HBITMAP surface2HBitmap( const SurfaceSharedPtr& rSurface, const basegfx::B2ISize& rSize )
|
||||||
|
{
|
||||||
|
// can't seem to retrieve HBITMAP from cairo. copy content then
|
||||||
|
HDC hScreenDC=GetDC(NULL);
|
||||||
|
HBITMAP hBmpBitmap = CreateCompatibleBitmap( hScreenDC,
|
||||||
|
rSize.getX(),
|
||||||
|
rSize.getY() );
|
||||||
|
|
||||||
|
HDC hBmpDC = CreateCompatibleDC( 0 );
|
||||||
|
HBITMAP hBmpOld = (HBITMAP) SelectObject( hBmpDC, hBmpBitmap );
|
||||||
|
|
||||||
|
BitBlt( hBmpDC, 0, 0, rSize.getX(), rSize.getX(),
|
||||||
|
cairo_win32_surface_get_dc(rSurface->getCairoSurface().get()),
|
||||||
|
0, 0, SRCCOPY );
|
||||||
|
|
||||||
|
SelectObject( hBmpDC, hBmpOld );
|
||||||
|
DeleteDC( hBmpDC );
|
||||||
|
|
||||||
|
return hBmpBitmap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
css::uno::Any WinSalGraphics::GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& rSurface, const ::basegfx::B2ISize& rSize) const
|
||||||
|
{
|
||||||
|
// TODO(F2): check whether under all circumstances,
|
||||||
|
// the alpha channel is ignored here.
|
||||||
|
css::uno::Sequence< css::uno::Any > args( 1 );
|
||||||
|
sal_Int64 nHandle;
|
||||||
|
#if ENABLE_CAIRO_CANVAS
|
||||||
|
nHandle = sal_Int64(surface2HBitmap(rSurface, rSize));
|
||||||
|
#else
|
||||||
|
(void)rSurface;
|
||||||
|
(void)rSize;
|
||||||
|
nHandle = 0;
|
||||||
|
#endif
|
||||||
|
args[1] = css::uno::Any(nHandle);
|
||||||
|
// caller frees the bitmap
|
||||||
|
return css::uno::Any( args );
|
||||||
}
|
}
|
||||||
|
|
||||||
void WinSalGraphics::BeginPaint()
|
void WinSalGraphics::BeginPaint()
|
||||||
|
Reference in New Issue
Block a user