summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_adapter.cpp
diff options
context:
space:
mode:
authorSzabolcs David <davidsz@inf.u-szeged.hu>2018-10-25 16:36:12 +0200
committerSzabolcs David <davidsz@inf.u-szeged.hu>2018-12-10 15:41:34 +0000
commit8124f0bc1893e0997989913044665fa1c5cf79d7 (patch)
tree02449019fafc3c0a49c5804447a7335272d7894b /src/core/web_contents_adapter.cpp
parentb6683549626e5a0131a708842f555dd35d413b50 (diff)
Move printing operation to a new thread
Printing operations were blocking the UI thread, so applications were irresponsive when printing in large size or high resolution. Introduce a new worker for the painting logic and use shared pointers to carry the data around and avoid copying PDF data between threads. Task-number: QTBUG-68561 Change-Id: I30633380b75acd14f1a1df87985c99540168a9f1 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'src/core/web_contents_adapter.cpp')
-rw-r--r--src/core/web_contents_adapter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index 21540f5da..0c29b3525 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -210,10 +210,10 @@ static void callbackOnEvaluateJS(WebContentsAdapterClient *adapterClient, quint6
#if QT_CONFIG(webengine_printing_and_pdf)
static void callbackOnPrintingFinished(WebContentsAdapterClient *adapterClient,
int requestId,
- const std::vector<char>& result)
+ QSharedPointer<QByteArray> result)
{
if (requestId)
- adapterClient->didPrintPage(requestId, QByteArray(result.data(), result.size()));
+ adapterClient->didPrintPage(requestId, result);
}
static void callbackOnPdfSavingFinished(WebContentsAdapterClient *adapterClient,