diff --git a/esphome/components/mipi_dsi/mipi_dsi.cpp b/esphome/components/mipi_dsi/mipi_dsi.cpp index c801e731282..9fddc62a2e7 100644 --- a/esphome/components/mipi_dsi/mipi_dsi.cpp +++ b/esphome/components/mipi_dsi/mipi_dsi.cpp @@ -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); diff --git a/esphome/components/mipi_rgb/mipi_rgb.cpp b/esphome/components/mipi_rgb/mipi_rgb.cpp index cadce5e0951..8b0a938932b 100644 --- a/esphome/components/mipi_rgb/mipi_rgb.cpp +++ b/esphome/components/mipi_rgb/mipi_rgb.cpp @@ -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_(); diff --git a/esphome/components/mipi_spi/mipi_spi.h b/esphome/components/mipi_spi/mipi_spi.h index e16c9e973b7..3122cffb2f0 100644 --- a/esphome/components/mipi_spi/mipi_spi.h +++ b/esphome/components/mipi_spi/mipi_spi.h @@ -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; } diff --git a/esphome/components/qspi_dbi/qspi_dbi.cpp b/esphome/components/qspi_dbi/qspi_dbi.cpp index d8ea3e431b7..8f0d7cd17ad 100644 --- a/esphome/components/qspi_dbi/qspi_dbi.cpp +++ b/esphome/components/qspi_dbi/qspi_dbi.cpp @@ -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_) { diff --git a/esphome/components/rpi_dpi_rgb/rpi_dpi_rgb.cpp b/esphome/components/rpi_dpi_rgb/rpi_dpi_rgb.cpp index 4007d855601..c38d54516be 100644 --- a/esphome/components/rpi_dpi_rgb/rpi_dpi_rgb.cpp +++ b/esphome/components/rpi_dpi_rgb/rpi_dpi_rgb.cpp @@ -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; diff --git a/esphome/components/st7701s/st7701s.cpp b/esphome/components/st7701s/st7701s.cpp index 38212f0e133..1009f36940e 100644 --- a/esphome/components/st7701s/st7701s.cpp +++ b/esphome/components/st7701s/st7701s.cpp @@ -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;