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:
@@ -1,5 +1,6 @@
|
||||
#include "qt_hardwarerenderer.hpp"
|
||||
#include <QApplication>
|
||||
#include <atomic>
|
||||
|
||||
extern "C" {
|
||||
#include <86box/86box.h>
|
||||
@@ -34,10 +35,11 @@ void HardwareRenderer::setRenderType(RenderType type) {
|
||||
setFormat(format);
|
||||
}
|
||||
|
||||
void HardwareRenderer::onBlit(const QImage& img, int x, int y, int w, int h) {
|
||||
void HardwareRenderer::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 HardwareRenderer::resizeEvent(QResizeEvent *event) {
|
||||
|
||||
Reference in New Issue
Block a user