[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser] 16/311: Bug 1749745 - Initialize AndroidCompositorWidget with initial size. r=aosmond, agi a=RyanVM, dsmith



This is an automated email from the git hooks/post-receive script.

pierov pushed a commit to branch geckoview-99.0.1-11.0-1
in repository tor-browser.

commit d2f7af809f5f9e9724de682537870511c8e7fa98
Author: Jamie Nicol <jnicol@xxxxxxxxxxx>
AuthorDate: Wed Jan 12 16:43:51 2022 +0000

    Bug 1749745 - Initialize AndroidCompositorWidget with initial size. r=aosmond,agi a=RyanVM,dsmith
    
    Since bug 1747116 landed, if the compositor is reinitialized whilst
    the Android Surface is invalid, we avoid crashing when querying the
    window size and instead keep the compositor in a paused state.
    However, in this case we will believe the widget size is 0x0 until the
    compositor is eventually resumed. If webrender receives a display list
    during this time, it will set an empty view rect. This means when the
    compositor is subsequently resumed webrender believes it has nothing
    to render, and we get stuck in a state where nothing is ever rendered
    to the screen.
    
    This patch initializes the AndroidCompositorWidget with an initial
    size, which avoids the problem.
    
    Differential Revision: https://phabricator.services.mozilla.com/D135711
---
 widget/android/AndroidCompositorWidget.cpp | 2 +-
 widget/android/PlatformWidgetTypes.ipdlh   | 1 +
 widget/android/nsWindow.cpp                | 3 ++-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/widget/android/AndroidCompositorWidget.cpp b/widget/android/AndroidCompositorWidget.cpp
index 217063637f0d9..24d315a4e345c 100644
--- a/widget/android/AndroidCompositorWidget.cpp
+++ b/widget/android/AndroidCompositorWidget.cpp
@@ -20,7 +20,7 @@ AndroidCompositorWidget::AndroidCompositorWidget(
       mWidgetId(aInitData.widgetId()),
       mNativeWindow(nullptr),
       mFormat(WINDOW_FORMAT_RGBA_8888),
-      mClientSize(0, 0) {}
+      mClientSize(aInitData.clientSize()) {}
 
 AndroidCompositorWidget::~AndroidCompositorWidget() {
   if (mNativeWindow) {
diff --git a/widget/android/PlatformWidgetTypes.ipdlh b/widget/android/PlatformWidgetTypes.ipdlh
index c28d14ce3b21c..cc48651479a04 100644
--- a/widget/android/PlatformWidgetTypes.ipdlh
+++ b/widget/android/PlatformWidgetTypes.ipdlh
@@ -14,6 +14,7 @@ namespace widget {
 struct AndroidCompositorWidgetInitData
 {
   int32_t widgetId;
+  LayoutDeviceIntSize clientSize;
 };
 
 union CompositorWidgetInitData
diff --git a/widget/android/nsWindow.cpp b/widget/android/nsWindow.cpp
index 42b30a62e9cf3..98733ff76a6f4 100644
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -2585,7 +2585,8 @@ void nsWindow::SetCompositorWidgetDelegate(CompositorWidgetDelegate* delegate) {
 
 void nsWindow::GetCompositorWidgetInitData(
     mozilla::widget::CompositorWidgetInitData* aInitData) {
-  *aInitData = mozilla::widget::AndroidCompositorWidgetInitData(mWidgetId);
+  *aInitData = mozilla::widget::AndroidCompositorWidgetInitData(
+      mWidgetId, GetClientSize());
 }
 
 bool nsWindow::WidgetPaintsBackground() {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits