From 7947dcea76fec80613d045ab8204a70ecbe43feb Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Tue, 9 Apr 2019 12:31:40 +0200
Subject: [PATCH] Set correct priorities on tasks and threads
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Change-Id: I1dc8b466d0b45f9e1d6c973f1ad3c62033bf4409
Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
---
 src/core/compositor/compositor.cpp                  | 2 +-
 src/core/compositor/compositor_resource_tracker.cpp | 2 +-
 src/core/web_engine_context_threads.cpp             | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/core/compositor/compositor.cpp b/src/core/compositor/compositor.cpp
index cc45db9e7..56693961c 100644
--- a/src/core/compositor/compositor.cpp
+++ b/src/core/compositor/compositor.cpp
@@ -56,7 +56,7 @@ Compositor::Compositor(content::RenderWidgetHost *host)
 {
     DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
 
-    m_taskRunner = base::CreateSingleThreadTaskRunnerWithTraits({content::BrowserThread::UI});
+    m_taskRunner = base::CreateSingleThreadTaskRunnerWithTraits({content::BrowserThread::UI, base::TaskPriority::USER_VISIBLE});
     m_beginFrameSource =
         std::make_unique<viz::DelayBasedBeginFrameSource>(
             std::make_unique<viz::DelayBasedTimeSource>(m_taskRunner.get()),
diff --git a/src/core/compositor/compositor_resource_tracker.cpp b/src/core/compositor/compositor_resource_tracker.cpp
index 6530f3249..ba874053e 100644
--- a/src/core/compositor/compositor_resource_tracker.cpp
+++ b/src/core/compositor/compositor_resource_tracker.cpp
@@ -244,7 +244,7 @@ void CompositorResourceTracker::updateMailboxes(std::vector<CompositorResource *
 void CompositorResourceTracker::scheduleRunSubmitCallback()
 {
     base::PostTaskWithTraits(
-        FROM_HERE, { content::BrowserThread::UI },
+        FROM_HERE, { content::BrowserThread::UI, base::TaskPriority::USER_VISIBLE },
         base::BindOnce(&CompositorResourceTracker::runSubmitCallback,
                        m_weakPtrFactory.GetWeakPtr()));
 }
diff --git a/src/core/web_engine_context_threads.cpp b/src/core/web_engine_context_threads.cpp
index 75f8bd470..e92cf3e9b 100644
--- a/src/core/web_engine_context_threads.cpp
+++ b/src/core/web_engine_context_threads.cpp
@@ -82,7 +82,7 @@ struct GpuThreadControllerQt : content::GpuThreadController
         if (s_gpuProcessDestroyed)
             return;
 
-        s_gpuProcess = std::make_unique<content::GpuProcess>(base::ThreadPriority::NORMAL);
+        s_gpuProcess = std::make_unique<content::GpuProcess>(base::ThreadPriority::DISPLAY);
         auto gpuInit = std::make_unique<gpu::GpuInit>();
         gpuInit->InitializeInProcess(base::CommandLine::ForCurrentProcess(), gpuPreferences);
         auto childThread = new content::GpuChildThread(params, std::move(gpuInit));
-- 
GitLab