qt: Add overload protection to renderers

Added atomic_flags for renderer buffers to prevent concurrent usage and
overloading the renderer with draw requests when it's busy.
This commit is contained in:
ts-korhonen
2021-12-15 00:37:48 +02:00
parent 6a88e48680
commit 7c2cd35965
6 changed files with 23 additions and 9 deletions

View File

@@ -7,10 +7,11 @@ void SoftwareRenderer::paintEvent(QPaintEvent *event) {
onPaint(this);
}
void SoftwareRenderer::onBlit(const QImage& img, int x, int y, int w, int h) {
void SoftwareRenderer::onBlit(const QImage& img, int x, int y, int w, int h, std::atomic_flag* in_use) {
image = img;
source.setRect(x, y, w, h);
update();
in_use->clear();
}
void SoftwareRenderer::resizeEvent(QResizeEvent *event) {