[Libreoffice-commits] core.git: vcl/workben

Tor Lillqvist tml at collabora.com
Mon Oct 13 03:03:57 PDT 2014


 vcl/workben/icontest.cxx |   16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

New commits:
commit e52c070088f23d5ed815bb7132412fe07f47bf7b
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Oct 13 13:00:14 2014 +0300

    Quit after 100 rounds
    
    Also, print the timing output to stdout, so that one can run the time
    command on this, redirecting the program output to /dev/null, and just
    see the 'time' output.
    
    Change-Id: I4b2bfe7f0d37746fe0a015b961512850a880560c

diff --git a/vcl/workben/icontest.cxx b/vcl/workben/icontest.cxx
index ec6c574..4373cd4 100644
--- a/vcl/workben/icontest.cxx
+++ b/vcl/workben/icontest.cxx
@@ -116,7 +116,8 @@ void MyWorkWindow::LoadGraphic( const OUString& sImageFile )
 
 void MyWorkWindow::Paint( const Rectangle& rRect )
 {
-    std::cerr << "==> Paint! " << mnPaintCount++ << " (vcl) " << GetSizePixel() << " " << getTimeNow() - mnStartTime << std::endl;
+    std::cout << "==> Paint! " << mnPaintCount++ << " (vcl) " << GetSizePixel() << " " << getTimeNow() - mnStartTime << std::endl;
+
     Size aGraphicSize( maGraphic.GetSizePixel() );
     float aspect = ((float) aGraphicSize.Width()) / aGraphicSize.Height();
     Size aSize;
@@ -126,13 +127,19 @@ void MyWorkWindow::Paint( const Rectangle& rRect )
         aSize = Size( WIDTH * aspect, HEIGHT );
     aSize.setWidth( aSize.Width() * (1 + (0.1*sin(mnPaintCount/60.))) );
     aSize.setHeight( aSize.Height() * (1 + (0.1*sin(mnPaintCount/50.))) );
-    GraphicConversionParameters aConv( aSize );
+
     Bitmap aEmpty;
     mpFixedBitmap->SetBitmap( aEmpty );
+    GraphicConversionParameters aConv( aSize );
     mpBitmap = new Bitmap( maGraphic.GetBitmap( aConv ) );
     mpFixedBitmap->SetBitmap( *mpBitmap );
     mpFixedBitmap->SetSizePixel( aSize );
+
     WorkWindow::Paint( rRect );
+
+    if (mnPaintCount == 100)
+        Application::Quit();
+
     Invalidate( INVALIDATE_CHILDREN );
 }
 
@@ -234,7 +241,7 @@ void MyOpenGLWorkWindow::LoadTexture()
 
 void MyOpenGLWorkWindow::Paint( const Rectangle& )
 {
-    std::cerr << "==> Paint! "<< mnPaintCount++ << " (OpenGL) " << GetSizePixel() << " " << getTimeNow() - mnStartTime << std::endl;
+    std::cout << "==> Paint! "<< mnPaintCount++ << " (OpenGL) " << GetSizePixel() << " " << getTimeNow() - mnStartTime << std::endl;
     OpenGLContext& aCtx = mpOpenGLWindow->getContext();
     aCtx.requestLegacyContext();
     CHECK_GL_ERROR();
@@ -287,6 +294,9 @@ void MyOpenGLWorkWindow::Paint( const Rectangle& )
     aCtx.swapBuffers();
     CHECK_GL_ERROR();
 
+    if (mnPaintCount == 100)
+        Application::Quit();
+
     Invalidate( INVALIDATE_CHILDREN );
 }
 


More information about the Libreoffice-commits mailing list