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

[tor-commits] [tor-browser] 235/311: Bug 1760794 - Ensure default clear color gets set after compositor is (re)initialized. r=agi a=dmeehan



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 809d2015ab2c9674022c3dfee480ae5e00cfad33
Author: Jamie Nicol <jnicol@xxxxxxxxxxx>
AuthorDate: Tue Mar 22 21:05:30 2022 +0000

    Bug 1760794 - Ensure default clear color gets set after compositor is (re)initialized. r=agi a=dmeehan
    
    In bug 1756700 we delayed initializing the compositor on android. A
    consequence of this is that when
    LayerViewSupport::SetDefaultClearColor() gets called
    mUiCompositorControllerChild is still null, meaning we skip setting
    the compositor's clear color. As a result, dark-mode fenix users have
    once again started seeing white flashes while waiting for the page to
    load.
    
    Additionally, when the compositor is re-initialized (following a
    fallback to software rendering, or a GPU process restart) we do not
    set the clear color for the new compositor, which again can lead to
    white flashes.
    
    To fix both of these issues, this patch makes us cache the color value
    passed to LayerViewSupport::SetDefaultClearColor(). Then whenever
    LayerViewSupport::NotifyCompositorCreated() is called, we call
    UiCompositorControllerChild::SetDefaultClearColor() to ensure the new
    compositor uses the correct clear color.
    
    Differential Revision: https://phabricator.services.mozilla.com/D141730
---
 widget/android/nsWindow.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/widget/android/nsWindow.cpp b/widget/android/nsWindow.cpp
index 5074bd4728b3f..668d93aa5fb48 100644
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -893,6 +893,8 @@ class LayerViewSupport final
   // Set in NotifyCompositorCreated and cleared in NotifyCompositorSessionLost.
   RefPtr<UiCompositorControllerChild> mUiCompositorControllerChild;
 
+  Maybe<uint32_t> mDefaultClearColor;
+
   struct CaptureRequest {
     explicit CaptureRequest() : mResult(nullptr) {}
     explicit CaptureRequest(java::GeckoResult::GlobalRef aResult,
@@ -1015,6 +1017,10 @@ class LayerViewSupport final
       }
     }
 
+    if (mDefaultClearColor) {
+      mUiCompositorControllerChild->SetDefaultClearColor(*mDefaultClearColor);
+    }
+
     if (!mCompositorPaused) {
       mUiCompositorControllerChild->Resume();
     }
@@ -1332,6 +1338,7 @@ class LayerViewSupport final
 
   void SetDefaultClearColor(int32_t aColor) {
     MOZ_ASSERT(AndroidBridge::IsJavaUiThread());
+    mDefaultClearColor = Some((uint32_t)aColor);
     if (mUiCompositorControllerChild) {
       mUiCompositorControllerChild->SetDefaultClearColor((uint32_t)aColor);
     }

-- 
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