Skip to content

Commit

Permalink
Reduce EPFrameBuffer footprint
Browse files Browse the repository at this point in the history
  • Loading branch information
Eeems committed Feb 5, 2024
1 parent 1d42817 commit 1b4517c
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 20 deletions.
10 changes: 5 additions & 5 deletions applications/display-server/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ void Connection::readSocket(){
guiThread->enqueue(
surface,
rect,
(EPFrameBuffer::WaveformMode)repaint.waveform,
repaint.waveform,
repaint.marker,
false,
[message, this]{ ack(message, 0, nullptr); }
Expand Down Expand Up @@ -389,15 +389,15 @@ void Connection::readSocket(){
guiThread->enqueue(
surface,
surface->rect(),
EPFrameBuffer::WaveformMode::HighQualityGrayscale,
Blight::HighQualityGrayscale,
message->header.ackid,
false,
[message, this]{ ack(message, 0, nullptr); }
);
guiThread->enqueue(
nullptr,
rect,
EPFrameBuffer::WaveformMode::HighQualityGrayscale,
Blight::HighQualityGrayscale,
message->header.ackid,
true,
nullptr
Expand Down Expand Up @@ -473,7 +473,7 @@ void Connection::readSocket(){
guiThread->enqueue(
surface,
surface->rect(),
EPFrameBuffer::WaveformMode::HighQualityGrayscale,
Blight::HighQualityGrayscale,
message->header.ackid,
false,
[message, this]{ ack(message, 0, nullptr); }
Expand All @@ -496,7 +496,7 @@ void Connection::readSocket(){
guiThread->enqueue(
nullptr,
surface->geometry(),
EPFrameBuffer::WaveformMode::HighQualityGrayscale,
Blight::HighQualityGrayscale,
message->header.ackid,
true,
[message, this]{ ack(message, 0, nullptr); }
Expand Down
4 changes: 2 additions & 2 deletions applications/display-server/dbusinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ void DbusInterface::exitExclusiveMode(QDBusMessage message){
guiThread->enqueue(
nullptr,
EPFrameBuffer::instance()->framebuffer()->rect(),
EPFrameBuffer::HighQualityGrayscale,
Blight::HighQualityGrayscale,
0,
true
);
Expand All @@ -394,7 +394,7 @@ void DbusInterface::exclusiveModeRepaint(QDBusMessage message){
#ifdef EPAPER
guiThread->sendUpdate(
EPFrameBuffer::instance()->framebuffer()->rect(),
EPFrameBuffer::HighQualityGrayscale,
Blight::HighQualityGrayscale,
0
);
#endif
Expand Down
5 changes: 3 additions & 2 deletions applications/display-server/guithread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "connection.h"
#include "dbusinterface.h"

#include <epframebuffer.h>
#include <QAbstractEventDispatcher>
#include <QTimer>
#include <QPainter>
Expand Down Expand Up @@ -90,7 +91,7 @@ GUIThread::~GUIThread(){
void GUIThread::enqueue(
std::shared_ptr<Surface> surface,
QRect region,
EPFrameBuffer::WaveformMode waveform,
Blight::WaveformMode waveform,
unsigned int marker,
bool global,
std::function<void()> callback
Expand Down Expand Up @@ -253,7 +254,7 @@ void GUIThread::redraw(RepaintRequest& event){
O_DEBUG("Repaint" << region.boundingRect() << "done in" << region.rectCount() << "paints, and" << cw.elapsed() << "seconds");
}

void GUIThread::sendUpdate(const QRect& rect, EPFrameBuffer::WaveformMode waveform, unsigned int marker){
void GUIThread::sendUpdate(const QRect& rect, Blight::WaveformMode waveform, unsigned int marker){
auto mode = rect == m_screenRect
? EPFrameBuffer::FullUpdate
: EPFrameBuffer::PartialUpdate;
Expand Down
7 changes: 3 additions & 4 deletions applications/display-server/guithread.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include <QWaitCondition>
#include <QSemaphore>
#include <QQueue>
#include <epframebuffer.h>
#include <liboxide/threading.h>
#include <libblight/concurrentqueue.h>

Expand All @@ -15,7 +14,7 @@
struct RepaintRequest{
std::shared_ptr<Surface> surface;
QRegion region;
EPFrameBuffer::WaveformMode waveform;
Blight::WaveformMode waveform;
unsigned int marker;
bool global;
std::function<void()> callback;
Expand All @@ -38,14 +37,14 @@ public slots:
void enqueue(
std::shared_ptr<Surface> surface,
QRect region,
EPFrameBuffer::WaveformMode waveform,
Blight::WaveformMode waveform,
unsigned int marker,
bool global = false,
std::function<void()> callback = nullptr
);
void notify();
int framebuffer();
void sendUpdate(const QRect& rect, EPFrameBuffer::WaveformMode waveform, unsigned int marker);
void sendUpdate(const QRect& rect, Blight::WaveformMode waveform, unsigned int marker);

private:
GUIThread(QRect screenGeometry);
Expand Down
2 changes: 1 addition & 1 deletion applications/display-server/surface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void Surface::repaint(QRect rect){
guiThread->enqueue(
nullptr,
geometry(),
EPFrameBuffer::HighQualityGrayscale,
Blight::HighQualityGrayscale,
0,
true
);
Expand Down
6 changes: 6 additions & 0 deletions shared/epaper/epaper.pro
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ epframebuffer_h.target = epframebuffer.h
epframebuffer_h.commands = cp $$PWD/epframebuffer.h $$OUT_PWD
QMAKE_EXTRA_TARGETS += epframebuffer_h

linux-oe-g++{
epframebuffer_h_install.files = epframebuffer.h
epframebuffer_h_install.path = /opt/include
INSTALLS += epframebuffer_h_install
}

PRE_TARGETDEPS += $$epframebuffer_h.target $$epimagenode_h.target
QMAKE_CLEAN += $$epframebuffer_h.target $$epimagenode_h.target

6 changes: 0 additions & 6 deletions shared/liboxide/liboxide.pro
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,6 @@ liboxide_h_install.depends = liboxide_h
liboxide_h_install.path = /opt/include/
INSTALLS += liboxide_h_install

linux-oe-g++{
epframebuffer_h_install.files = ../epaper/epframebuffer.h
epframebuffer_h_install.path = /opt/include
INSTALLS += epframebuffer_h_install
}

QMAKE_EXTRA_TARGETS += liboxide_liboxide_h liboxide_h liboxide_h_install
POST_TARGETDEPS += $$liboxide_liboxide_h.target $$liboxide_h.target
QMAKE_CLEAN += $$liboxide_h.target include/liboxide/*.h
Expand Down

0 comments on commit 1b4517c

Please sign in to comment.