mirror of
https://github.com/86Box/86Box.git
synced 2026-02-22 01:25:33 -07:00
* Use a single QImage copy for actual drawing * Use std::array and std::unique_ptr for image buffers * Signal immediately after copying the buffer to internal image
21 lines
580 B
C++
21 lines
580 B
C++
#include "qt_softwarerenderer.hpp"
|
|
|
|
SoftwareRenderer::SoftwareRenderer(QWidget *parent) : QWidget(parent) {}
|
|
|
|
void SoftwareRenderer::paintEvent(QPaintEvent *event) {
|
|
(void) event;
|
|
onPaint(this);
|
|
}
|
|
|
|
void SoftwareRenderer::onBlit(const std::unique_ptr<uint8_t>* img, int x, int y, int w, int h, std::atomic_flag* in_use) {
|
|
memcpy(image.bits(), img->get(), 2048 * 2048 * 4);
|
|
in_use->clear();
|
|
source.setRect(x, y, w, h);
|
|
update();
|
|
}
|
|
|
|
void SoftwareRenderer::resizeEvent(QResizeEvent *event) {
|
|
onResize(width(), height());
|
|
QWidget::resizeEvent(event);
|
|
}
|