You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by al...@apache.org on 2013/01/22 15:12:06 UTC

svn commit: r1436937 - in /openoffice/branches/alg/clibboard/main/canvas/source/vcl: bitmapbackbuffer.cxx canvashelper.cxx impltools.hxx spritecanvashelper.cxx spritedevicehelper.cxx

Author: alg
Date: Tue Jan 22 14:12:06 2013
New Revision: 1436937

URL: http://svn.apache.org/viewvc?rev=1436937&view=rev
Log:
#121355# Added AAing to vcl canvas

Modified:
    openoffice/branches/alg/clibboard/main/canvas/source/vcl/bitmapbackbuffer.cxx
    openoffice/branches/alg/clibboard/main/canvas/source/vcl/canvashelper.cxx
    openoffice/branches/alg/clibboard/main/canvas/source/vcl/impltools.hxx
    openoffice/branches/alg/clibboard/main/canvas/source/vcl/spritecanvashelper.cxx
    openoffice/branches/alg/clibboard/main/canvas/source/vcl/spritedevicehelper.cxx

Modified: openoffice/branches/alg/clibboard/main/canvas/source/vcl/bitmapbackbuffer.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/clibboard/main/canvas/source/vcl/bitmapbackbuffer.cxx?rev=1436937&r1=1436936&r2=1436937&view=diff
==============================================================================
--- openoffice/branches/alg/clibboard/main/canvas/source/vcl/bitmapbackbuffer.cxx (original)
+++ openoffice/branches/alg/clibboard/main/canvas/source/vcl/bitmapbackbuffer.cxx Tue Jan 22 14:12:06 2013
@@ -85,6 +85,7 @@ namespace vclcanvas
         {
             // VDev content is more current than bitmap - copy contents before!
             mpVDev->EnableMapMode( sal_False );
+            mpVDev->SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
             const Point aEmptyPoint;
             *maBitmap = mpVDev->GetBitmapEx( aEmptyPoint,
                                              mpVDev->GetOutputSizePixel() );
@@ -105,6 +106,7 @@ namespace vclcanvas
         if( mbVDevContentIsCurrent && mpVDev )
         {
             mpVDev->EnableMapMode( sal_False );
+            mpVDev->SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
             aSize = mpVDev->GetOutputSizePixel();
         }
 
@@ -148,6 +150,7 @@ namespace vclcanvas
         {
             // fill with bitmap content
             mpVDev->EnableMapMode( sal_False );
+            mpVDev->SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
             const Point aEmptyPoint;
             mpVDev->DrawBitmapEx( aEmptyPoint, *maBitmap );
         }

Modified: openoffice/branches/alg/clibboard/main/canvas/source/vcl/canvashelper.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/clibboard/main/canvas/source/vcl/canvashelper.cxx?rev=1436937&r1=1436936&r2=1436937&view=diff
==============================================================================
--- openoffice/branches/alg/clibboard/main/canvas/source/vcl/canvashelper.cxx (original)
+++ openoffice/branches/alg/clibboard/main/canvas/source/vcl/canvashelper.cxx Tue Jan 22 14:12:06 2013
@@ -162,6 +162,7 @@ namespace vclcanvas
     {
         mp2ndOutDev = rOutDev;
         mp2ndOutDev->getOutDev().EnableMapMode( sal_False );
+        mp2ndOutDev->getOutDev().SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
     }
 
     void CanvasHelper::clear()
@@ -173,6 +174,7 @@ namespace vclcanvas
             tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
 
             rOutDev.EnableMapMode( sal_False );
+            rOutDev.SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
             rOutDev.SetLineColor( COL_WHITE );
             rOutDev.SetFillColor( COL_WHITE );
             rOutDev.DrawRect( Rectangle( Point(),
@@ -184,6 +186,7 @@ namespace vclcanvas
                 
                 rOutDev2.SetDrawMode( DRAWMODE_DEFAULT );
                 rOutDev2.EnableMapMode( sal_False );
+                rOutDev2.SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
                 rOutDev2.SetLineColor( COL_WHITE );
                 rOutDev2.SetFillColor( COL_WHITE );
                 rOutDev2.DrawRect( Rectangle( Point(),
@@ -934,6 +937,7 @@ namespace vclcanvas
 
         tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
         rOutDev.EnableMapMode( sal_False );
+        rOutDev.SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
 
         // TODO(F2): Support alpha vdev canvas here
         const Point aEmptyPoint(0,0);
@@ -963,6 +967,7 @@ namespace vclcanvas
 
         tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
         rOutDev.EnableMapMode( sal_False );
+        rOutDev.SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
 
         Bitmap aBitmap( rOutDev.GetBitmap(aRect.TopLeft(), 
                                           aRect.GetSize()) );
@@ -1016,6 +1021,7 @@ namespace vclcanvas
 
         tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
         rOutDev.EnableMapMode( sal_False );
+        rOutDev.SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
 
         const Rectangle aRect( ::vcl::unotools::rectangleFromIntegerRectangle2D(rect) );
         const sal_uInt16 	nBitCount( ::std::min( (sal_uInt16)24U, 
@@ -1142,6 +1148,7 @@ namespace vclcanvas
 
         tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
         rOutDev.EnableMapMode( sal_False );
+        rOutDev.SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
 
         const Size aBmpSize( rOutDev.GetOutputSizePixel() );
 
@@ -1179,6 +1186,7 @@ namespace vclcanvas
 
         tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
         rOutDev.EnableMapMode( sal_False );
+        rOutDev.SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
 
         const Size aBmpSize( rOutDev.GetOutputSizePixel() );
 
@@ -1218,6 +1226,7 @@ namespace vclcanvas
         OutputDevice* p2ndOutDev = NULL;
 
         rOutDev.EnableMapMode( sal_False );
+        rOutDev.SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
 
         if( mp2ndOutDev )
             p2ndOutDev = &mp2ndOutDev->getOutDev();

Modified: openoffice/branches/alg/clibboard/main/canvas/source/vcl/impltools.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/clibboard/main/canvas/source/vcl/impltools.hxx?rev=1436937&r1=1436936&r2=1436937&view=diff
==============================================================================
--- openoffice/branches/alg/clibboard/main/canvas/source/vcl/impltools.hxx (original)
+++ openoffice/branches/alg/clibboard/main/canvas/source/vcl/impltools.hxx Tue Jan 22 14:12:06 2013
@@ -137,14 +137,16 @@ namespace vclcanvas
         public:
             explicit OutDevStateKeeper( OutputDevice& rOutDev ) :
                 mpOutDev( &rOutDev ),
-                mbMappingWasEnabled( mpOutDev->IsMapModeEnabled() )
+                mbMappingWasEnabled( mpOutDev->IsMapModeEnabled() ),
+                mnAntiAliasing( mpOutDev->GetAntialiasing() )
             {
                 init();
         	}
 
             explicit OutDevStateKeeper( const OutDevProviderSharedPtr& rOutDev ) :
                 mpOutDev( rOutDev.get() ? &(rOutDev->getOutDev()) : NULL ),
-                mbMappingWasEnabled( mpOutDev ? mpOutDev->IsMapModeEnabled() : false )
+                mbMappingWasEnabled( mpOutDev ? mpOutDev->IsMapModeEnabled() : false ),
+                mnAntiAliasing( mpOutDev ? mpOutDev->GetAntialiasing() : 0 )
             {
                 init();
         	}
@@ -154,6 +156,8 @@ namespace vclcanvas
                 if( mpOutDev )
                 {
                     mpOutDev->EnableMapMode( mbMappingWasEnabled );
+                    mpOutDev->SetAntialiasing( mnAntiAliasing );
+                    
                     mpOutDev->Pop();
                 }
         	}
@@ -165,11 +169,13 @@ namespace vclcanvas
                 {
                     mpOutDev->Push();
                     mpOutDev->EnableMapMode(sal_False);
+                    mpOutDev->SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
                 }
             }
 
-            OutputDevice*	mpOutDev;
-            const bool		mbMappingWasEnabled;
+            OutputDevice*	    mpOutDev;
+            const bool		    mbMappingWasEnabled;
+            const sal_uInt16    mnAntiAliasing;
         };
 
         ::Point mapRealPoint2D( const ::com::sun::star::geometry::RealPoint2D& 	rPoint,

Modified: openoffice/branches/alg/clibboard/main/canvas/source/vcl/spritecanvashelper.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/clibboard/main/canvas/source/vcl/spritecanvashelper.cxx?rev=1436937&r1=1436936&r2=1436937&view=diff
==============================================================================
--- openoffice/branches/alg/clibboard/main/canvas/source/vcl/spritecanvashelper.cxx (original)
+++ openoffice/branches/alg/clibboard/main/canvas/source/vcl/spritecanvashelper.cxx Tue Jan 22 14:12:06 2013
@@ -95,6 +95,7 @@ namespace vclcanvas
             // wouldn't save much render time, and b) will clutter
             // scrolled sprite content outside this area)
             rOutDev.EnableMapMode( sal_False );
+            rOutDev.SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
             rOutDev.SetClipRegion( rRequestedArea );
 
             // repaint affected sprite directly to output device (at
@@ -329,6 +330,7 @@ namespace vclcanvas
 
             // flush to screen
             rOutDev.EnableMapMode( sal_False );
+            rOutDev.SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
             rOutDev.SetClipRegion();
             rOutDev.DrawOutDev( aEmptyPoint, aOutDevSize, 
                                 aEmptyPoint, aOutDevSize, 
@@ -574,6 +576,7 @@ namespace vclcanvas
 
         // paint background
         maVDev->EnableMapMode( sal_False );
+        maVDev->SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
         maVDev->SetClipRegion();
         maVDev->DrawOutDev( aEmptyPoint, aOutputSize, 
                             aOutputPosition, aOutputSize, 
@@ -591,6 +594,7 @@ namespace vclcanvas
 
         // flush to screen
         rOutDev.EnableMapMode( sal_False );
+        rOutDev.SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
         rOutDev.DrawOutDev( aOutputPosition, aOutputSize, 
                             aEmptyPoint, aOutputSize, 
                             *maVDev );        

Modified: openoffice/branches/alg/clibboard/main/canvas/source/vcl/spritedevicehelper.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/clibboard/main/canvas/source/vcl/spritedevicehelper.cxx?rev=1436937&r1=1436936&r2=1436937&view=diff
==============================================================================
--- openoffice/branches/alg/clibboard/main/canvas/source/vcl/spritedevicehelper.cxx (original)
+++ openoffice/branches/alg/clibboard/main/canvas/source/vcl/spritedevicehelper.cxx Tue Jan 22 14:12:06 2013
@@ -141,6 +141,7 @@ namespace vclcanvas
                 
             const ::Point aEmptyPoint;
             mpBackBuffer->getOutDev().EnableMapMode( sal_False );
+            mpBackBuffer->getOutDev().SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
             WriteDIB(mpBackBuffer->getOutDev().GetBitmap(aEmptyPoint, mpBackBuffer->getOutDev().GetOutputSizePixel()), aStream, false, true);
         }