[app] Explicitly set thread affinity for RenderTask
BooksPageWidget::paint() isn't necessarily called on the main GUI thread.
This commit is contained in:
parent
2646d8ad4f
commit
b31da67dd3
1 changed files with 4 additions and 4 deletions
|
@ -140,8 +140,8 @@ void BooksPageWidget::ResetTask::performTask()
|
||||||
|
|
||||||
class BooksPageWidget::RenderTask : public HarbourTask {
|
class BooksPageWidget::RenderTask : public HarbourTask {
|
||||||
public:
|
public:
|
||||||
RenderTask(QThreadPool* aPool, Data::Ptr aData,
|
RenderTask(QThreadPool* aPool, QThread* aTargetThread, Data::Ptr aData,
|
||||||
int aWidth, int aHeight) : HarbourTask(aPool),
|
int aWidth, int aHeight) : HarbourTask(aPool, aTargetThread),
|
||||||
iData(aData), iWidth(aWidth), iHeight(aHeight) {}
|
iData(aData), iWidth(aWidth), iHeight(aHeight) {}
|
||||||
|
|
||||||
void performTask();
|
void performTask();
|
||||||
|
@ -754,8 +754,8 @@ void BooksPageWidget::scheduleRepaint()
|
||||||
if (w > 0 && h > 0 && !iData.isNull() && !iData->iView.isNull()) {
|
if (w > 0 && h > 0 && !iData.isNull() && !iData->iView.isNull()) {
|
||||||
const shared_ptr<BooksTextView> view(iData->iView);
|
const shared_ptr<BooksTextView> view(iData->iView);
|
||||||
view->setInvertColors(iSettings->invertColors());
|
view->setInvertColors(iSettings->invertColors());
|
||||||
(iRenderTask = new RenderTask(iTaskQueue->pool(), iData, w, h))->
|
(iRenderTask = new RenderTask(iTaskQueue->pool(), thread(),
|
||||||
submit(this, SLOT(onRenderTaskDone()));
|
iData, w, h))->submit(this, SLOT(onRenderTaskDone()));
|
||||||
} else {
|
} else {
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue