diff options
author | Kurt Zenker <kz@openoffice.org> | 2008-06-24 10:03:32 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2008-06-24 10:03:32 +0000 |
commit | 76ec3139cda3f4d6547e7f8b91f1f38c63f5a81d (patch) | |
tree | 07386e10a0a48b4f62241adf88d9b352a11c6730 | |
parent | 66db37c9e1e57347274544ca887adf206c01bed9 (diff) |
INTEGRATION: CWS canvas05 (1.10.26); FILE MERGED
2008/04/21 07:28:59 thb 1.10.26.4: RESYNC: (1.10-1.11); FILE MERGED
2008/04/09 14:33:12 thb 1.10.26.3: Gave back vclcanvas the window surface; made cairocanvas consistent with rest (regarding setWindow)
2007/12/20 22:19:00 thb 1.10.26.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.10.26.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
-rw-r--r-- | canvas/source/vcl/spritecanvashelper.cxx | 80 |
1 files changed, 46 insertions, 34 deletions
diff --git a/canvas/source/vcl/spritecanvashelper.cxx b/canvas/source/vcl/spritecanvashelper.cxx index 979e7ae0b58e..89d3896d0a16 100644 --- a/canvas/source/vcl/spritecanvashelper.cxx +++ b/canvas/source/vcl/spritecanvashelper.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: spritecanvashelper.cxx,v $ - * $Revision: 1.11 $ + * $Revision: 1.12 $ * * 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 <canvas/verbosetrace.hxx> #include <canvas/canvastools.hxx> @@ -188,6 +189,7 @@ namespace vclcanvas SpriteCanvasHelper::SpriteCanvasHelper() : mpRedrawManager( NULL ), + mpOwningSpriteCanvas( NULL ), maVDev(), maLastUpdate(), mbShowFrameInfo( false ), @@ -200,14 +202,22 @@ namespace vclcanvas #endif } - void SpriteCanvasHelper::setRedrawManager( ::canvas::SpriteRedrawManager& rManager ) + void SpriteCanvasHelper::init( const OutDevProviderSharedPtr& rOutDev, + SpriteCanvas& rOwningSpriteCanvas, + ::canvas::SpriteRedrawManager& rManager, + bool bProtect, + bool bHaveAlpha ) { + mpOwningSpriteCanvas = &rOwningSpriteCanvas; mpRedrawManager = &rManager; + + CanvasHelper::init(rOwningSpriteCanvas,rOutDev,bProtect,bHaveAlpha); } void SpriteCanvasHelper::disposing() { mpRedrawManager = NULL; + mpOwningSpriteCanvas = NULL; // forward to base CanvasHelper::disposing(); @@ -228,12 +238,14 @@ namespace vclcanvas uno::Reference< rendering::XCustomSprite > SpriteCanvasHelper::createCustomSprite( const geometry::RealSize2D& spriteSize ) { - if( !mpRedrawManager ) + if( !mpRedrawManager || !mpDevice ) return uno::Reference< rendering::XCustomSprite >(); // we're disposed return uno::Reference< rendering::XCustomSprite >( new CanvasCustomSprite( spriteSize, - mpDevice, + *mpDevice, + mpOwningSpriteCanvas, + mpOwningSpriteCanvas->getFrontBuffer(), mbShowSpriteBounds ) ); } @@ -246,9 +258,9 @@ namespace vclcanvas bool& io_bSurfaceDirty ) { if( !mpRedrawManager || - !mpDevice || - !mpDevice->getOutDev() || - !mpDevice->getBackBuffer() ) + !mpOwningSpriteCanvas || + !mpOwningSpriteCanvas->getFrontBuffer() || + !mpOwningSpriteCanvas->getBackBuffer() ) { return sal_False; // disposed, or otherwise dysfunctional } @@ -256,8 +268,8 @@ namespace vclcanvas // commit to backbuffer flush(); - OutputDevice& rOutDev( *mpDevice->getOutDev() ); - BackBufferSharedPtr pBackBuffer( mpDevice->getBackBuffer() ); + OutputDevice& rOutDev( mpOwningSpriteCanvas->getFrontBuffer()->getOutDev() ); + BackBufferSharedPtr pBackBuffer( mpOwningSpriteCanvas->getBackBuffer() ); OutputDevice& rBackOutDev( pBackBuffer->getOutDev() ); // actual OutputDevice is a shared resource - restore its @@ -366,13 +378,13 @@ namespace vclcanvas void SpriteCanvasHelper::backgroundPaint( const ::basegfx::B2DRange& rUpdateRect ) { - ENSURE_AND_THROW( mpDevice && - mpDevice->getOutDev() && - mpDevice->getBackBuffer(), - "SpriteCanvasHelper::backgroundPaint(): NULL device pointer " ); + ENSURE_OR_THROW( mpOwningSpriteCanvas && + mpOwningSpriteCanvas->getBackBuffer() && + mpOwningSpriteCanvas->getFrontBuffer(), + "SpriteCanvasHelper::backgroundPaint(): NULL device pointer " ); - OutputDevice& rOutDev( *mpDevice->getOutDev() ); - BackBufferSharedPtr pBackBuffer( mpDevice->getBackBuffer() ); + OutputDevice& rOutDev( mpOwningSpriteCanvas->getFrontBuffer()->getOutDev() ); + BackBufferSharedPtr pBackBuffer( mpOwningSpriteCanvas->getBackBuffer() ); OutputDevice& rBackOutDev( pBackBuffer->getOutDev() ); repaintBackground( rOutDev, rBackOutDev, rUpdateRect ); @@ -382,13 +394,13 @@ namespace vclcanvas const ::basegfx::B2DRange& rMoveEnd, const ::canvas::SpriteRedrawManager::UpdateArea& rUpdateArea ) { - ENSURE_AND_THROW( mpDevice && - mpDevice->getOutDev() && - mpDevice->getBackBuffer(), - "SpriteCanvasHelper::scrollUpdate(): NULL device pointer " ); + ENSURE_OR_THROW( mpOwningSpriteCanvas && + mpOwningSpriteCanvas->getBackBuffer() && + mpOwningSpriteCanvas->getFrontBuffer(), + "SpriteCanvasHelper::scrollUpdate(): NULL device pointer " ); - OutputDevice& rOutDev( *mpDevice->getOutDev() ); - BackBufferSharedPtr pBackBuffer( mpDevice->getBackBuffer() ); + OutputDevice& rOutDev( mpOwningSpriteCanvas->getFrontBuffer()->getOutDev() ); + BackBufferSharedPtr pBackBuffer( mpOwningSpriteCanvas->getBackBuffer() ); OutputDevice& rBackOutDev( pBackBuffer->getOutDev() ); const Size& rTargetSizePixel( rOutDev.GetOutputSizePixel() ); @@ -449,7 +461,7 @@ namespace vclcanvas ::canvas::SpriteRedrawManager::SpriteConnectedRanges::ComponentListType::const_iterator aSecond( aFirst ); ++aSecond; - ENSURE_AND_THROW( aFirst->second.getSprite().is(), + ENSURE_OR_THROW( aFirst->second.getSprite().is(), "VCLCanvas::scrollUpdate(): no sprite" ); // repaint uncovered areas from sprite. Need to actually @@ -485,12 +497,12 @@ namespace vclcanvas { (void)rTotalArea; - ENSURE_AND_THROW( mpDevice && - mpDevice->getOutDev() && - mpDevice->getBackBuffer(), - "SpriteCanvasHelper::opaqueUpdate(): NULL device pointer " ); + ENSURE_OR_THROW( mpOwningSpriteCanvas && + mpOwningSpriteCanvas->getBackBuffer() && + mpOwningSpriteCanvas->getFrontBuffer(), + "SpriteCanvasHelper::opaqueUpdate(): NULL device pointer " ); - OutputDevice& rOutDev( *mpDevice->getOutDev() ); + OutputDevice& rOutDev( mpOwningSpriteCanvas->getFrontBuffer()->getOutDev() ); // no need to clip output to actual update region - there will // always be ALL sprites contained in the rectangular update @@ -511,13 +523,13 @@ namespace vclcanvas void SpriteCanvasHelper::genericUpdate( const ::basegfx::B2DRange& rRequestedArea, const ::std::vector< ::canvas::Sprite::Reference >& rSortedUpdateSprites ) { - ENSURE_AND_THROW( mpDevice && - mpDevice->getOutDev() && - mpDevice->getBackBuffer(), - "SpriteCanvasHelper::genericUpdate(): NULL device pointer " ); + ENSURE_OR_THROW( mpOwningSpriteCanvas && + mpOwningSpriteCanvas->getBackBuffer() && + mpOwningSpriteCanvas->getFrontBuffer(), + "SpriteCanvasHelper::genericUpdate(): NULL device pointer " ); - OutputDevice& rOutDev( *mpDevice->getOutDev() ); - BackBufferSharedPtr pBackBuffer( mpDevice->getBackBuffer() ); + OutputDevice& rOutDev( mpOwningSpriteCanvas->getFrontBuffer()->getOutDev() ); + BackBufferSharedPtr pBackBuffer( mpOwningSpriteCanvas->getBackBuffer() ); OutputDevice& rBackOutDev( pBackBuffer->getOutDev() ); // limit size of update VDev to target outdev's size @@ -665,7 +677,7 @@ namespace vclcanvas void SpriteCanvasHelper::renderMemUsage( OutputDevice& rOutDev ) { - BackBufferSharedPtr pBackBuffer( mpDevice->getBackBuffer() ); + BackBufferSharedPtr pBackBuffer( mpOwningSpriteCanvas->getBackBuffer() ); if( mpRedrawManager && pBackBuffer ) |