diff options
author | Kurt Zenker <kz@openoffice.org> | 2008-06-24 10:01:34 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2008-06-24 10:01:34 +0000 |
commit | 0c01238856527c068ccf72b5a56141e508ea4fe4 (patch) | |
tree | fa67e8e0df5e409b734a461d94b6c6b927c63a2e /canvas | |
parent | bf15ae65a11243266cd958adb8ac795c232b4ba6 (diff) |
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
Diffstat (limited to 'canvas')
-rw-r--r-- | canvas/source/vcl/impltools.cxx | 42 |
1 files changed, 17 insertions, 25 deletions
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 <canvas/debug.hxx> - -#ifndef _USE_MATH_DEFINES -#define _USE_MATH_DEFINES // needed by Visual C++ for math constants -#endif -#include <math.h> // M_PI definition +#include <tools/diagnose_ex.h> #include <rtl/math.hxx> #include <rtl/logfile.hxx> @@ -50,7 +46,6 @@ #include <com/sun/star/rendering/XPolyPolygon2D.hpp> #include <com/sun/star/geometry/RealBezierSegment2D.hpp> #include <com/sun/star/rendering/XIntegerBitmap.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <vcl/salbtype.hxx> #include <vcl/bmpacc.hxx> @@ -66,7 +61,6 @@ #include <basegfx/tools/canvastools.hxx> #include <basegfx/numeric/ftools.hxx> -#include <canvas/base/linepolypolygonbase.hxx> #include <canvas/canvastools.hxx> #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<BitmapEx*>(sal::static_int_cast<sal_uIntPtr>(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" ); } } |