summaryrefslogtreecommitdiff
path: root/canvas/source
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2008-06-24 09:54:35 +0000
committerKurt Zenker <kz@openoffice.org>2008-06-24 09:54:35 +0000
commit17de35c057d0f22f640d73c0b9635c08090a5f34 (patch)
tree4a61802183705086161c9a9e88c342f156d08f54 /canvas/source
parent39ae3afda5ad6a94ca26d3bf3bb198736a08d423 (diff)
INTEGRATION: CWS canvas05 (1.8.68); FILE MERGED
2008/04/21 07:27:49 thb 1.8.68.4: RESYNC: (1.9-1.10); FILE MERGED 2007/12/20 22:18:59 thb 1.8.68.3: #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/11/06 12:36:49 thb 1.8.68.2: RESYNC: (1.8-1.9); FILE MERGED 2007/10/01 13:02:03 thb 1.8.68.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
Diffstat (limited to 'canvas/source')
-rw-r--r--canvas/source/vcl/canvasbitmap.cxx48
1 files changed, 25 insertions, 23 deletions
diff --git a/canvas/source/vcl/canvasbitmap.cxx b/canvas/source/vcl/canvasbitmap.cxx
index 690c4ff64a09..7185ac56f894 100644
--- a/canvas/source/vcl/canvasbitmap.cxx
+++ b/canvas/source/vcl/canvasbitmap.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: canvasbitmap.cxx,v $
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
* This file is part of OpenOffice.org.
*
@@ -32,6 +32,7 @@
#include "precompiled_canvas.hxx"
#include <canvas/debug.hxx>
+#include <tools/diagnose_ex.h>
#include "canvasbitmap.hxx"
#include <vcl/bmpacc.hxx>
@@ -44,17 +45,11 @@ namespace vclcanvas
// Currently, the only way to generate an XBitmap is from
// XGraphicDevice.getCompatibleBitmap(). Therefore, we don't even
// take a bitmap here, but a VDev directly.
- CanvasBitmap::CanvasBitmap( const ::Size& rSize,
- bool bAlphaBitmap,
- const DeviceRef& rDevice ) :
- mpDevice( rDevice )
+ CanvasBitmap::CanvasBitmap( const ::Size& rSize,
+ bool bAlphaBitmap,
+ rendering::XGraphicDevice& rDevice,
+ const OutDevProviderSharedPtr& rOutDevProvider )
{
- ENSURE_AND_THROW( rDevice->getOutDev(),
- "CanvasBitmap::CanvasBitmap(): Invalid reference outdev" );
-
- OutputDevice& rOutDev( *rDevice->getOutDev() );
- tools::OutDevStateKeeper aStateKeeper( rOutDev );
-
// create bitmap for given reference device
// ========================================
const USHORT nBitCount( (USHORT)24U );
@@ -71,30 +66,26 @@ namespace vclcanvas
AlphaMask aAlpha ( rSize );
maCanvasHelper.init( BitmapEx( aBitmap, aAlpha ),
- *rDevice.get() );
+ rDevice,
+ rOutDevProvider );
}
else
{
maCanvasHelper.init( BitmapEx( aBitmap ),
- *rDevice.get() );
+ rDevice,
+ rOutDevProvider );
}
}
- CanvasBitmap::CanvasBitmap( const BitmapEx& rBitmap,
- const DeviceRef& rDevice ) :
- mpDevice( rDevice )
+ CanvasBitmap::CanvasBitmap( const BitmapEx& rBitmap,
+ rendering::XGraphicDevice& rDevice,
+ const OutDevProviderSharedPtr& rOutDevProvider )
{
- ENSURE_AND_THROW( rDevice->getOutDev(),
- "CanvasBitmap::CanvasBitmap(): Invalid reference outdev" );
-
- maCanvasHelper.init( rBitmap,
- *rDevice.get() );
+ maCanvasHelper.init( rBitmap, rDevice, rOutDevProvider );
}
void SAL_CALL CanvasBitmap::disposing()
{
- mpDevice.clear();
-
// forward to base
CanvasBitmap_Base::disposing();
}
@@ -142,4 +133,15 @@ namespace vclcanvas
return maCanvasHelper.repaint( rGrf, viewState, renderState, rPt, rSz, rAttr );
}
+
+ uno::Any SAL_CALL CanvasBitmap::getFastPropertyValue( sal_Int32 nHandle ) throw (uno::RuntimeException)
+ {
+ if( nHandle == 0 ) {
+ BitmapEx* pBitmapEx = new BitmapEx( getBitmap() );
+
+ return uno::Any( reinterpret_cast<sal_Int64>( pBitmapEx ) );
+ }
+
+ return uno::Any( sal_Int64(0) );
+ }
}