perf: add signal to invalidate buffers without doing layout (#5123)

This commit is contained in:
nerix
2024-01-24 18:13:31 +01:00
committed by GitHub
parent 5628605de4
commit 7604d7ea4a
7 changed files with 51 additions and 9 deletions
+7 -1
View File
@@ -74,7 +74,8 @@ int MessageLayout::getWidth() const
// Layout
// return true if redraw is required
bool MessageLayout::layout(int width, float scale, MessageElementFlags flags)
bool MessageLayout::layout(int width, float scale, MessageElementFlags flags,
bool shouldInvalidateBuffer)
{
// BenchmarkGuard benchmark("MessageLayout::layout()");
@@ -108,6 +109,11 @@ bool MessageLayout::layout(int width, float scale, MessageElementFlags flags)
if (!layoutRequired)
{
if (shouldInvalidateBuffer)
{
this->invalidateBuffer();
return true;
}
return false;
}