diff options
author | Mox Soini <mox@iki.fi> | 2015-06-02 23:52:56 +0300 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2015-06-04 21:31:58 +0000 |
commit | e4d55e8045c99af65a2cae57b26ec076825c9673 (patch) | |
tree | 3a56aa0c7998ff643e15c0edee5ad8fdaa0e1fed /vcl/win/source | |
parent | 8854643a0a964f6aa511013c6ab31ed198c74e86 (diff) |
Cleanup crossplatform cairo
Mac / Win cairo is not built / used, this cairo code can be removed to
reduce code bloat.
Change-Id: I758d674291e25e0722f5c66a0096295e903786b1
Reviewed-on: https://gerrit.libreoffice.org/16049
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'vcl/win/source')
-rw-r--r-- | vcl/win/source/gdi/salgdi.cxx | 139 | ||||
-rw-r--r-- | vcl/win/source/gdi/salgdi3.cxx | 15 |
2 files changed, 0 insertions, 154 deletions
diff --git a/vcl/win/source/gdi/salgdi.cxx b/vcl/win/source/gdi/salgdi.cxx index 23d4e5ca1924..95a5e94d15ec 100644 --- a/vcl/win/source/gdi/salgdi.cxx +++ b/vcl/win/source/gdi/salgdi.cxx @@ -36,10 +36,6 @@ #include "salgdiimpl.hxx" #include "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> @@ -1078,141 +1074,6 @@ SystemGraphicsData WinSalGraphics::GetGraphicsData() const return aRes; } -bool WinSalGraphics::SupportsCairo() const -{ -#if ENABLE_CAIRO_CANVAS - 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)rRefDevice; - (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() { return mpImpl->beginPaint(); diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx index 89b8d96e2526..76cbc222926e 100644 --- a/vcl/win/source/gdi/salgdi3.cxx +++ b/vcl/win/source/gdi/salgdi3.cxx @@ -2773,19 +2773,4 @@ void WinSalGraphics::GetGlyphWidths( const PhysicalFontFace* pFont, void WinSalGraphics::DrawServerFontLayout( const ServerFontLayout& ) {} -SystemFontData WinSalGraphics::GetSysFontData( int nFallbacklevel ) const -{ - SystemFontData aSysFontData; - - if (nFallbacklevel >= MAX_FALLBACK) nFallbacklevel = MAX_FALLBACK - 1; - if (nFallbacklevel < 0 ) nFallbacklevel = 0; - - aSysFontData.hFont = mhFonts[nFallbacklevel]; - - OSL_TRACE("\r\n:WinSalGraphics::GetSysFontData(): FontID: %p, Fallback level: %d", - aSysFontData.hFont, nFallbacklevel); - - return aSysFontData; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |