diff options
author | Rüdiger Timm <rt@openoffice.org> | 2008-12-09 13:22:21 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2008-12-09 13:22:21 +0000 |
commit | 08dd93a4b70962aed0d2b1923b1a73d1d33e0bf3 (patch) | |
tree | 71741e6246bc9e4115770a4872a2f01906461feb /canvas/source/vcl | |
parent | 3a91fde276caa644d90f02da0e102dd4915fc460 (diff) |
CWS-TOOLING: integrate CWS canvas06
2008-11-14 18:59:03 +0100 thb r263697 : Reverted fAlpha setup to previous state, as this was bogus as well - code path is apparently not taken for test, but anyway
2008-11-13 21:32:45 +0100 thb r263663 : WaE fix (and a bad bug as well - int color would have overflown)
2008-11-13 16:51:37 +0100 pl r263654 : remove warnings
2008-11-13 09:46:28 +0100 thb r263623 : #i95317# Fixed typo (thx WaE for finding)
2008-11-12 21:25:19 +0100 thb r263617 : #i96047# call update() on hidden sprite shape as well, to force actual hiding
2008-11-12 21:23:31 +0100 thb r263616 : #i95209# Merge from CWS thb11 - revives canvasbitmap unit tests, fixes nasty corner case in x11 salbmp (for 16bpp)
2008-11-12 21:21:46 +0100 thb r263615 : #i95197# Shuffled code to make valgrind quiet during bmp loading
2008-11-12 21:18:06 +0100 thb r263614 : #i93382# Make --disable-moz build work
2008-11-12 21:16:55 +0100 thb r263613 : #i95317# Fixed mis-named traits methods for min and max numbers
2008-11-12 20:59:01 +0100 thb r263612 : #i95317#, #i92902#: migrate CWS canvas06 to SVN.
Diffstat (limited to 'canvas/source/vcl')
-rw-r--r-- | canvas/source/vcl/canvashelper.cxx | 49 |
1 files changed, 29 insertions, 20 deletions
diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx index 8f634d99bf7f..20b489144d0e 100644 --- a/canvas/source/vcl/canvashelper.cxx +++ b/canvas/source/vcl/canvashelper.cxx @@ -147,6 +147,7 @@ namespace vclcanvas void CanvasHelper::setBackgroundOutDev( const OutDevProviderSharedPtr& rOutDev ) { mp2ndOutDev = rOutDev; + mp2ndOutDev->getOutDev().EnableMapMode( FALSE ); } void CanvasHelper::clear() @@ -155,6 +156,7 @@ namespace vclcanvas if( mpOutDev ) { OutputDevice& rOutDev( mpOutDev->getOutDev() ); + tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev ); rOutDev.EnableMapMode( FALSE ); rOutDev.SetLineColor( COL_WHITE ); @@ -188,7 +190,6 @@ namespace vclcanvas { // nope, render tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev ); - setupOutDevState( viewState, renderState, LINE_COLOR ); const Point aOutPoint( tools::mapRealPoint2D( aPoint, @@ -212,7 +213,6 @@ namespace vclcanvas { // nope, render tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev ); - setupOutDevState( viewState, renderState, LINE_COLOR ); const Point aStartPoint( tools::mapRealPoint2D( aStartRealPoint2D, @@ -236,7 +236,6 @@ namespace vclcanvas if( mpOutDev ) { tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev ); - setupOutDevState( viewState, renderState, LINE_COLOR ); const Point& rStartPoint( tools::mapRealPoint2D( geometry::RealPoint2D(aBezierSegment.Px, @@ -279,7 +278,6 @@ namespace vclcanvas if( mpOutDev ) { tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev ); - setupOutDevState( viewState, renderState, LINE_COLOR ); const ::basegfx::B2DPolyPolygon& rPolyPoly( @@ -688,7 +686,6 @@ namespace vclcanvas if( mpOutDev ) { tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev ); - setupOutDevState( viewState, renderState, IGNORE_COLOR ); ::basegfx::B2DHomMatrix aMatrix; @@ -916,11 +913,16 @@ namespace vclcanvas if( !mpOutDev.get() || !mpDevice ) return uno::Reference< rendering::XBitmap >(); // we're disposed + OutputDevice& rOutDev( mpOutDev->getOutDev() ); + + tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev ); + rOutDev.EnableMapMode( FALSE ); + // TODO(F2): Support alpha vdev canvas here const Point aEmptyPoint(0,0); - const Size aBmpSize( mpOutDev->getOutDev().GetOutputSizePixel() ); + const Size aBmpSize( rOutDev.GetOutputSizePixel() ); - Bitmap aBitmap( mpOutDev->getOutDev().GetBitmap(aEmptyPoint, aBmpSize) ); + Bitmap aBitmap( rOutDev.GetBitmap(aEmptyPoint, aBmpSize) ); aBitmap.Scale( ::vcl::unotools::sizeFromRealSize2D(newSize), beFast ? BMP_SCALE_FAST : BMP_SCALE_INTERPOLATE ); @@ -940,8 +942,13 @@ namespace vclcanvas // TODO(F2): Support alpha canvas here const Rectangle aRect( ::vcl::unotools::rectangleFromIntegerRectangle2D(rect) ); - Bitmap aBitmap( mpOutDev->getOutDev().GetBitmap(aRect.TopLeft(), - aRect.GetSize()) ); + OutputDevice& rOutDev( mpOutDev->getOutDev() ); + + tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev ); + rOutDev.EnableMapMode( FALSE ); + + Bitmap aBitmap( rOutDev.GetBitmap(aRect.TopLeft(), + aRect.GetSize()) ); ScopedBitmapReadAccess pReadAccess( aBitmap.AcquireReadAccess(), aBitmap ); @@ -990,6 +997,9 @@ namespace vclcanvas OutputDevice& rOutDev( mpOutDev->getOutDev() ); + tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev ); + rOutDev.EnableMapMode( FALSE ); + const Rectangle aRect( ::vcl::unotools::rectangleFromIntegerRectangle2D(rect) ); const USHORT nBitCount( ::std::min( (USHORT)24U, (USHORT)rOutDev.GetBitCount() ) ); @@ -1099,10 +1109,7 @@ namespace vclcanvas // destroyed beforehand if( bCopyBack ) { - tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev ); - // TODO(F2): Support alpha canvas here - rOutDev.EnableMapMode( FALSE ); rOutDev.DrawBitmap(aRect.TopLeft(), aBitmap); } } @@ -1115,6 +1122,10 @@ namespace vclcanvas return; // we're disposed OutputDevice& rOutDev( mpOutDev->getOutDev() ); + + tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev ); + rOutDev.EnableMapMode( FALSE ); + const Size aBmpSize( rOutDev.GetOutputSizePixel() ); ENSURE_ARG_OR_THROW( pos.X >= 0 && pos.X < aBmpSize.Width(), @@ -1131,10 +1142,6 @@ namespace vclcanvas aRefLayout.IsMsbFirst != rLayout.IsMsbFirst, "Mismatching memory layout" ); - tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev ); - - rOutDev.EnableMapMode( FALSE ); - // TODO(F2): Support alpha canvas here rOutDev.DrawPixel( ::vcl::unotools::pointFromIntegerPoint2D( pos ), ::canvas::tools::stdIntSequenceToColor( color )); @@ -1153,6 +1160,9 @@ namespace vclcanvas OutputDevice& rOutDev( mpOutDev->getOutDev() ); + tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev ); + rOutDev.EnableMapMode( FALSE ); + const Size aBmpSize( rOutDev.GetOutputSizePixel() ); ENSURE_ARG_OR_THROW( pos.X >= 0 && pos.X < aBmpSize.Width(), @@ -1160,10 +1170,6 @@ namespace vclcanvas ENSURE_ARG_OR_THROW( pos.Y >= 0 && pos.Y < aBmpSize.Height(), "Y coordinate out of bounds" ); - tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev ); - - rOutDev.EnableMapMode( FALSE ); - // TODO(F2): Support alpha canvas here return ::canvas::tools::colorToStdIntSequence( rOutDev.GetPixel( @@ -1194,6 +1200,8 @@ namespace vclcanvas OutputDevice& rOutDev( mpOutDev->getOutDev() ); OutputDevice* p2ndOutDev = NULL; + rOutDev.EnableMapMode( FALSE ); + if( mp2ndOutDev ) p2ndOutDev = &mp2ndOutDev->getOutDev(); @@ -1389,6 +1397,7 @@ namespace vclcanvas return false; // disposed else { + tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev ); setupOutDevState( viewState, renderState, IGNORE_COLOR ); if( !rGrf->Draw( &mpOutDev->getOutDev(), rPt, rSz, &rAttr ) ) |