hc
2023-11-07 f45e756958099c35d6afb746df1d40a1c6302cfc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
From 9da3b9e3faad471278f4d42c17a69ce2ca9e6b03 Mon Sep 17 00:00:00 2001
From: Takuro Ashie <ashie@clear-code.com>
Date: Sun, 17 Feb 2019 16:36:53 +0900
Subject: [PATCH] Enable to suppress multiple compositors
 
Because embedded devices might not support multiple EGL windows.
 
Upstream-Status: Inappropriate [embedded specific]
 
Signed-off-by: Takuro Ashie <ashie@clear-code.com>
---
 widget/nsBaseWidget.cpp | 7 +++++++
 1 file changed, 7 insertions(+)
 
diff --git a/widget/nsBaseWidget.cpp b/widget/nsBaseWidget.cpp
index 00411c736dd3..6f9ff218b8b7 100644
--- a/widget/nsBaseWidget.cpp
+++ b/widget/nsBaseWidget.cpp
@@ -131,6 +131,8 @@ int32_t nsIWidget::sPointerIdCounter = 0;
 // milliseconds.
 const uint32_t kAsyncDragDropTimeout = 1000;
 
+static nsBaseWidget *sSingleCompositorWidget = nullptr;
+
 namespace mozilla {
 namespace widget {
 
@@ -278,6 +280,9 @@ void nsBaseWidget::DestroyCompositor() {
     RefPtr<CompositorSession> session = mCompositorSession.forget();
     session->Shutdown();
   }
+
+  if (sSingleCompositorWidget == this)
+    sSingleCompositorWidget = nullptr;
 }
 
 // This prevents the layer manager from starting a new transaction during
@@ -1335,6 +1340,8 @@ void nsBaseWidget::CreateCompositor(int aWidth, int aHeight) {
     gfxPlatform::GetPlatform()->NotifyCompositorCreated(
         mLayerManager->GetCompositorBackendType());
   }
+
+  sSingleCompositorWidget = this;
 }
 
 void nsBaseWidget::NotifyCompositorSessionLost(CompositorSession* aSession) {
-- 
2.17.1