couple of simplifications
* in paint: we can draw the m_image directly, no need to convert it * in blit: static auto imagebits = m_image.bits(); should not be static * in blit: we can bulk copy the entire image, no need to iterate horizontal lines
This commit is contained in:
@@ -67,7 +67,7 @@ void GLESWidget::paintGL()
|
|||||||
{
|
{
|
||||||
std::scoped_lock lock(image_mx);
|
std::scoped_lock lock(image_mx);
|
||||||
QPainter painter(this);
|
QPainter painter(this);
|
||||||
painter.drawImage(QRect(0, 0, width(), height()), m_image.convertToFormat(QImage::Format_RGBX8888), QRect(sx, sy, sw, sh));
|
painter.drawImage(QRect(0, 0, width(), height()), m_image, QRect(sx, sy, sw, sh));
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLESWidget::mouseReleaseEvent(QMouseEvent *event)
|
void GLESWidget::mouseReleaseEvent(QMouseEvent *event)
|
||||||
@@ -141,12 +141,9 @@ void GLESWidget::qt_real_blit(int x, int y, int w, int h)
|
|||||||
sy = y;
|
sy = y;
|
||||||
sw = this->w = w;
|
sw = this->w = w;
|
||||||
sh = this->h = h;
|
sh = this->h = h;
|
||||||
static auto imagebits = m_image.bits();
|
auto imagebits = m_image.bits();
|
||||||
for (int y1 = y; y1 < (y + h - 1); y1++)
|
video_copy(imagebits + y * ((2048 + 64) * 4) + x * 4, &(buffer32->line[y][x]), h * (2048 + 64) * sizeof(uint32_t));
|
||||||
{
|
|
||||||
auto scanline = imagebits + (y1 * (2048 + 64) * 4);
|
|
||||||
video_copy(scanline + (x * 4), &(buffer32->line[y1][x]), w * 4);
|
|
||||||
}
|
|
||||||
if (screenshots)
|
if (screenshots)
|
||||||
{
|
{
|
||||||
video_screenshot((uint32_t *)imagebits, 0, 0, 2048 + 64);
|
video_screenshot((uint32_t *)imagebits, 0, 0, 2048 + 64);
|
||||||
|
Reference in New Issue
Block a user