Send a block drawn under a clipping region through the per pixel path

This commit is contained in:
J. Nick Koston
2026-10-13 21:55:40 -10:00
parent 33d441d734
commit 906a9b8db3
6 changed files with 14 additions and 10 deletions
+3 -2
View File
@@ -224,12 +224,13 @@ void MipiDsi::draw_pixels_at(int x_start, int y_start, int w, int h, const uint8
if (w <= 0 || h <= 0)
return;
// Copy as is only when the bytes are laid out the way draw_pixel_at() writes them; an RGB
// ordered little endian 888 block is b,g,r in memory. Anything else goes per pixel.
// ordered little endian 888 block is b,g,r in memory. Anything else, or a block drawn under a clipping
// region, goes per pixel.
const bool same_layout = bitness == display::COLOR_BITNESS_565
? big_endian == this->big_endian_
: big_endian == (this->color_mode_ == display::COLOR_ORDER_RGB);
if (bitness != this->color_depth_ || order != display::COLOR_ORDER_RGB || !same_layout ||
this->rotation_ != display::DISPLAY_ROTATION_0_DEGREES) {
this->rotation_ != display::DISPLAY_ROTATION_0_DEGREES || this->is_clipping()) {
display::Display::draw_pixels_at(x_start, y_start, w, h, ptr, order, bitness, big_endian, x_offset, y_offset,
x_pad);
this->mark_dirty_(x_start, y_start, w, h);
+3 -2
View File
@@ -228,9 +228,10 @@ void MipiRgb::draw_pixels_at(int x_start, int y_start, int w, int h, const uint8
display::ColorBitness bitness, bool big_endian, int x_offset, int y_offset, int x_pad) {
if (w <= 0 || h <= 0 || this->is_failed())
return;
// RGB565 in the configured byte order at rotation 0 copies as is; anything else goes per pixel
// RGB565 in the configured byte order at rotation 0 copies as is; anything else, or a block drawn under a
// clipping region, goes per pixel
if (bitness != display::COLOR_BITNESS_565 || order != display::COLOR_ORDER_RGB || big_endian != this->big_endian_ ||
this->rotation_ != display::DISPLAY_ROTATION_0_DEGREES) {
this->rotation_ != display::DISPLAY_ROTATION_0_DEGREES || this->is_clipping()) {
Display::draw_pixels_at(x_start, y_start, w, h, ptr, order, bitness, big_endian, x_offset, y_offset, x_pad);
this->mark_dirty_(x_start, y_start, w, h);
this->flush_now_();
+1 -1
View File
@@ -206,7 +206,7 @@ class MipiSpi : public display::Display,
if (w <= 0 || h <= 0)
return;
if (get_pixel_mode(bitness) != BUFFERPIXEL || big_endian != IS_BIG_ENDIAN || order != display::COLOR_ORDER_RGB ||
(!HAS_HARDWARE_ROTATION && this->rotation_ != display::DISPLAY_ROTATION_0_DEGREES)) {
(!HAS_HARDWARE_ROTATION && this->rotation_ != display::DISPLAY_ROTATION_0_DEGREES) || this->is_clipping()) {
this->draw_pixels_slow(x_start, y_start, w, h, ptr, order, bitness, big_endian, x_offset, y_offset, x_pad);
return;
}
+1 -1
View File
@@ -140,7 +140,7 @@ void QspiDbi::draw_pixels_at(int x_start, int y_start, int w, int h, const uint8
return;
if (bitness != display::COLOR_BITNESS_565 || order != this->color_mode_ ||
big_endian != (this->bit_order_ == spi::BIT_ORDER_MSB_FIRST) ||
this->rotation_ != display::DISPLAY_ROTATION_0_DEGREES) {
this->rotation_ != display::DISPLAY_ROTATION_0_DEGREES || this->is_clipping()) {
Display::draw_pixels_at(x_start, y_start, w, h, ptr, order, bitness, big_endian, x_offset, y_offset, x_pad);
return;
} else if (this->draw_from_origin_) {
@@ -51,9 +51,10 @@ void RpiDpiRgb::draw_pixels_at(int x_start, int y_start, int w, int h, const uin
display::ColorBitness bitness, bool big_endian, int x_offset, int y_offset, int x_pad) {
if (w <= 0 || h <= 0)
return;
// Big endian RGB565 at rotation 0 copies as is; anything else goes per pixel
// Big endian RGB565 at rotation 0 copies as is; anything else, or a block drawn under a clipping region, goes
// per pixel
if (bitness != display::COLOR_BITNESS_565 || order != display::COLOR_ORDER_RGB || !big_endian ||
this->rotation_ != display::DISPLAY_ROTATION_0_DEGREES) {
this->rotation_ != display::DISPLAY_ROTATION_0_DEGREES || this->is_clipping()) {
display::Display::draw_pixels_at(x_start, y_start, w, h, ptr, order, bitness, big_endian, x_offset, y_offset,
x_pad);
return;
+3 -2
View File
@@ -54,9 +54,10 @@ void ST7701S::draw_pixels_at(int x_start, int y_start, int w, int h, const uint8
display::ColorBitness bitness, bool big_endian, int x_offset, int y_offset, int x_pad) {
if (w <= 0 || h <= 0)
return;
// Big endian RGB565 at rotation 0 copies as is; anything else goes per pixel
// Big endian RGB565 at rotation 0 copies as is; anything else, or a block drawn under a clipping region, goes
// per pixel
if (bitness != display::COLOR_BITNESS_565 || order != display::COLOR_ORDER_RGB || !big_endian ||
this->rotation_ != display::DISPLAY_ROTATION_0_DEGREES) {
this->rotation_ != display::DISPLAY_ROTATION_0_DEGREES || this->is_clipping()) {
display::Display::draw_pixels_at(x_start, y_start, w, h, ptr, order, bitness, big_endian, x_offset, y_offset,
x_pad);
return;