mirror of
https://github.com/kunkundi/crossdesk.git
synced 2026-11-04 04:52:39 +08:00
[perf] accelerate Kitty and ANSI rendering
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include <atomic>
|
||||
#include <csignal>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
@@ -34,6 +35,21 @@ struct TerminalSize {
|
||||
};
|
||||
TerminalSize GetTerminalSize(int fd);
|
||||
|
||||
// One private, uniquely named pixel buffer. Keep it alive until the terminal
|
||||
// acknowledges reading it; Reset also unlinks objects the terminal left behind.
|
||||
class SharedImage {
|
||||
public:
|
||||
SharedImage();
|
||||
~SharedImage();
|
||||
bool Assign(const uint8_t *data, size_t size);
|
||||
void Reset();
|
||||
const std::string &Name() const;
|
||||
|
||||
private:
|
||||
struct State;
|
||||
std::unique_ptr<State> state_;
|
||||
};
|
||||
|
||||
class NonBlocking {
|
||||
public:
|
||||
explicit NonBlocking(int fd, bool output = false);
|
||||
|
||||
Reference in New Issue
Block a user