perf: add signal to invalidate buffers without doing layout (#5123)
This commit is contained in:
@@ -211,6 +211,11 @@ void WindowManager::forceLayoutChannelViews()
|
||||
this->layoutChannelViews(nullptr);
|
||||
}
|
||||
|
||||
void WindowManager::invalidateChannelViewBuffers(Channel *channel)
|
||||
{
|
||||
this->invalidateBuffersRequested.invoke(channel);
|
||||
}
|
||||
|
||||
void WindowManager::repaintVisibleChatWidgets(Channel *channel)
|
||||
{
|
||||
this->layoutRequested.invoke(channel);
|
||||
@@ -407,10 +412,10 @@ void WindowManager::initialize(Settings &settings, const Paths &paths)
|
||||
this->forceLayoutChannelViews();
|
||||
});
|
||||
settings.alternateMessages.connect([this](auto, auto) {
|
||||
this->forceLayoutChannelViews();
|
||||
this->invalidateChannelViewBuffers();
|
||||
});
|
||||
settings.separateMessages.connect([this](auto, auto) {
|
||||
this->forceLayoutChannelViews();
|
||||
this->invalidateChannelViewBuffers();
|
||||
});
|
||||
settings.collpseMessagesMinLines.connect([this](auto, auto) {
|
||||
this->forceLayoutChannelViews();
|
||||
|
||||
@@ -66,6 +66,10 @@ public:
|
||||
// This is called, for example, when the emote scale or timestamp format has
|
||||
// changed
|
||||
void forceLayoutChannelViews();
|
||||
|
||||
// Tell a channel (or all channels if channel is nullptr) to invalidate all paint buffers
|
||||
void invalidateChannelViewBuffers(Channel *channel = nullptr);
|
||||
|
||||
void repaintVisibleChatWidgets(Channel *channel = nullptr);
|
||||
void repaintGifEmotes();
|
||||
|
||||
@@ -124,6 +128,9 @@ public:
|
||||
// This signal fires whenever views rendering a channel, or all views if the
|
||||
// channel is a nullptr, need to redo their layout
|
||||
pajlada::Signals::Signal<Channel *> layoutRequested;
|
||||
// This signal fires whenever views rendering a channel, or all views if the
|
||||
// channel is a nullptr, need to invalidate their paint buffers
|
||||
pajlada::Signals::Signal<Channel *> invalidateBuffersRequested;
|
||||
|
||||
pajlada::Signals::NoArgSignal wordFlagsChanged;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user