Execution policy (multithreading)

This commit is contained in:
Jakub Melka
2020-01-18 14:55:26 +01:00
parent db493db3cc
commit 1fd01c14fd
14 changed files with 266 additions and 34 deletions

View File

@ -19,6 +19,7 @@
#include "pdfcms.h"
#include "pdfdrawspacecontroller.h"
#include "pdfprogress.h"
#include "pdfexecutionpolicy.h"
#include <QtConcurrent/QtConcurrent>
@ -411,7 +412,7 @@ void PDFAsynchronousTextLayoutCompiler::makeTextLayout()
};
auto pageRange = PDFIntegerRange<PDFInteger>(0, catalog->getPageCount());
std::for_each(std::execution::parallel_policy(), pageRange.begin(), pageRange.end(), generateTextLayout);
PDFExecutionPolicy::execute(PDFExecutionPolicy::Scope::Page, pageRange.begin(), pageRange.end(), generateTextLayout);
return result;
};