[Libreoffice-commits] online.git: wsd/DocumentBroker.cpp wsd/TileCache.cpp wsd/TileCache.hpp
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Feb 15 20:39:23 UTC 2019
wsd/DocumentBroker.cpp | 1 +
wsd/TileCache.cpp | 14 ++++++++++++++
wsd/TileCache.hpp | 4 ++--
3 files changed, 17 insertions(+), 2 deletions(-)
New commits:
commit 150d20cf37b2aa6112b13f73cf67b466f8a64975
Author: Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Fri Feb 15 20:42:00 2019 +0100
Commit: Michael Meeks <michael.meeks at collabora.com>
CommitDate: Fri Feb 15 21:36:28 2019 +0100
TileCache: dumpState.
Change-Id: I6289f0b77eb0649be8254aa8c9647c47d4db3008
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 2239079e6..e615b6d04 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -1888,6 +1888,7 @@ void DocumentBroker::dumpState(std::ostream& os)
os << "\n last saved: " << std::ctime(&t);
os << "\n cursor " << _cursorPosX << ", " << _cursorPosY
<< "( " << _cursorWidth << "," << _cursorHeight << ")\n";
+ _tileCache->dumpState(os);
_poll->dumpState(os);
}
diff --git a/wsd/TileCache.cpp b/wsd/TileCache.cpp
index e87fe9214..a5dae27c6 100644
--- a/wsd/TileCache.cpp
+++ b/wsd/TileCache.cpp
@@ -559,4 +559,18 @@ TileCache::Tile TileCache::loadTile(const std::string &fileName)
return TileCache::Tile();
}
+void TileCache::dumpState(std::ostream& os)
+{
+ size_t num = 0, size = 0;
+ for (auto it : _cache)
+ {
+ num++; size += it.second->size();
+ }
+ os << " tile cache: num: " << num << " size: " << size << " bytes\n";
+ for (auto it : _cache)
+ {
+ os << " " /* << std::setw(4) << it.first->getWireId() */ << " - '" << it.first << "' - " << it.second->size() << " bytes\n";
+ }
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/wsd/TileCache.hpp b/wsd/TileCache.hpp
index 9f847fc5d..fe5a7ca34 100644
--- a/wsd/TileCache.hpp
+++ b/wsd/TileCache.hpp
@@ -91,11 +91,11 @@ public:
bool hasTileBeingRendered(const TileDesc& tile);
int getTileBeingRenderedVersion(const TileDesc& tile);
+ // Debugging bits ...
+ void dumpState(std::ostream& os);
void setThreadOwner(const std::thread::id &id) { _owner = id; }
void assertCorrectThread();
-
-
private:
void invalidateTiles(int part, int x, int y, int width, int height);
More information about the Libreoffice-commits
mailing list