summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2020-03-04 14:56:36 +0100
committerPeter Varga <pvarga@inf.u-szeged.hu>2020-03-10 01:27:57 +0100
commit62e55be6b8a23003ca877d917e5ef0cd3ff4110f (patch)
treefb276df68bcb797104976acffc2bbd3fb33fd932 /src
parent04da0b14840f12ebd98e85c4ef4d42063610e375 (diff)
Fix applying background color on RenderView
The RenderViewObserverQt_SetBackgroundColor message was sent with wrong Routing ID. This fix also cleans up RenderWidgetHostViewQt::UpdateBackgroundColor() method. Fixes: QTBUG-81781 Change-Id: Ida198fb061715d389859ace17e1f773db491c51d Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/core/common/qt_messages.h6
-rw-r--r--src/core/render_widget_host_view_qt.cpp18
2 files changed, 11 insertions, 13 deletions
diff --git a/src/core/common/qt_messages.h b/src/core/common/qt_messages.h
index b99204b74..43f07c9a6 100644
--- a/src/core/common/qt_messages.h
+++ b/src/core/common/qt_messages.h
@@ -36,6 +36,9 @@ IPC_MESSAGE_ROUTED1(RenderViewObserverQt_FetchDocumentMarkup,
IPC_MESSAGE_ROUTED1(RenderViewObserverQt_FetchDocumentInnerText,
uint64_t /* requestId */)
+IPC_MESSAGE_ROUTED1(RenderViewObserverQt_SetBackgroundColor,
+ uint32_t /* color */)
+
// User scripts messages
IPC_MESSAGE_ROUTED1(RenderFrameObserverHelper_AddScript,
UserScriptData /* script */)
@@ -65,9 +68,6 @@ IPC_MESSAGE_ROUTED2(RenderViewObserverHostQt_DidFetchDocumentInnerText,
uint64_t /* requestId */,
base::string16 /* innerText */)
-IPC_MESSAGE_ROUTED1(RenderViewObserverQt_SetBackgroundColor,
- uint32_t /* color */)
-
IPC_MESSAGE_ROUTED0(RenderViewObserverHostQt_DidFirstVisuallyNonEmptyLayout)
//-----------------------------------------------------------------------------
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index e9be587cf..7a5118837 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -48,6 +48,7 @@
#include "touch_selection_controller_client_qt.h"
#include "touch_selection_menu_controller.h"
#include "type_conversion.h"
+#include "web_contents_adapter.h"
#include "web_contents_adapter_client.h"
#include "web_event_factory.h"
@@ -488,23 +489,20 @@ gfx::Rect RenderWidgetHostViewQt::GetViewBounds()
void RenderWidgetHostViewQt::UpdateBackgroundColor()
{
+ DCHECK(GetBackgroundColor());
+ SkColor color = *GetBackgroundColor();
+
+ m_delegate->setClearColor(toQt(color));
+
if (m_enableViz) {
- DCHECK(GetBackgroundColor());
- SkColor color = *GetBackgroundColor();
bool opaque = SkColorGetA(color) == SK_AlphaOPAQUE;
m_rootLayer->SetFillsBoundsOpaquely(opaque);
m_rootLayer->SetColor(color);
m_uiCompositor->SetBackgroundColor(color);
- m_delegate->setClearColor(toQt(color));
- host()->Send(new RenderViewObserverQt_SetBackgroundColor(host()->GetRoutingID(), color));
- return;
}
- auto color = GetBackgroundColor();
- if (color) {
- m_delegate->setClearColor(toQt(*color));
- host()->Send(new RenderViewObserverQt_SetBackgroundColor(host()->GetRoutingID(), *color));
- }
+ content::RenderViewHost *rvh = content::RenderViewHost::From(host());
+ host()->Send(new RenderViewObserverQt_SetBackgroundColor(rvh->GetRoutingID(), color));
}
// Return value indicates whether the mouse is locked successfully or not.