perf: skip update from GIF timer if no animated elements are shown (#5042)

This commit is contained in:
nerix
2023-12-25 20:04:46 +01:00
committed by GitHub
parent 485fc5cdb4
commit 1006bf955a
9 changed files with 51 additions and 20 deletions
+5 -1
View File
@@ -32,6 +32,10 @@ enum class MessageLayoutFlag : uint8_t {
};
using MessageLayoutFlags = FlagsEnum<MessageLayoutFlag>;
struct MessagePaintResult {
bool hasAnimatedElements = false;
};
class MessageLayout
{
public:
@@ -55,7 +59,7 @@ public:
bool layout(int width, float scale_, MessageElementFlags flags);
// Painting
void paint(const MessagePaintContext &ctx);
MessagePaintResult paint(const MessagePaintContext &ctx);
void invalidateBuffer();
void deleteBuffer();
void deleteCache();