made change to be able to use libopenui with lvgl as underlying lib
This commit is contained in:
committed by
Raphael Coeffic
parent
b624ffc631
commit
e538138ade
+4
-4
@@ -36,7 +36,7 @@ constexpr uint8_t STASHED = 0x33;
|
|||||||
#define APPLY_OFFSET() x += this->offsetX; y += this->offsetY
|
#define APPLY_OFFSET() x += this->offsetX; y += this->offsetY
|
||||||
#define RESTORE_OFFSET() this->offsetX = offsetX, this->offsetY = offsetY
|
#define RESTORE_OFFSET() this->offsetX = offsetX, this->offsetY = offsetY
|
||||||
|
|
||||||
#if defined(LCD_VERTICAL_INVERT)
|
#if defined(LCD_VERTICAL_INVERT) && 0
|
||||||
#define MOVE_PIXEL_RIGHT(p, count) p -= count
|
#define MOVE_PIXEL_RIGHT(p, count) p -= count
|
||||||
#else
|
#else
|
||||||
#define MOVE_PIXEL_RIGHT(p, count) p += count
|
#define MOVE_PIXEL_RIGHT(p, count) p += count
|
||||||
@@ -156,7 +156,7 @@ class BitmapBufferBase
|
|||||||
|
|
||||||
inline const pixel_t * getPixelPtrAbs(coord_t x, coord_t y) const
|
inline const pixel_t * getPixelPtrAbs(coord_t x, coord_t y) const
|
||||||
{
|
{
|
||||||
#if defined(LCD_VERTICAL_INVERT)
|
#if defined(LCD_VERTICAL_INVERT) && 0
|
||||||
x = _width - x - 1;
|
x = _width - x - 1;
|
||||||
y = _height - y - 1;
|
y = _height - y - 1;
|
||||||
#endif
|
#endif
|
||||||
@@ -401,7 +401,7 @@ class BitmapBuffer: public BitmapBufferBase<pixel_t>
|
|||||||
|
|
||||||
inline const pixel_t * getPixelPtrAbs(coord_t x, coord_t y) const
|
inline const pixel_t * getPixelPtrAbs(coord_t x, coord_t y) const
|
||||||
{
|
{
|
||||||
#if defined(LCD_VERTICAL_INVERT)
|
#if defined(LCD_VERTICAL_INVERT) && 0
|
||||||
x = _width - x - 1;
|
x = _width - x - 1;
|
||||||
y = _height - y - 1;
|
y = _height - y - 1;
|
||||||
#endif
|
#endif
|
||||||
@@ -410,7 +410,7 @@ class BitmapBuffer: public BitmapBufferBase<pixel_t>
|
|||||||
|
|
||||||
inline pixel_t * getPixelPtrAbs(coord_t x, coord_t y)
|
inline pixel_t * getPixelPtrAbs(coord_t x, coord_t y)
|
||||||
{
|
{
|
||||||
#if defined(LCD_VERTICAL_INVERT)
|
#if defined(LCD_VERTICAL_INVERT) && 0
|
||||||
x = _width - x - 1;
|
x = _width - x - 1;
|
||||||
y = _height - y - 1;
|
y = _height - y - 1;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+13
-1
@@ -186,9 +186,21 @@ void MainWindow::invalidate(const rect_t & rect)
|
|||||||
invalidatedRect = rect;
|
invalidatedRect = rect;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#include "lvgl/lvgl.h"
|
||||||
|
extern lv_obj_t * canvas;
|
||||||
|
extern BitmapBuffer lcdBackup;
|
||||||
bool MainWindow::refresh()
|
bool MainWindow::refresh()
|
||||||
{
|
{
|
||||||
|
if (invalidatedRect.w) {
|
||||||
|
lcdBackup.setOffset(0, 0);
|
||||||
|
lcdBackup.setClippingRect(0,LCD_W,0, LCD_H);
|
||||||
|
fullPaint(&lcdBackup);
|
||||||
|
lv_canvas_copy_buf(canvas, lcdBackup.getData(), 0, 0, LCD_W, LCD_H);
|
||||||
|
lv_img_cache_invalidate_src(lcdBackup.getData());
|
||||||
|
lv_obj_invalidate(canvas);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
|
||||||
if (invalidatedRect.w) {
|
if (invalidatedRect.w) {
|
||||||
if (invalidatedRect.x > 0 || invalidatedRect.y > 0 || invalidatedRect.w < LCD_W || invalidatedRect.h < LCD_H) {
|
if (invalidatedRect.x > 0 || invalidatedRect.y > 0 || invalidatedRect.w < LCD_W || invalidatedRect.h < LCD_H) {
|
||||||
TRACE_WINDOWS("Refresh rect: left=%d top=%d width=%d height=%d", invalidatedRect.left(), invalidatedRect.top(), invalidatedRect.w, invalidatedRect.h);
|
TRACE_WINDOWS("Refresh rect: left=%d top=%d width=%d height=%d", invalidatedRect.left(), invalidatedRect.top(), invalidatedRect.w, invalidatedRect.h);
|
||||||
|
|||||||
Reference in New Issue
Block a user