INTEGRATION: CWS cairoquartz01 (1.6.16); FILE MERGED
2008/02/23 13:12:51 mox 1.6.16.13: RESYNC: (1.7-1.8); FILE MERGED 2007/07/28 15:30:53 mox 1.6.16.12: RESYNC: (1.6-1.7); FILE MERGED 2007/07/19 17:25:50 mox 1.6.16.11: Cleanup - We don't need to store mpSysData inside the Surface (in 1.2 API). 2007/07/19 04:35:56 mox 1.6.16.10: Removed platform dependend code from cairo_devicehelper.cxx 2007/07/18 22:10:01 mox 1.6.16.9: Add couple of comments and ensure working QUARTZ build. 2007/07/18 20:48:35 radekdoulik 1.6.16.8: Issue number: 69066 Submitted by: radekdoulik Reviewed by: radekdoulik Fixed xlib backend build. Fixed pixmap double free in xlib backend. Fixed render format generation in xlib backend. 2007/07/17 22:34:42 mox 1.6.16.7: Rework cross-platform files to be separate for each platform. The <1.2 API support is now mostly in platform specific files. 2007/06/20 14:57:14 mox 1.6.16.6: Cleanup headers and fix compilation bugs. 2007/06/19 19:22:15 mox 1.6.16.5: Alternative "legacy" code path for Quartz. 2007/06/04 21:13:49 mox 1.6.16.4: Enable building different platforms with both Cairo 1.0 and Cairo 1.2 APIs. Only Quartz uses the Cairo 1.2 API by default. 2007/06/02 23:05:32 thb 1.6.16.3: #i70519# Merged in tml's fixes for WinCairo; made code compile warning-free under Linux; added prex/postx.h (which where already referenced); cleaned up a bit; replaces plain round() call with basegfx::fround; asserting unexpected/unimplemented case at selected places 2007/05/01 21:21:43 mox 1.6.16.2: urther fixes: - separate X11 cairo 1.0 API to legacy file: cairo_cairolegacy.cxx. - maximize the use of crossplatform code - fix quartz bugs 2007/04/12 20:16:00 mox 1.6.16.1: Issue number: #69066# initial Cairo Quartz implementation
This commit is contained in:
parent
fabdadb774
commit
96b86aa73c
1 changed files with 40 additions and 14 deletions
|
@ -4,9 +4,9 @@
|
|||
*
|
||||
* $RCSfile: cairo_devicehelper.cxx,v $
|
||||
*
|
||||
* $Revision: 1.8 $
|
||||
* $Revision: 1.9 $
|
||||
*
|
||||
* last change: $Author: vg $ $Date: 2008-01-29 08:01:24 $
|
||||
* last change: $Author: kz $ $Date: 2008-04-02 09:42:02 $
|
||||
*
|
||||
* The Contents of this file are made available subject to
|
||||
* the terms of GNU Lesser General Public License Version 2.1.
|
||||
|
@ -36,6 +36,8 @@
|
|||
// MARKER(update_precomp.py): autogen include statement, do not remove
|
||||
#include "precompiled_canvas.hxx"
|
||||
|
||||
#include "cairo_cairo.hxx"
|
||||
|
||||
#include <canvas/debug.hxx>
|
||||
#include <canvas/verbosetrace.hxx>
|
||||
#include <canvas/canvastools.hxx>
|
||||
|
@ -54,11 +56,18 @@
|
|||
|
||||
#include <tools/stream.hxx>
|
||||
|
||||
#include "cairo_helper.hxx"
|
||||
namespace cairo
|
||||
{
|
||||
# include <cairo.h>
|
||||
} // namespace cairo
|
||||
|
||||
#include <vcl/sysdata.hxx>
|
||||
|
||||
#include "cairo_spritecanvas.hxx"
|
||||
#include "cairo_canvasbitmap.hxx"
|
||||
#include "cairo_devicehelper.hxx"
|
||||
|
||||
|
||||
using namespace ::cairo;
|
||||
using namespace ::com::sun::star;
|
||||
|
||||
|
@ -161,7 +170,7 @@ namespace cairocanvas
|
|||
}
|
||||
|
||||
uno::Reference< rendering::XLinePolyPolygon2D > DeviceHelper::createCompatibleLinePolyPolygon(
|
||||
const uno::Reference< rendering::XGraphicDevice >& ,
|
||||
const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/,
|
||||
const uno::Sequence< uno::Sequence< geometry::RealPoint2D > >& points )
|
||||
{
|
||||
// disposed?
|
||||
|
@ -174,7 +183,7 @@ namespace cairocanvas
|
|||
}
|
||||
|
||||
uno::Reference< rendering::XBezierPolyPolygon2D > DeviceHelper::createCompatibleBezierPolyPolygon(
|
||||
const uno::Reference< rendering::XGraphicDevice >& ,
|
||||
const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/,
|
||||
const uno::Sequence< uno::Sequence< geometry::RealBezierSegment2D > >& points )
|
||||
{
|
||||
// disposed?
|
||||
|
@ -187,7 +196,7 @@ namespace cairocanvas
|
|||
}
|
||||
|
||||
uno::Reference< rendering::XBitmap > DeviceHelper::createCompatibleBitmap(
|
||||
const uno::Reference< rendering::XGraphicDevice >& ,
|
||||
const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/,
|
||||
const geometry::IntegerSize2D& size )
|
||||
{
|
||||
// disposed?
|
||||
|
@ -202,14 +211,14 @@ namespace cairocanvas
|
|||
}
|
||||
|
||||
uno::Reference< rendering::XVolatileBitmap > DeviceHelper::createVolatileBitmap(
|
||||
const uno::Reference< rendering::XGraphicDevice >& ,
|
||||
const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/,
|
||||
const geometry::IntegerSize2D& /*size*/ )
|
||||
{
|
||||
return uno::Reference< rendering::XVolatileBitmap >();
|
||||
}
|
||||
|
||||
uno::Reference< rendering::XBitmap > DeviceHelper::createCompatibleAlphaBitmap(
|
||||
const uno::Reference< rendering::XGraphicDevice >& ,
|
||||
const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/,
|
||||
const geometry::IntegerSize2D& size )
|
||||
{
|
||||
// disposed?
|
||||
|
@ -224,7 +233,7 @@ namespace cairocanvas
|
|||
}
|
||||
|
||||
uno::Reference< rendering::XVolatileBitmap > DeviceHelper::createVolatileAlphaBitmap(
|
||||
const uno::Reference< rendering::XGraphicDevice >& ,
|
||||
const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/,
|
||||
const geometry::IntegerSize2D& /*size*/ )
|
||||
{
|
||||
return uno::Reference< rendering::XVolatileBitmap >();
|
||||
|
@ -309,11 +318,15 @@ namespace cairocanvas
|
|||
|
||||
if( mpWindowSurface )
|
||||
{
|
||||
#if defined (UNX) && !defined (QUARTZ)
|
||||
// X11 only
|
||||
mpWindowSurface->Resize( rSize.getX() + mpOutputWindow->GetOutOffXPixel(), rSize.getY() + mpOutputWindow->GetOutOffYPixel() );
|
||||
} else
|
||||
#endif
|
||||
} else {
|
||||
mpWindowSurface = new Surface( mpSysData,
|
||||
mpOutputWindow->GetOutOffXPixel(), mpOutputWindow->GetOutOffYPixel(),
|
||||
rSize.getX(), rSize.getY() );
|
||||
}
|
||||
|
||||
if( mpBufferSurface && maSize != rSize )
|
||||
{
|
||||
|
@ -372,14 +385,23 @@ namespace cairocanvas
|
|||
|
||||
Surface* DeviceHelper::getSurface( BitmapSystemData& rData, const Size& rSize )
|
||||
{
|
||||
#ifdef CAIRO_HAS_WIN32_SURFACE
|
||||
if (rData.pDIB != NULL) {
|
||||
OSL_ENSURE(false, "DeviceHelper::getSurface(): cannot provide Surface!");
|
||||
// Using cairo will not work anyway, as most (?) DIBs that come here
|
||||
// will be upside-down and different order of colour channels
|
||||
// compared to what cairo expects.
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
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 new Surface ( mpSysData, &rData, rSize.Width(), rSize.Height() );
|
||||
else
|
||||
else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** DeviceHelper::flush Flush the platform native window
|
||||
*
|
||||
* Flushes the window by using the internally stored mpSysData.
|
||||
|
@ -387,6 +409,10 @@ namespace cairocanvas
|
|||
**/
|
||||
void DeviceHelper::flush()
|
||||
{
|
||||
cairoHelperFlush( mpSysData );
|
||||
#ifdef UNX
|
||||
// Only used by Xlib and the current Mac OS X Quartz implementation
|
||||
mpWindowSurface->flush(mpSysData);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace cairocanvas
|
||||
|
|
Loading…
Reference in a new issue