added graphics cache for drawn messages

This commit is contained in:
fourtf
2017-02-03 19:31:51 +01:00
parent a92c3dc2a4
commit 759e0aea50
7 changed files with 143 additions and 86 deletions
+6 -8
View File
@@ -1,9 +1,11 @@
#ifndef MESSAGEREF_H
#define MESSAGEREF_H
#include <memory>
#include "messages/message.h"
#include <QPixmap>
#include <memory>
namespace chatterino {
namespace messages {
@@ -26,18 +28,15 @@ public:
bool layout(int width, bool enableEmoteMargins = true);
void
requestRelayout()
{
relayoutRequested = true;
}
const std::vector<WordPart> &
getWordParts() const
{
return wordParts;
}
std::shared_ptr<QPixmap> buffer = nullptr;
bool updateBuffer = false;
private:
Message *message;
std::shared_ptr<Message> messagePtr;
@@ -47,7 +46,6 @@ private:
int height = 0;
int currentLayoutWidth = -1;
bool relayoutRequested = true;
int fontGeneration = -1;
int emoteGeneration = -1;