summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2016-10-07 23:25:23 -0400
committerAshod Nakashian <ashnakash@gmail.com>2016-10-08 04:21:03 +0000
commit30a80a4177fd507e18c5acca44f021e286899940 (patch)
treea223118f773c4babda462c2f86b8760802b27ca6 /desktop
parent26cded05a45d28d4ed70d6e747c42312b2d55207 (diff)
LOK: logging in Idle callback queue
Change-Id: I58fd05441fa39658363c9bd205c96842c5dce15c Reviewed-on: https://gerrit.libreoffice.org/29602 Reviewed-by: Ashod Nakashian <ashnakash@gmail.com> Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx17
1 files changed, 11 insertions, 6 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 6d571f78ec3a..70476348516c 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -579,6 +579,7 @@ void CallbackFlushHandler::callback(const int type, const char* payload, void* d
void CallbackFlushHandler::queue(const int type, const char* data)
{
std::string payload(data ? data : "(nil)");
+ //SAL_WARN("lok", "Queue: " << type << " : " << payload);
if (m_bPartTilePainting)
{
// We drop notifications when this is set, except for important ones.
@@ -740,9 +741,9 @@ void CallbackFlushHandler::queue(const int type, const char* data)
const RectangleAndPart rcOld = RectangleAndPart::Create(elem.second);
if (rcOld.m_nPart != rcNew.m_nPart)
return false;
- //SAL_WARN("lok", "#" << i << " Old: " << rcOld.toString());
+ //SAL_WARN("lok", "Old: " << rcOld.toString());
const Rectangle rcOverlap = rcNew.m_aRectangle.GetIntersection(rcOld.m_aRectangle);
- //SAL_WARN("lok", "#" << i << " Overlap: " << rcOverlap.toString());
+ //SAL_WARN("lok", "Overlap: " << rcOverlap.toString());
bool bOverlap = (rcOverlap.GetWidth() > 0 && rcOverlap.GetHeight() > 0);
if (bOverlap)
{
@@ -768,6 +769,7 @@ void CallbackFlushHandler::queue(const int type, const char* data)
}
}
+ //SAL_WARN("lok", ">> Queueing: " << type << " : " << payload);
m_queue.emplace_back(type, payload);
lock.unlock();
@@ -783,6 +785,7 @@ void CallbackFlushHandler::flush()
{
std::unique_lock<std::mutex> lock(m_mutex);
+ //SAL_WARN("lok", "Flushing " << m_queue.size() << " elements.");
for (auto& pair : m_queue)
{
const int type = pair.first;
@@ -797,7 +800,7 @@ void CallbackFlushHandler::flush()
// If the state didn't change, it's safe to ignore.
if (stateIt->second == payload)
{
- //SAL_WARN("lok", "Skipping duplicate [" + std::to_string(type) + "]: [" + payload + "].");
+ //SAL_WARN("lok", "Skipping duplicate [" << type << "]: [" << payload << "].");
continue;
}
@@ -816,24 +819,26 @@ void CallbackFlushHandler::flush()
// If the state didn't change, it's safe to ignore.
if (stateIt->second == payload)
{
- //SAL_WARN("lok", "Skipping view duplicate [" + std::to_string(type) + "," + std::to_string(viewId) + "]: [" + payload + "].");
+ //SAL_WARN("lok", "Skipping view duplicate [" << type << ',' << viewId << "]: [" << payload << "].");
continue;
}
stateIt->second = payload;
- //SAL_WARN("lok", "Replacing an element in view states [" + std::to_string(type) + "," + std::to_string(viewId) + "]: [" + payload + "].");
+ //SAL_WARN("lok", "Replacing an element in view states [" << type << ',' << viewId << "]: [" << payload << "].");
}
else
{
states.emplace(type, payload);
- //SAL_WARN("lok", "Inserted a new element in view states: [" + std::to_string(type) + "," + std::to_string(viewId) + "]: [" + payload + "]");
+ //SAL_WARN("lok", "Inserted a new element in view states: [" << type << ',' << viewId << "]: [" << payload << "]");
}
}
}
+ //SAL_WARN("lok", "<< Callback: " << type << " : " << payload);
m_pCallback(type, payload.c_str(), m_pData);
}
+ //SAL_WARN("lok", "Done flushing.");
m_queue.clear();
}
}