perf: add signal to invalidate buffers without doing layout (#5123)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,8 @@ public:
|
||||
|
||||
MessageLayoutFlags flags;
|
||||
|
||||
bool layout(int width, float scale_, MessageElementFlags flags);
|
||||
bool layout(int width, float scale_, MessageElementFlags flags,
|
||||
bool shouldInvalidateBuffer);
|
||||
|
||||
// Painting
|
||||
MessagePaintResult paint(const MessagePaintContext &ctx);
|
||||
|
||||
Reference in New Issue
Block a user