Added line clipping unit tests & updated libopenui with Liang-Barsky line clipping
This commit is contained in:
@@ -90,6 +90,23 @@ bool checkScreenshot_colorlcd(const BitmapBuffer* dc, const char* test)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(Lcd_colorlcd, lines)
|
||||||
|
{
|
||||||
|
BitmapBuffer dc(BMP_RGB565, LCD_W, LCD_H);
|
||||||
|
dc.clear(DEFAULT_BGCOLOR);
|
||||||
|
dc.setClippingRect(50, 400, 50, 230);
|
||||||
|
|
||||||
|
for (int x = 10; x <= 100; x += 10) {
|
||||||
|
dc.drawLine(x, x, x + 200, x + 50, 0xF0, DEFAULT_COLOR);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int x = 200; x >= 100; x -= 10) {
|
||||||
|
dc.drawLine(x, x, x - 50, x + 100, 0xF0, DEFAULT_COLOR);
|
||||||
|
}
|
||||||
|
|
||||||
|
dc.clearClippingRect();
|
||||||
|
EXPECT_TRUE(checkScreenshot_colorlcd(&dc, "lines"));
|
||||||
|
}
|
||||||
|
|
||||||
TEST(Lcd_colorlcd, vline)
|
TEST(Lcd_colorlcd, vline)
|
||||||
{
|
{
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 4.8 KiB |
Vendored
+1
-1
Submodule radio/src/thirdparty/libopenui updated: 9067eaad59...fdf2891000
Reference in New Issue
Block a user