diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-03-19 14:43:08 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-03-23 11:42:28 +0000 |
commit | e510a208b01c87a341b43d74d8d901f992379b84 (patch) | |
tree | 7f437b7d48e60ec14b0051993a9f2eb88f40bd53 /vcl/source/outdev/outdev.cxx | |
parent | 2b838285e206912374f464bd1ab8dc8a561f59f5 (diff) |
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>
Diffstat (limited to 'vcl/source/outdev/outdev.cxx')
-rw-r--r-- | vcl/source/outdev/outdev.cxx | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx index c64fbfffcc84..0fe76778cd1e 100644 --- a/vcl/source/outdev/outdev.cxx +++ b/vcl/source/outdev/outdev.cxx @@ -64,6 +64,8 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <comphelper/processfactory.hxx> +#include <config_cairo_canvas.h> + #include <numeric> #include <stack> @@ -299,6 +301,7 @@ SystemGraphicsData OutputDevice::GetSystemGfxData() const bool OutputDevice::SupportsCairo() const { +#if ENABLE_CAIRO_CANVAS if (!mpGraphics) { if (!AcquireGraphics()) @@ -306,6 +309,49 @@ bool OutputDevice::SupportsCairo() const } 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 |