[Libreoffice-commits] core.git: Branch 'feature/opengl-vcl' - Repository.mk vcl/Module_vcl.mk vcl/workben

Michael Meeks michael.meeks at collabora.com
Thu Nov 6 13:53:17 PST 2014


 Repository.mk               |    3 +
 vcl/Module_vcl.mk           |    3 +
 vcl/workben/outdevgrind.cxx |   85 +++++++++++++++++++++++---------------------
 3 files changed, 50 insertions(+), 41 deletions(-)

New commits:
commit b5a0f77133fb7c7d7d885f8b45799185371603dc
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Thu Nov 6 21:46:02 2014 +0000

    vcl: outdevgrind compile it by default, and fix it up.
    
    Change-Id: I4bdad4a0eb65991cd9faa9452485c64120b8b6dc

diff --git a/Repository.mk b/Repository.mk
index c31342a..d725f36 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -100,7 +100,8 @@ $(eval $(call gb_Helper_register_executables,OOO, \
 	uri-encode \
 	ui-previewer \
 	$(if $(filter LINUX MACOSX WNT,$(OS)), \
-		icontest) \
+		icontest \
+	    outdevgrind) \
 	vcldemo \
 	tiledrendering \
 	$(if $(and $(ENABLE_GTK), $(filter LINUX,$(OS))), gtktiledviewer) \
diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk
index f61cc7b..385ac9b 100644
--- a/vcl/Module_vcl.mk
+++ b/vcl/Module_vcl.mk
@@ -27,7 +27,8 @@ $(eval $(call gb_Module_add_targets,vcl,\
         StaticLibrary_vclmain \
         Executable_ui-previewer \
 		$(if $(filter LINUX MACOSX WNT,$(OS)), \
-	        Executable_icontest)) \
+	        Executable_icontest \
+	        Executable_outdevgrind)) \
     $(if $(filter-out ANDROID IOS WNT,$(OS)), \
         Executable_svdemo \
         Executable_svptest \
diff --git a/vcl/workben/outdevgrind.cxx b/vcl/workben/outdevgrind.cxx
index 9b99ee3..2e95437 100644
--- a/vcl/workben/outdevgrind.cxx
+++ b/vcl/workben/outdevgrind.cxx
@@ -17,17 +17,16 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-// bootstrap stuff
-#include <rtl/bootstrap.hxx>
-#include <rtl/ustring.hxx>
-#include <comphelper/processfactory.hxx>
-#include <cppuhelper/servicefactory.hxx>
+#include <sal/main.h>
+#include <tools/extendapplicationenvironment.hxx>
+
 #include <cppuhelper/bootstrap.hxx>
+#include <comphelper/processfactory.hxx>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/registry/XSimpleRegistry.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
 
 #include <vcl/svapp.hxx>
+#include <vcl/window.hxx>
 #include <vcl/dialog.hxx>
 #include <vcl/outdev.hxx>
 #include <vcl/virdev.hxx>
@@ -137,12 +136,14 @@ void setupMethodStubs( functor_vector_type& res )
     aMtf.AddAction( new MetaFillColorAction(Color(COL_RED),true) );
     aMtf.AddAction( new MetaRectAction(aRect) );
 
+#ifdef FIXME_NEEDS_LOVE
     add(res,
         "DrawTextArray",
         boost::bind(
             &OutputDevice::DrawTextArray,
             _1,
             aPt1, aString, (const sal_Int32*)0, (sal_uInt16)0, aString.getLength() ));
+#endif
 
     /* void DrawPixel( const Point& rPt, const Color& rColor ); */
     add(res,
@@ -326,6 +327,7 @@ void setupMethodStubs( functor_vector_type& res )
             _1,
             aPt1,aPt3,aRect2.GetSize(),(sal_uInt16)0 ));
 
+#ifdef NEEDS_QUALIY_PARAMTER
     /* void DrawBitmap( const Point& rDestPt,
                                     const Bitmap& rBitmap );
     */
@@ -376,6 +378,7 @@ void setupMethodStubs( functor_vector_type& res )
             _1,
             aPt1,aRect.GetSize(),aBitmap ));
 
+#if 0
     /* void DrawBitmap( const Point& rDestPt, const Size& rDestSize,
                                     const Point& rSrcPtPixel, const Size& rSrcSizePixel,
                                     const Bitmap& rBitmap );
@@ -391,6 +394,7 @@ void setupMethodStubs( functor_vector_type& res )
                 &OutputDevice::DrawBitmap),
             _1,
             aPt1,aRect.GetSize(),aPt3,aRect2.GetSize(),aBitmapAlien ));
+#endif
 
     /* void DrawBitmap( const Point& rDestPt, const Size& rDestSize,
                                     const Point& rSrcPtPixel, const Size& rSrcSizePixel,
@@ -687,6 +691,8 @@ void setupMethodStubs( functor_vector_type& res )
             _1,
             aPt1,aRect.GetSize(),aImage,(sal_uInt16)0 ));
 
+#endif // NEEDS_QUALITY_PARAMATER
+
     /* void DrawGradient( const Rectangle& rRect, const Gradient& rGradient ); */
     add(res,
         "DrawGradient",
@@ -721,6 +727,7 @@ void setupMethodStubs( functor_vector_type& res )
             _1,
             aRect2,aWallpaper ));
 
