summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2014-10-13 13:00:14 +0300
committerTor Lillqvist <tml@collabora.com>2014-10-13 13:01:33 +0300
commite52c070088f23d5ed815bb7132412fe07f47bf7b (patch)
tree2629ae846f14fcc7df72e45060514b70b8911083
parent5233d9b8e57aebbfda22a2edcf67e87282ebc66d (diff)
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
-rw-r--r--vcl/workben/icontest.cxx16
1 files changed, 13 insertions, 3 deletions
diff --git a/vcl/workben/icontest.cxx b/vcl/workben/icontest.cxx
index ec6c57419650..4373cd48a170 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 );
}