mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2025-12-18 23:27:44 +03:00
Re-use existing buffer and write to whole screen for 'partial update'
This commit is contained in:
parent
6f88008737
commit
efe1da9526
@ -216,9 +216,12 @@ void EpdRenderer::flushDisplay(const EInkDisplay::RefreshMode refreshMode) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Support partial window update
|
// TODO: Support partial window update
|
||||||
void EpdRenderer::flushArea(const int x, const int y, const int width, const int height) const {
|
// void EpdRenderer::flushArea(const int x, const int y, const int width, const int height) const {
|
||||||
einkDisplay.displayBuffer();
|
// const int rotatedX = y;
|
||||||
}
|
// const int rotatedY = EInkDisplay::DISPLAY_HEIGHT - 1 - x;
|
||||||
|
//
|
||||||
|
// einkDisplay.displayBuffer(EInkDisplay::FAST_REFRESH, rotatedX, rotatedY, height, width);
|
||||||
|
// }
|
||||||
|
|
||||||
int EpdRenderer::getPageWidth() const { return EInkDisplay::DISPLAY_HEIGHT - marginLeft - marginRight; }
|
int EpdRenderer::getPageWidth() const { return EInkDisplay::DISPLAY_HEIGHT - marginLeft - marginRight; }
|
||||||
|
|
||||||
@ -230,6 +233,8 @@ int EpdRenderer::getLineHeight() const {
|
|||||||
return regularFontRenderer->fontFamily->getData(REGULAR)->advanceY * lineCompression;
|
return regularFontRenderer->fontFamily->getData(REGULAR)->advanceY * lineCompression;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EpdRenderer::swapBuffers() const { einkDisplay.swapBuffers(); }
|
||||||
|
|
||||||
void EpdRenderer::copyGrayscaleLsbBuffers() const { einkDisplay.copyGrayscaleLsbBuffers(einkDisplay.getFrameBuffer()); }
|
void EpdRenderer::copyGrayscaleLsbBuffers() const { einkDisplay.copyGrayscaleLsbBuffers(einkDisplay.getFrameBuffer()); }
|
||||||
|
|
||||||
void EpdRenderer::copyGrayscaleMsbBuffers() const { einkDisplay.copyGrayscaleMsbBuffers(einkDisplay.getFrameBuffer()); }
|
void EpdRenderer::copyGrayscaleMsbBuffers() const { einkDisplay.copyGrayscaleMsbBuffers(einkDisplay.getFrameBuffer()); }
|
||||||
|
|||||||
@ -33,6 +33,7 @@ class EpdRenderer {
|
|||||||
void drawImage(const uint8_t bitmap[], int x, int y, int width, int height) const;
|
void drawImage(const uint8_t bitmap[], int x, int y, int width, int height) const;
|
||||||
void drawImageNoMargin(const uint8_t bitmap[], int x, int y, int width, int height) const;
|
void drawImageNoMargin(const uint8_t bitmap[], int x, int y, int width, int height) const;
|
||||||
|
|
||||||
|
void swapBuffers() const;
|
||||||
void copyGrayscaleLsbBuffers() const;
|
void copyGrayscaleLsbBuffers() const;
|
||||||
void copyGrayscaleMsbBuffers() const;
|
void copyGrayscaleMsbBuffers() const;
|
||||||
void displayGrayBuffer() const;
|
void displayGrayBuffer() const;
|
||||||
@ -41,7 +42,7 @@ class EpdRenderer {
|
|||||||
void invertScreen() const;
|
void invertScreen() const;
|
||||||
|
|
||||||
void flushDisplay(EInkDisplay::RefreshMode refreshMode = EInkDisplay::FAST_REFRESH) const;
|
void flushDisplay(EInkDisplay::RefreshMode refreshMode = EInkDisplay::FAST_REFRESH) const;
|
||||||
void flushArea(int x, int y, int width, int height) const;
|
// void flushArea(int x, int y, int width, int height) const;
|
||||||
|
|
||||||
int getPageWidth() const;
|
int getPageWidth() const;
|
||||||
int getPageHeight() const;
|
int getPageHeight() const;
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
Subproject commit fe963b32821dec7fb22abbfa22daa8fc67f286d1
|
Subproject commit a126d4b0bf66cd2895d11748774f7ec2c366cc4c
|
||||||
@ -160,10 +160,12 @@ void EpubReaderScreen::renderScreen() {
|
|||||||
constexpr int y = 50;
|
constexpr int y = 50;
|
||||||
const int w = textWidth + margin * 2;
|
const int w = textWidth + margin * 2;
|
||||||
const int h = renderer.getLineHeight() + margin * 2;
|
const int h = renderer.getLineHeight() + margin * 2;
|
||||||
|
renderer.swapBuffers();
|
||||||
renderer.fillRect(x, y, w, h, 0);
|
renderer.fillRect(x, y, w, h, 0);
|
||||||
renderer.drawText(x + margin, y + margin, "Indexing...");
|
renderer.drawText(x + margin, y + margin, "Indexing...");
|
||||||
renderer.drawRect(x + 5, y + 5, w - 10, h - 10);
|
renderer.drawRect(x + 5, y + 5, w - 10, h - 10);
|
||||||
renderer.flushArea(x, y, w, h);
|
renderer.flushDisplay(EInkDisplay::HALF_REFRESH);
|
||||||
|
pagesUntilFullRefresh = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
section->setupCacheDir();
|
section->setupCacheDir();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user