From 0c01238856527c068ccf72b5a56141e508ea4fe4 Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Tue, 24 Jun 2008 10:01:34 +0000 Subject: INTEGRATION: CWS canvas05 (1.12.44); FILE MERGED 2008/04/21 07:28:44 thb 1.12.44.3: RESYNC: (1.12-1.13); FILE MERGED 2007/12/20 22:19:00 thb 1.12.44.2: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/10/01 13:02:04 thb 1.12.44.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom --- canvas/source/vcl/impltools.cxx | 42 +++++++++++++++++------------------------ 1 file changed, 17 insertions(+), 25 deletions(-) (limited to 'canvas') diff --git a/canvas/source/vcl/impltools.cxx b/canvas/source/vcl/impltools.cxx index ec5042bcc19f..aadd2521d488 100644 --- a/canvas/source/vcl/impltools.cxx +++ b/canvas/source/vcl/impltools.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: impltools.cxx,v $ - * $Revision: 1.13 $ + * $Revision: 1.14 $ * * This file is part of OpenOffice.org. * @@ -32,11 +32,7 @@ #include "precompiled_canvas.hxx" #include - -#ifndef _USE_MATH_DEFINES -#define _USE_MATH_DEFINES // needed by Visual C++ for math constants -#endif -#include // M_PI definition +#include #include #include @@ -50,7 +46,6 @@ #include #include #include -#include #include #include @@ -66,7 +61,6 @@ #include #include -#include #include #include "impltools.hxx" @@ -93,28 +87,26 @@ namespace vclcanvas } else { - uno::Reference< lang::XUnoTunnel > xTunnel( xBitmap, uno::UNO_QUERY ); - if( xTunnel.is() ) - { - sal_Int64 nPtr = xTunnel->getSomething( - vcl::unotools::getTunnelIdentifier( - vcl::unotools::Id_BitmapEx ) ); - - if( nPtr ) - return BitmapEx( *reinterpret_cast(sal::static_int_cast(nPtr)) ); - } - SpriteCanvas* pCanvasImpl = dynamic_cast< SpriteCanvas* >( xBitmap.get() ); if( pCanvasImpl && pCanvasImpl->getBackBuffer() ) { - const ::VirtualDevice& rVDev( pCanvasImpl->getBackBuffer()->getVirDev() ); + // TODO(F3): mind the plain Canvas impl. Consolidate with CWS canvas05 + const ::OutputDevice& rDev( pCanvasImpl->getBackBuffer()->getOutDev() ); const ::Point aEmptyPoint; - return rVDev.GetBitmapEx( aEmptyPoint, - rVDev.GetOutputSizePixel() ); + return rDev.GetBitmapEx( aEmptyPoint, + rDev.GetOutputSizePixel() ); } + // TODO(F2): add support for floating point bitmap formats + uno::Reference< rendering::XIntegerReadOnlyBitmap > xIntBmp( + xBitmap, uno::UNO_QUERY_THROW ); + + ::BitmapEx aBmpEx = ::vcl::unotools::bitmapExFromXBitmap( xIntBmp ); + if( !!aBmpEx ) + return aBmpEx; + // TODO(F1): extract pixel from XBitmap interface - ENSURE_AND_THROW( false, + ENSURE_OR_THROW( false, "bitmapExFromXBitmap(): could not extract bitmap" ); } @@ -297,7 +289,7 @@ namespace vclcanvas (pAlphaReadAccess.get() == NULL && rBitmap.IsTransparent()) ) { // TODO(E2): Error handling! - ENSURE_AND_THROW( false, + ENSURE_OR_THROW( false, "transformBitmap(): could not access source bitmap" ); } @@ -541,7 +533,7 @@ namespace vclcanvas else { // TODO(E2): Error handling! - ENSURE_AND_THROW( false, + ENSURE_OR_THROW( false, "transformBitmap(): could not access bitmap" ); } } -- cgit