mirror of
https://github.com/esphome/esphome.git
synced 2026-10-14 10:12:52 +00:00
Send a block drawn under a clipping region through the per pixel path
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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_();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user