From 0241896fad3fea09f31e4637bc3dcf2baf12a67a Mon Sep 17 00:00:00 2001 From: Pranav Kant Date: Mon, 9 May 2016 23:09:27 +0530 Subject: [PATCH] lokdocview: Add debug info; paintTile rendering time Change-Id: Icdb14e9a5fedb3dcfbad502e323b333c3dbcc534 --- libreofficekit/source/gtk/lokdocview.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx index c14c8b16c784..38b1a6dc78b4 100644 --- a/libreofficekit/source/gtk/lokdocview.cxx +++ b/libreofficekit/source/gtk/lokdocview.cxx @@ -1914,18 +1914,26 @@ paintTileInThread (gpointer data) priv->m_pDocument->pClass->setView(priv->m_pDocument, priv->m_nViewId); std::stringstream ss; + GTimer* aTimer = g_timer_new(); + gulong nElapsedMs; ss << "lok::Document::paintTile(" << static_cast(pBuffer) << ", " << nTileSizePixels << ", " << nTileSizePixels << ", " << aTileRectangle.x << ", " << aTileRectangle.y << ", " << pixelToTwip(nTileSizePixels, pLOEvent->m_fPaintTileZoom) << ", " << pixelToTwip(nTileSizePixels, pLOEvent->m_fPaintTileZoom) << ")"; - g_info("%s", ss.str().c_str()); + priv->m_pDocument->pClass->paintTile(priv->m_pDocument, pBuffer, nTileSizePixels, nTileSizePixels, aTileRectangle.x, aTileRectangle.y, pixelToTwip(nTileSizePixels, pLOEvent->m_fPaintTileZoom), pixelToTwip(nTileSizePixels, pLOEvent->m_fPaintTileZoom)); + + g_timer_elapsed(aTimer, &nElapsedMs); + ss << " rendered in " << (nElapsedMs / 1000.) << " milliseconds"; + g_info("%s", ss.str().c_str()); + g_timer_destroy(aTimer); + cairo_surface_mark_dirty(pSurface); // Its likely that while the tilebuffer has changed, one of the paint tile