Merge pull request #6002 from opentx/raphaelcoeffic/rle_bitmaps
[Horus] save space in bootloader and firmware by using RLE compression
This commit is contained in:
@@ -1,31 +1,26 @@
|
||||
if(PCB STREQUAL X12S)
|
||||
add_bitmaps_target(x12s_bitmaps "${RADIO_SRC_DIRECTORY}/bitmaps/480x272/bmp_*.png" 480 5/6/5)
|
||||
add_bitmaps_target(x12s_calibration_bitmaps "${RADIO_SRC_DIRECTORY}/bitmaps/480x272/calibration/bmp_*.png" 480 5/6/5)
|
||||
add_bitmaps_target(x12s_button_bitmaps "${RADIO_SRC_DIRECTORY}/bitmaps/480x272/button/alpha_*.png" 480 4/4/4/4)
|
||||
add_bitmaps_target(x12s_alpha_bitmaps "${RADIO_SRC_DIRECTORY}/bitmaps/480x272/alpha_*.png" 480 4/4/4/4)
|
||||
add_bitmaps_target(x12s_alpha_calibration_bitmaps "${RADIO_SRC_DIRECTORY}/bitmaps/480x272/calibration/alpha_*.png" 480 4/4/4/4)
|
||||
add_bitmaps_target(x12s_masks ${RADIO_SRC_DIRECTORY}/bitmaps/480x272/mask_*.png 480 8bits)
|
||||
add_bitmaps_target(x12s_slider_masks "${RADIO_SRC_DIRECTORY}/bitmaps/480x272/slider/*.png" 480 8bits)
|
||||
add_bitmaps_target(x12s_layouts_masks "${RADIO_SRC_DIRECTORY}/gui/480x272/layouts/*.png" 480 8bits)
|
||||
add_bitmaps_target(x12s_themes_bitmaps "${RADIO_SRC_DIRECTORY}/gui/480x272/themes/*.png" 480 5/6/5)
|
||||
add_bitmaps_target(x12s_fonts ${RADIO_SRC_DIRECTORY}/fonts/480x272/*.png 480 8bits)
|
||||
add_bitmaps_target(x12s_volume_masks ${RADIO_SRC_DIRECTORY}/bitmaps/480x272/volume/*.png 480 8bits)
|
||||
add_bitmaps_target(x12s_bootloader_bitmaps ${RADIO_SRC_DIRECTORY}/bitmaps/480x272/bootloader/bmp_*.png 480 5/6/5)
|
||||
add_bitmaps_target(x12s_bootloader_icons ${RADIO_SRC_DIRECTORY}/bitmaps/480x272/bootloader/icon_*.png 480 8bits)
|
||||
add_dependencies(x12s_bitmaps x12s_calibration_bitmaps x12s_button_bitmaps x12s_alpha_bitmaps x12s_alpha_calibration_bitmaps x12s_masks x12s_slider_masks x12s_layouts_masks x12s_themes_bitmaps x12s_fonts x12s_volume_masks x12s_bootloader_bitmaps x12s_bootloader_icons)
|
||||
set(BITMAP_TARGET_PREFIX x12s)
|
||||
set(BITMAP_FMT_SUFFIX "")
|
||||
else()
|
||||
add_bitmaps_target(x10_bitmaps "${RADIO_SRC_DIRECTORY}/bitmaps/480x272/bmp_*.png" 480 5/6/5-R)
|
||||
add_bitmaps_target(x10_calibration_bitmaps "${RADIO_SRC_DIRECTORY}/bitmaps/480x272/calibration/bmp_*.png" 480 5/6/5-R)
|
||||
add_bitmaps_target(x10_button_bitmaps "${RADIO_SRC_DIRECTORY}/bitmaps/480x272/button/alpha_*.png" 480 4/4/4/4-R)
|
||||
add_bitmaps_target(x10_alpha_bitmaps "${RADIO_SRC_DIRECTORY}/bitmaps/480x272/alpha_*.png" 480 4/4/4/4-R)
|
||||
add_bitmaps_target(x10_alpha_calibration_bitmaps "${RADIO_SRC_DIRECTORY}/bitmaps/480x272/calibration/alpha_*.png" 480 4/4/4/4-R)
|
||||
add_bitmaps_target(x10_masks ${RADIO_SRC_DIRECTORY}/bitmaps/480x272/mask_*.png 480 8bits)
|
||||
add_bitmaps_target(x10_slider_masks "${RADIO_SRC_DIRECTORY}/bitmaps/480x272/slider/*.png" 480 8bits)
|
||||
add_bitmaps_target(x10_layouts_masks "${RADIO_SRC_DIRECTORY}/gui/480x272/layouts/*.png" 480 8bits)
|
||||
add_bitmaps_target(x10_themes_bitmaps "${RADIO_SRC_DIRECTORY}/gui/480x272/themes/*.png" 480 5/6/5-R)
|
||||
add_bitmaps_target(x10_fonts ${RADIO_SRC_DIRECTORY}/fonts/480x272/*.png 480 8bits)
|
||||
add_bitmaps_target(x10_volume_masks ${RADIO_SRC_DIRECTORY}/bitmaps/480x272/volume/*.png 480 8bits)
|
||||
add_bitmaps_target(x10_bootloader_bitmaps ${RADIO_SRC_DIRECTORY}/bitmaps/480x272/bootloader/bmp_*.png 480 5/6/5-R)
|
||||
add_bitmaps_target(x10_bootloader_icons ${RADIO_SRC_DIRECTORY}/bitmaps/480x272/bootloader/icon_*.png 480 8bits)
|
||||
add_dependencies(x10_bitmaps x10_calibration_bitmaps x10_button_bitmaps x10_alpha_bitmaps x10_alpha_calibration_bitmaps x10_masks x10_slider_masks x10_layouts_masks x10_themes_bitmaps x10_fonts x10_volume_masks x10_bootloader_bitmaps x10_bootloader_icons)
|
||||
set(BITMAP_TARGET_PREFIX x10)
|
||||
set(BITMAP_FMT_SUFFIX "-R")
|
||||
endif()
|
||||
|
||||
add_bitmaps_target(${BITMAP_TARGET_PREFIX}_bitmaps "${RADIO_SRC_DIRECTORY}/bitmaps/480x272/bmp_*.png" 480 "5/6/5${BITMAP_FMT_SUFFIX}")
|
||||
add_bitmaps_target(${BITMAP_TARGET_PREFIX}_calibration_bitmaps "${RADIO_SRC_DIRECTORY}/bitmaps/480x272/calibration/bmp_*.png" 480 "5/6/5${BITMAP_FMT_SUFFIX}")
|
||||
add_bitmaps_target(${BITMAP_TARGET_PREFIX}_button_bitmaps "${RADIO_SRC_DIRECTORY}/bitmaps/480x272/button/alpha_*.png" 480 "4/4/4/4${BITMAP_FMT_SUFFIX}")
|
||||
add_bitmaps_target(${BITMAP_TARGET_PREFIX}_alpha_bitmaps "${RADIO_SRC_DIRECTORY}/bitmaps/480x272/alpha_*.png" 480 "4/4/4/4${BITMAP_FMT_SUFFIX}")
|
||||
add_bitmaps_target(${BITMAP_TARGET_PREFIX}_alpha_calibration_bitmaps "${RADIO_SRC_DIRECTORY}/bitmaps/480x272/calibration/alpha_*.png" 480 "4/4/4/4${BITMAP_FMT_SUFFIX}")
|
||||
add_bitmaps_target(${BITMAP_TARGET_PREFIX}_masks ${RADIO_SRC_DIRECTORY}/bitmaps/480x272/mask_*.png 480 8bits)
|
||||
add_bitmaps_target(${BITMAP_TARGET_PREFIX}_slider_masks "${RADIO_SRC_DIRECTORY}/bitmaps/480x272/slider/*.png" 480 8bits)
|
||||
add_bitmaps_target(${BITMAP_TARGET_PREFIX}_layouts_masks "${RADIO_SRC_DIRECTORY}/gui/480x272/layouts/*.png" 480 8bits)
|
||||
add_bitmaps_target(${BITMAP_TARGET_PREFIX}_themes_bitmaps "${RADIO_SRC_DIRECTORY}/gui/480x272/themes/*.png" 480 "5/6/5${BITMAP_FMT_SUFFIX}")
|
||||
add_bitmaps_target(${BITMAP_TARGET_PREFIX}_fonts ${RADIO_SRC_DIRECTORY}/fonts/480x272/*.png 480 8bits rle)
|
||||
add_bitmaps_target(${BITMAP_TARGET_PREFIX}_volume_masks ${RADIO_SRC_DIRECTORY}/bitmaps/480x272/volume/*.png 480 8bits)
|
||||
add_bitmaps_target(${BITMAP_TARGET_PREFIX}_bootloader_bitmaps ${RADIO_SRC_DIRECTORY}/bitmaps/480x272/bootloader/bmp_*.png 480 "5/6/5${BITMAP_FMT_SUFFIX}" rle)
|
||||
add_bitmaps_target(${BITMAP_TARGET_PREFIX}_bootloader_icons ${RADIO_SRC_DIRECTORY}/bitmaps/480x272/bootloader/icon_*.png 480 8bits)
|
||||
|
||||
add_dependencies(${BITMAP_TARGET_PREFIX}_bitmaps ${BITMAP_TARGET_PREFIX}_calibration_bitmaps ${BITMAP_TARGET_PREFIX}_button_bitmaps ${BITMAP_TARGET_PREFIX}_alpha_bitmaps
|
||||
${BITMAP_TARGET_PREFIX}_alpha_calibration_bitmaps ${BITMAP_TARGET_PREFIX}_masks ${BITMAP_TARGET_PREFIX}_slider_masks ${BITMAP_TARGET_PREFIX}_layouts_masks
|
||||
${BITMAP_TARGET_PREFIX}_themes_bitmaps ${BITMAP_TARGET_PREFIX}_fonts ${BITMAP_TARGET_PREFIX}_volume_masks ${BITMAP_TARGET_PREFIX}_bootloader_bitmaps
|
||||
${BITMAP_TARGET_PREFIX}_bootloader_icons)
|
||||
|
||||
+7
-7
@@ -24,17 +24,17 @@
|
||||
#if defined(COLORLCD)
|
||||
|
||||
#if !defined(BOOT)
|
||||
extern const uint16_t * const fontspecsTable[16];
|
||||
extern const uint8_t * const fontsTable[16];
|
||||
#define FONT_TABLE_SIZE 16
|
||||
#else
|
||||
extern const uint16_t * const fontspecsTable[1];
|
||||
extern const uint8_t * const fontsTable[1];
|
||||
#define FONT_TABLE_SIZE 1
|
||||
#endif
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
extern BitmapBuffer * fontCache[2];
|
||||
extern const uint16_t * const fontspecsTable[FONT_TABLE_SIZE];
|
||||
extern const uint8_t * fontsTable[FONT_TABLE_SIZE];
|
||||
extern BitmapBuffer * fontCache[2];
|
||||
|
||||
void loadFontCache();
|
||||
#endif
|
||||
void loadFonts();
|
||||
|
||||
#else
|
||||
|
||||
|
||||
@@ -489,6 +489,8 @@ void BitmapBuffer::drawBitmapPatternPie(coord_t x0, coord_t y0, const uint8_t *
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(BOOT)
|
||||
|
||||
BitmapBuffer * BitmapBuffer::load(const char * filename)
|
||||
{
|
||||
const char * ext = getFileExtension(filename);
|
||||
@@ -743,7 +745,6 @@ void *stb_realloc(void *ptr, unsigned int oldsz, unsigned int newsz)
|
||||
}
|
||||
#endif // #if defined(TRACE_STB_MALLOC)
|
||||
|
||||
|
||||
#include "thirdparty/Stb/stb_image.h"
|
||||
|
||||
// fill 'data' with 'size' bytes. return number of bytes actually read
|
||||
@@ -831,3 +832,4 @@ BitmapBuffer * BitmapBuffer::load_stb(const char * filename)
|
||||
stbi_image_free(img);
|
||||
return bmp;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
#include <inttypes.h>
|
||||
#include "colors.h"
|
||||
#include "rle.h"
|
||||
|
||||
#if defined(PCBX10) && !defined(SIMU)
|
||||
#define MOVE_PIXEL_RIGHT(p, count) p -= count
|
||||
@@ -59,6 +60,16 @@ class BitmapBufferBase
|
||||
{
|
||||
}
|
||||
|
||||
BitmapBufferBase(uint8_t format, T * data):
|
||||
format(format),
|
||||
data(data),
|
||||
data_end(NULL)
|
||||
{
|
||||
width = *((uint16_t*)data);
|
||||
height = *(((uint16_t*)data)+1);
|
||||
data_end = data + 4 + (width * height);
|
||||
}
|
||||
|
||||
inline uint8_t getFormat() const
|
||||
{
|
||||
return format;
|
||||
@@ -103,6 +114,28 @@ class BitmapBufferBase
|
||||
|
||||
typedef BitmapBufferBase<const uint16_t> Bitmap;
|
||||
|
||||
class RLEBitmap:
|
||||
public BitmapBufferBase<uint16_t>
|
||||
{
|
||||
public:
|
||||
RLEBitmap(uint8_t format, const uint8_t* rle_data)
|
||||
: BitmapBufferBase<uint16_t>(format, 0, 0, NULL)
|
||||
{
|
||||
width = *((uint16_t *)rle_data);
|
||||
height = *(((uint16_t *)rle_data)+1);
|
||||
|
||||
uint32_t pixels = width * height;
|
||||
data = (uint16_t*)malloc(pixels * sizeof(uint16_t));
|
||||
rle_decode_8bit((uint8_t*)data, pixels * sizeof(uint16_t), rle_data+4);
|
||||
data_end = data + pixels;
|
||||
}
|
||||
|
||||
~RLEBitmap()
|
||||
{
|
||||
free(data);
|
||||
}
|
||||
};
|
||||
|
||||
class BitmapBuffer: public BitmapBufferBase<uint16_t>
|
||||
{
|
||||
private:
|
||||
@@ -231,11 +264,13 @@ class BitmapBuffer: public BitmapBufferBase<uint16_t>
|
||||
|
||||
void drawBitmapPatternPie(coord_t x0, coord_t y0, const uint8_t * img, LcdFlags flags, int startAngle, int endAngle);
|
||||
|
||||
#if !defined(BOOT)
|
||||
static BitmapBuffer * load(const char * filename);
|
||||
|
||||
static BitmapBuffer * loadMask(const char * filename);
|
||||
|
||||
static BitmapBuffer * loadMaskOnBackground(const char * filename, LcdFlags foreground, LcdFlags background);
|
||||
#endif
|
||||
|
||||
void drawMask(coord_t x, coord_t y, BitmapBuffer * mask, LcdFlags flags, coord_t offset=0, coord_t width=0);
|
||||
|
||||
@@ -325,8 +360,10 @@ class BitmapBuffer: public BitmapBufferBase<uint16_t>
|
||||
}
|
||||
|
||||
protected:
|
||||
#if !defined(BOOT)
|
||||
static BitmapBuffer * load_bmp(const char * filename);
|
||||
static BitmapBuffer * load_stb(const char * filename);
|
||||
#endif
|
||||
};
|
||||
|
||||
extern BitmapBuffer * lcd;
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
#include "rle.h"
|
||||
|
||||
#if !defined(BOOT)
|
||||
const uint16_t font_tinsize_specs[] = {
|
||||
@@ -82,17 +83,18 @@ const pm_uchar font_stdsizebold[] = {
|
||||
|
||||
#if !defined(BOOT)
|
||||
const uint16_t * const fontspecsTable[16] = {
|
||||
font_stdsize_specs, font_tinsize_specs, font_smlsize_specs, font_midsize_specs, font_dblsize_specs, font_xxlsize_specs, font_stdsize_specs, font_stdsize_specs,
|
||||
font_stdsize_specs, font_tinsize_specs, font_smlsize_specs, font_midsize_specs, font_dblsize_specs, font_xxlsize_specs, font_stdsize_specs, font_stdsize_specs,
|
||||
font_stdsizebold_specs, font_tinsize_specs, font_smlsize_specs, font_midsize_specs, font_dblsize_specs, font_xxlsize_specs, font_stdsize_specs, font_stdsize_specs
|
||||
};
|
||||
|
||||
const uint8_t * const fontsTable[16] = {
|
||||
font_stdsize, font_tinsize, font_smlsize, font_midsize, font_dblsize, font_xxlsize, font_stdsize, font_stdsize,
|
||||
const uint8_t * fontsTable[16] = {
|
||||
font_stdsize, font_tinsize, font_smlsize, font_midsize, font_dblsize, font_xxlsize, font_stdsize, font_stdsize,
|
||||
font_stdsizebold, font_tinsize, font_smlsize, font_midsize, font_dblsize, font_xxlsize, font_stdsize, font_stdsize
|
||||
};
|
||||
|
||||
#else
|
||||
const uint16_t * const fontspecsTable[1] = { font_stdsize_specs };
|
||||
const uint8_t * const fontsTable[1] = { font_stdsize };
|
||||
const uint8_t * fontsTable[1] = { font_stdsize };
|
||||
#endif
|
||||
|
||||
BitmapBuffer * fontCache[2] = { NULL, NULL };
|
||||
@@ -117,3 +119,38 @@ void loadFontCache()
|
||||
fontCache[0] = createFontCache(fontsTable[0], TEXT_COLOR, TEXT_BGCOLOR);
|
||||
fontCache[1] = createFontCache(fontsTable[0], TEXT_INVERTED_COLOR, TEXT_INVERTED_BGCOLOR);
|
||||
}
|
||||
|
||||
|
||||
static uint8_t* decompressFont(const uint8_t* font)
|
||||
{
|
||||
uint16_t width = *((uint16_t *)font);
|
||||
uint16_t height = *(((uint16_t *)font)+1);
|
||||
|
||||
size_t font_size = width * height;
|
||||
uint8_t* dec_buf = (uint8_t*)malloc(font_size + 4);
|
||||
|
||||
// copy width / height
|
||||
memcpy(dec_buf,font,4);
|
||||
|
||||
rle_decode_8bit(dec_buf+4, font_size, font+4);
|
||||
return dec_buf;
|
||||
}
|
||||
|
||||
void loadFonts()
|
||||
{
|
||||
static bool fonts_loaded = false;
|
||||
if (fonts_loaded) return;
|
||||
|
||||
#if !defined(BOOT)
|
||||
int i=0;
|
||||
for (; i<9; i++)
|
||||
fontsTable[i] = decompressFont(fontsTable[i]);
|
||||
|
||||
for (; i<16; i++)
|
||||
fontsTable[i] = fontsTable[i-9];
|
||||
#else
|
||||
fontsTable[0] = decompressFont(fontsTable[0]);
|
||||
#endif
|
||||
|
||||
fonts_loaded = true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
#include "rle.h"
|
||||
#include "debug.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
int rle_decode_8bit(unsigned char* dest, unsigned int dest_size, const unsigned char* src)
|
||||
{
|
||||
//unsigned char count = 0;
|
||||
unsigned char prev_byte = 0;
|
||||
bool prev_byte_valid = false;
|
||||
|
||||
const unsigned char* dest_end = dest + dest_size;
|
||||
unsigned char* d = dest;
|
||||
|
||||
while(d < dest_end) {
|
||||
|
||||
*d++ = *src;
|
||||
if (prev_byte_valid && (*src == prev_byte)) {
|
||||
|
||||
src++;
|
||||
|
||||
if (d + *src > dest + dest_size) {
|
||||
TRACE("rle_decode_8bit: destination overflow!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
memset(d, prev_byte, *src);
|
||||
d += *src++;
|
||||
prev_byte_valid = false;
|
||||
}
|
||||
else {
|
||||
prev_byte = *src++;
|
||||
prev_byte_valid = true;
|
||||
}
|
||||
}
|
||||
|
||||
return d - dest;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
#ifndef _rle_h_
|
||||
#define _rle_h_
|
||||
|
||||
int rle_decode_8bit(unsigned char* dest, unsigned int dest_size, const unsigned char* src);
|
||||
|
||||
|
||||
#endif
|
||||
@@ -22,7 +22,10 @@
|
||||
|
||||
#if defined(SPLASH)
|
||||
|
||||
const uint8_t __bmp_splash[] {
|
||||
#include "bmp_splash.lbm"
|
||||
};
|
||||
Bitmap BMP_SPLASH(BMP_RGB565, (const uint16_t*)__bmp_splash);
|
||||
|
||||
void drawSplash()
|
||||
{
|
||||
@@ -45,6 +48,7 @@ void drawSplash()
|
||||
splashImg);
|
||||
}
|
||||
else {
|
||||
// TODO: verify / load / decompress bitmap
|
||||
lcd->drawBitmap((LCD_W - BMP_SPLASH.getWidth())/2,
|
||||
(LCD_H - BMP_SPLASH.getHeight())/2,
|
||||
&BMP_SPLASH);
|
||||
|
||||
@@ -34,8 +34,15 @@ void drawColumnHeader(const char * const * headers, const char * const * descrip
|
||||
}
|
||||
}
|
||||
|
||||
const uint8_t __alpha_button_on[] {
|
||||
#include "alpha_button_on.lbm"
|
||||
};
|
||||
Bitmap ALPHA_BUTTON_ON(BMP_ARGB4444, (const uint16_t*)__alpha_button_on);
|
||||
|
||||
const uint8_t __alpha_button_off[] {
|
||||
#include "alpha_button_off.lbm"
|
||||
};
|
||||
Bitmap ALPHA_BUTTON_OFF(BMP_ARGB4444, (const uint16_t*)__alpha_button_off);
|
||||
|
||||
void drawButton(coord_t x, coord_t y, const char * label, LcdFlags attr)
|
||||
{
|
||||
|
||||
@@ -2201,6 +2201,11 @@ int main()
|
||||
bluetoothInit(BLUETOOTH_DEFAULT_BAUDRATE); //BT is turn on for a brief period to differentiate X7 and X7S
|
||||
#endif
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
loadFonts();
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(GUI) && !defined(PCBTARANIS) && !defined(PCBHORUS)
|
||||
// TODO remove this
|
||||
lcdInit();
|
||||
|
||||
@@ -93,6 +93,7 @@ else()
|
||||
../../../../../targets/common/arm/stm32/sdio_sd.c
|
||||
../../../../../targets/${TARGET_DIR}/haptic_driver.cpp
|
||||
../../../../../gui/${GUI_DIR}/bitmapbuffer.cpp
|
||||
../../../../../gui/${GUI_DIR}/rle.cpp
|
||||
../../../../../syscalls.c
|
||||
)
|
||||
|
||||
|
||||
@@ -103,6 +103,7 @@ set(GUI_SRC
|
||||
${THEMES_SRC}
|
||||
${LAYOUTS_SRC}
|
||||
${WIDGETS_SRC}
|
||||
rle.cpp
|
||||
)
|
||||
if(DISK_CACHE)
|
||||
set(SRC ${SRC} disk_cache.cpp)
|
||||
|
||||
@@ -4,8 +4,15 @@
|
||||
|
||||
#define SELECTED_COLOR (INVERS | TEXT_COLOR)
|
||||
|
||||
const uint8_t __bmp_plug_usb_rle[] {
|
||||
#include "bmp_plug_usb.lbm"
|
||||
};
|
||||
RLEBitmap BMP_PLUG_USB(BMP_RGB565, __bmp_plug_usb_rle);
|
||||
|
||||
const uint8_t __bmp_usb_plugged_rle[] {
|
||||
#include "bmp_usb_plugged.lbm"
|
||||
};
|
||||
RLEBitmap BMP_USB_PLUGGED(BMP_RGB565, __bmp_usb_plugged_rle);
|
||||
|
||||
const uint8_t LBM_FLASH[] = {
|
||||
#include "icon_flash.lbm"
|
||||
@@ -40,6 +47,9 @@ void bootloaderInitScreen()
|
||||
lcdColorTable[BARGRAPH2_COLOR_INDEX] = RGB(73, 219, 62); // green
|
||||
|
||||
backlightEnable(BACKLIGHT_LEVEL_MAX);
|
||||
|
||||
//TODO: load/decompress bitmaps
|
||||
loadFonts();
|
||||
}
|
||||
|
||||
static void bootloaderDrawTitle(unsigned int x, const char* text)
|
||||
|
||||
@@ -82,6 +82,7 @@ bool checkScreenshot_480x272(const QString & test)
|
||||
|
||||
TEST(Lcd_480x272, vline)
|
||||
{
|
||||
loadFonts();
|
||||
lcd->clear(TEXT_BGCOLOR);
|
||||
for (int x=0; x<100; x+=2) {
|
||||
lcdDrawSolidVerticalLine(x, x/2, 12, TEXT_COLOR);
|
||||
@@ -91,6 +92,7 @@ TEST(Lcd_480x272, vline)
|
||||
|
||||
TEST(Lcd_480x272, primitives)
|
||||
{
|
||||
loadFonts();
|
||||
lcd->clear(TEXT_BGCOLOR);
|
||||
lcdDrawText(8, 8, "The quick brown fox jumps over the lazy dog", CURVE_AXIS_COLOR|NO_FONTCACHE);
|
||||
lcdDrawText(5, 5, "The quick brown fox jumps over the lazy dog", TEXT_COLOR|NO_FONTCACHE);
|
||||
@@ -118,6 +120,7 @@ TEST(Lcd_480x272, primitives)
|
||||
|
||||
TEST(Lcd_480x272, transparency)
|
||||
{
|
||||
loadFonts();
|
||||
lcd->clear(TEXT_BGCOLOR);
|
||||
lcdDrawText(8, 8, "The quick brown fox jumps over the lazy dog", TEXT_COLOR|OPACITY(4)|NO_FONTCACHE);
|
||||
lcdDrawText(5, 5, "The quick brown fox jumps over the lazy dog", TEXT_COLOR|OPACITY(12)|NO_FONTCACHE);
|
||||
@@ -154,6 +157,7 @@ TEST(Lcd_480x272, transparency)
|
||||
|
||||
TEST(Lcd_480x272, fonts)
|
||||
{
|
||||
loadFonts();
|
||||
loadFontCache();
|
||||
lcd->clear(TEXT_BGCOLOR);
|
||||
|
||||
@@ -171,4 +175,4 @@ TEST(Lcd_480x272, fonts)
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user