summaryrefslogtreecommitdiff
path: root/libreofficekit
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.com>2016-05-09 23:09:27 +0530
committerPranav Kant <pranavk@collabora.com>2016-05-11 21:33:06 +0530
commit0241896fad3fea09f31e4637bc3dcf2baf12a67a (patch)
treeb4e5f4d6267a1c4a1de3055af43fda91f61e4ae3 /libreofficekit
parent0761614ccf5beb9051fb132c5f1990198f32967f (diff)
lokdocview: Add debug info; paintTile rendering time
Change-Id: Icdb14e9a5fedb3dcfbad502e323b333c3dbcc534
Diffstat (limited to 'libreofficekit')
-rw-r--r--libreofficekit/source/gtk/lokdocview.cxx10
1 files changed, 9 insertions, 1 deletions
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<void*>(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