+#ifdef FIXME_HAVE_WAVE_NORMAL
     /* void DrawWaveLine( const Point& rStartPos, const Point& rEndPos, sal_uInt16 nStyle ); */
     add(res,
         "DrawWaveLine",
@@ -728,6 +735,7 @@ void setupMethodStubs( functor_vector_type& res )
             &OutputDevice::DrawWaveLine,
             _1,
             aPt1,aPt2,(sal_uInt16)WAVE_NORMAL ));
+#endif
 
     /* void DrawGrid( const Rectangle& rRect, const Size& rDist, sal_uLong nFlags ); */
     add(res,
@@ -783,7 +791,7 @@ void grindFunc( OutputDevice&                       rTarget,
         iter->second(&rTarget);
 
     if( rTarget.GetOutDevType() == OUTDEV_WINDOW )
-        static_cast<Window&>(rTarget).Sync();
+        static_cast< vcl::Window & >( rTarget ).Sync();
 
     fprintf( stdout,
              "Duration: %d ms (%d repetitions)\tOperation: %s\tSetup: %s\n",
@@ -824,13 +832,13 @@ void outDevGrind( OutputDevice& rTarget, sal_Int32 nTurns=100 )
         rTarget.SetLineColor( Color(COL_BLACK) );
         rTarget.SetFillColor( Color(COL_GREEN) );
         rTarget.SetRasterOp( ROP_OVERPAINT );
-        rTarget.SetClipRegion( aClipRect );
+        rTarget.SetClipRegion( vcl::Region( aClipRect ) );
         grindFunc( rTarget, iter, nTurns, "with rect clip, w/o xor" );
 
         rTarget.SetLineColor( Color(COL_BLACK) );
         rTarget.SetFillColor( Color(COL_GREEN) );
         rTarget.SetRasterOp( ROP_OVERPAINT );
-        rTarget.SetClipRegion( aClipPoly );
+        rTarget.SetClipRegion( vcl::Region( aClipPoly ) );
         grindFunc( rTarget, iter, nTurns, "with complex clip, w/o xor" );
 
         rTarget.SetLineColor( Color(COL_BLACK) );
@@ -842,13 +850,13 @@ void outDevGrind( OutputDevice& rTarget, sal_Int32 nTurns=100 )
         rTarget.SetLineColor( Color(COL_BLACK) );
         rTarget.SetFillColor( Color(COL_GREEN) );
         rTarget.SetRasterOp( ROP_XOR );
-        rTarget.SetClipRegion( aClipRect );
+        rTarget.SetClipRegion( vcl::Region( aClipRect ) );
         grindFunc( rTarget, iter, nTurns, "with rect clip, with xor" );
 
         rTarget.SetLineColor( Color(COL_BLACK) );
         rTarget.SetFillColor( Color(COL_GREEN) );
         rTarget.SetRasterOp( ROP_XOR );
-        rTarget.SetClipRegion( aClipPoly );
+        rTarget.SetClipRegion( vcl::Region( aClipPoly ) );
         grindFunc( rTarget, iter, nTurns, "with complex clip, with xor" );
 
         ++iter;
@@ -874,11 +882,21 @@ sal_uInt16 GrindApp::Exception( sal_uInt16 nError )
 
 int GrindApp::Main()
 {
+    TestWindow aWindow;
+    aWindow.Execute();
+    return 0;
+}
+
+} // namespace
+
+
+SAL_IMPLEMENT_MAIN()
+{
     bool bHelp = false;
 
-    for( sal_uInt16 i = 0; i < GetCommandLineParamCount(); i++ )
+    for( sal_uInt16 i = 0; i < Application::GetCommandLineParamCount(); i++ )
     {
-        OUString aParam = GetCommandLineParam( i );
+        OUString aParam = Application::GetCommandLineParam( i );
 
         if( aParam == "--help" || aParam == "-h" )
                 bHelp = true;
@@ -890,35 +908,24 @@ int GrindApp::Main()
         return EXIT_SUCCESS;
     }
 
-    // create the global service-manager
-    uno::Reference< lang::XMultiServiceFactory > xFactory;
-    try
-    {
-        uno::Reference< uno::XComponentContext > xCtx = ::cppu::defaultBootstrap_InitialComponentContext();
-        xFactory = uno::Reference< lang::XMultiServiceFactory >(  xCtx->getServiceManager(),
-                                                                  uno::UNO_QUERY );
-        if( xFactory.is() )
-            ::comphelper::setProcessServiceFactory( xFactory );
-    }
-    catch( uno::Exception& )
-    {
-    }
+    tools::extendApplicationEnvironment();
 
-    if( !xFactory.is() )
-    {
-        fprintf( stderr,
-                 "Could not bootstrap UNO, installation must be in disorder. Exiting.\n" );
-        exit( 1 );
-    }
+    uno::Reference< uno::XComponentContext > xContext = cppu::defaultBootstrap_InitialComponentContext();
+    uno::Reference< lang::XMultiServiceFactory > xServiceManager( xContext->getServiceManager(), uno::UNO_QUERY );
 
-    TestWindow pWindow;
-    pWindow.Execute();
+    if( !xServiceManager.is() )
+        Application::Abort( "Failed to bootstrap" );
 
-    return EXIT_SUCCESS;
-}
+    comphelper::setProcessServiceFactory( xServiceManager );
 
-} // namespace
+    InitVCL();
+
+    GrindApp aGrindApp;
+    aGrindApp.Main();
 
-GrindApp aGrindApp;
+    DeInitVCL();
+
+    return EXIT_SUCCESS;
+}
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list