summaryrefslogtreecommitdiff
path: root/mozilla-1579823.patch
blob: 9e00d4f9eb803502f9f8b81fb547642104aefda6 (plain)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
diff -up firefox-69.0/widget/gtk/WindowSurfaceWayland.cpp.mozilla-1579823 firefox-69.0/widget/gtk/WindowSurfaceWayland.cpp
--- firefox-69.0/widget/gtk/WindowSurfaceWayland.cpp.mozilla-1579823	2019-09-12 07:53:06.119602913 +0200
+++ firefox-69.0/widget/gtk/WindowSurfaceWayland.cpp	2019-09-12 07:54:47.410105270 +0200
@@ -326,13 +326,13 @@ void WindowBackBufferShm::Create(int aWi
   mHeight = aHeight;
 
   LOGWAYLAND((
-      "%s [%p] wl_buffer %p ID %d\n", __PRETTY_FUNCTION__, (void*)this,
+      "WindowBackBufferShm::Create [%p] wl_buffer %p ID %d\n", (void*)this,
       (void*)mWaylandBuffer,
       mWaylandBuffer ? wl_proxy_get_id((struct wl_proxy*)mWaylandBuffer) : -1));
 }
 
 void WindowBackBufferShm::Release() {
-  LOGWAYLAND(("%s [%p]\n", __PRETTY_FUNCTION__, (void*)this));
+  LOGWAYLAND(("WindowBackBufferShm::Release [%p]\n", (void*)this));
 
   wl_buffer_destroy(mWaylandBuffer);
   mWidth = mHeight = 0;
@@ -358,8 +358,8 @@ WindowBackBufferShm::~WindowBackBufferSh
 bool WindowBackBufferShm::Resize(int aWidth, int aHeight) {
   if (aWidth == mWidth && aHeight == mHeight) return true;
 
-  LOGWAYLAND(
-      ("%s [%p] %d %d\n", __PRETTY_FUNCTION__, (void*)this, aWidth, aHeight));
+  LOGWAYLAND(("WindowBackBufferShm::Resize [%p] %d %d\n", (void*)this, aWidth,
+              aHeight));
 
   Release();
   Create(aWidth, aHeight);
@@ -369,7 +369,7 @@ bool WindowBackBufferShm::Resize(int aWi
 
 void WindowBackBuffer::Attach(wl_surface* aSurface) {
   LOGWAYLAND(
-      ("%s [%p] wl_surface %p ID %d wl_buffer %p ID %d\n", __PRETTY_FUNCTION__,
+      ("WindowBackBuffer::Attach [%p] wl_surface %p ID %d wl_buffer %p ID %d\n",
        (void*)this, (void*)aSurface,
        aSurface ? wl_proxy_get_id((struct wl_proxy*)aSurface) : -1,
        (void*)GetWlBuffer(),
@@ -382,8 +382,8 @@ void WindowBackBuffer::Attach(wl_surface
 }
 
 void WindowBackBufferShm::Detach(wl_buffer* aBuffer) {
-  LOGWAYLAND(("%s [%p] wl_buffer %p ID %d\n", __PRETTY_FUNCTION__, (void*)this,
-              (void*)aBuffer,
+  LOGWAYLAND(("WindowBackBufferShm::Detach [%p] wl_buffer %p ID %d\n",
+              (void*)this, (void*)aBuffer,
               aBuffer ? wl_proxy_get_id((struct wl_proxy*)aBuffer) : -1));
 
   mAttached = false;
@@ -404,7 +404,7 @@ bool WindowBackBufferShm::SetImageDataFr
 
 already_AddRefed<gfx::DrawTarget> WindowBackBufferShm::Lock() {
   LOGWAYLAND((
-      "%s [%p] [%d x %d] wl_buffer %p ID %d\n", __PRETTY_FUNCTION__,
+      "WindowBackBufferShm::Lock [%p] [%d x %d] wl_buffer %p ID %d\n",
       (void*)this, mWidth, mHeight, (void*)mWaylandBuffer,
       mWaylandBuffer ? wl_proxy_get_id((struct wl_proxy*)mWaylandBuffer) : -1));
 
@@ -419,16 +419,17 @@ WindowBackBufferDMABuf::WindowBackBuffer
     nsWaylandDisplay* aWaylandDisplay, int aWidth, int aHeight)
     : WindowBackBuffer(aWaylandDisplay) {
   mDMAbufSurface.Create(aWidth, aHeight);
-
-  LOGWAYLAND(("%s [%p] Created DMABuf buffer [%d x %d]\n", __PRETTY_FUNCTION__,
-              (void*)this, aWidth, aHeight));
+  LOGWAYLAND(
+      ("WindowBackBufferDMABuf::WindowBackBufferDMABuf [%p] Created DMABuf "
+       "buffer [%d x %d]\n",
+       (void*)this, aWidth, aHeight));
 }
 
 WindowBackBufferDMABuf::~WindowBackBufferDMABuf() { mDMAbufSurface.Release(); }
 
 already_AddRefed<gfx::DrawTarget> WindowBackBufferDMABuf::Lock() {
   LOGWAYLAND(
-      ("%s [%p] [%d x %d] wl_buffer %p ID %d\n", __PRETTY_FUNCTION__,
+      ("WindowBackBufferDMABuf::Lock [%p] [%d x %d] wl_buffer %p ID %d\n",
        (void*)this, GetWidth(), GetHeight(), (void*)GetWlBuffer(),
        GetWlBuffer() ? wl_proxy_get_id((struct wl_proxy*)GetWlBuffer()) : -1));
 
@@ -534,7 +535,8 @@ WindowSurfaceWayland::~WindowSurfaceWayl
 bool WindowSurfaceWayland::UseDMABufBackend() {
   if (!mUseDMABufInitialized) {
     mUseDMABuf = nsWaylandDisplay::IsDMABufEnabled();
-    LOGWAYLAND(("%s DMABuf state %d\n", __PRETTY_FUNCTION__, mUseDMABuf));
+    LOGWAYLAND(("WindowSurfaceWayland::UseDMABufBackend DMABuf state %d\n",
+                mUseDMABuf));
     mUseDMABufInitialized = true;
   }
   return mUseDMABuf;
@@ -567,15 +569,16 @@ WindowBackBuffer* WindowSurfaceWayland::
 
 WindowBackBuffer* WindowSurfaceWayland::GetWaylandBufferToDraw(
     bool aCanSwitchBuffer) {
-  LOGWAYLAND(("%s [%p] Requested buffer [%d x %d]\n", __PRETTY_FUNCTION__,
-              (void*)this, mBufferScreenRect.width, mBufferScreenRect.height));
+  LOGWAYLAND(
+      ("WindowSurfaceWayland::GetWaylandBufferToDraw [%p] Requested buffer [%d "
+       "x %d]\n",
+       (void*)this, mBufferScreenRect.width, mBufferScreenRect.height));
 
   // There's no buffer created yet, create a new one.
   if (!mWaylandBuffer) {
     MOZ_ASSERT(aCanSwitchBuffer && mWholeWindowBufferDamage,
                "Created new buffer for partial drawing!");
-    LOGWAYLAND(("%s [%p] Created new buffer [%d x %d]\n", __PRETTY_FUNCTION__,
-                (void*)this, mBufferScreenRect.width,
+    LOGWAYLAND(("    Created new buffer [%d x %d]\n", mBufferScreenRect.width,
                 mBufferScreenRect.height));
 
     mWaylandBuffer =
@@ -586,21 +589,19 @@ WindowBackBuffer* WindowSurfaceWayland::
 
 #ifdef DEBUG
   if (mWaylandBuffer->IsAttached()) {
-    LOGWAYLAND(("%s [%p] Buffer %p is attached, need to find a new one.\n",
-                __PRETTY_FUNCTION__, (void*)this, mWaylandBuffer));
+    LOGWAYLAND(("    Buffer %p is attached, need to find a new one.\n",
+                mWaylandBuffer));
   }
 #endif
 
   // Reuse existing buffer
   if (!mWaylandBuffer->IsAttached()) {
-    LOGWAYLAND(
-        ("%s [%p] Use recent buffer.\n", __PRETTY_FUNCTION__, (void*)this));
+    LOGWAYLAND(("    Use recent buffer.\n"));
 
     if (mWaylandBuffer->IsMatchingSize(mBufferScreenRect.width,
                                        mBufferScreenRect.height)) {
-      LOGWAYLAND(("%s [%p] Size is ok, use the buffer [%d x %d]\n",
-                  __PRETTY_FUNCTION__, (void*)this, mBufferScreenRect.width,
-                  mBufferScreenRect.height));
+      LOGWAYLAND(("    Size is ok, use the buffer [%d x %d]\n",
+                  mBufferScreenRect.width, mBufferScreenRect.height));
       return mWaylandBuffer;
     }
 
@@ -609,9 +610,8 @@ WindowBackBuffer* WindowSurfaceWayland::
       return nullptr;
     }
 
-    LOGWAYLAND(("%s [%p] Reuse buffer with resize [%d x %d]\n",
-                __PRETTY_FUNCTION__, (void*)this, mBufferScreenRect.width,
-                mBufferScreenRect.height));
+    LOGWAYLAND(("    Reuse buffer with resize [%d x %d]\n",
+                mBufferScreenRect.width, mBufferScreenRect.height));
 
     mWaylandBuffer->Resize(mBufferScreenRect.width, mBufferScreenRect.height);
     // There's a chance that scale factor has been changed
@@ -629,8 +629,7 @@ WindowBackBuffer* WindowSurfaceWayland::
   for (availableBuffer = 0; availableBuffer < BACK_BUFFER_NUM;
        availableBuffer++) {
     if (!mBackupBuffer[availableBuffer]) {
-      LOGWAYLAND(("%s [%p] Created new buffer [%d x %d]\n", __PRETTY_FUNCTION__,
-                  (void*)this, mBufferScreenRect.width,
+      LOGWAYLAND(("    Created new buffer [%d x %d]\n", mBufferScreenRect.width,
                   mBufferScreenRect.height));
       mBackupBuffer[availableBuffer] = CreateWaylandBuffer(
           mBufferScreenRect.width, mBufferScreenRect.height);
@@ -643,8 +642,7 @@ WindowBackBuffer* WindowSurfaceWayland::
   }
 
   if (MOZ_UNLIKELY(availableBuffer == BACK_BUFFER_NUM)) {
-    LOGWAYLAND(("%s [%p] No drawing buffer available!\n", __PRETTY_FUNCTION__,
-                (void*)this));
+    LOGWAYLAND(("    No drawing buffer available!\n"));
     NS_WARNING("No drawing buffer available");
     return nullptr;
   }
@@ -653,17 +651,15 @@ WindowBackBuffer* WindowSurfaceWayland::
   mWaylandBuffer = mBackupBuffer[availableBuffer];
   mBackupBuffer[availableBuffer] = lastWaylandBuffer;
 
-  LOGWAYLAND(("%s [%p] Buffer flip new back %p new front %p \n",
-              __PRETTY_FUNCTION__, (void*)this, (void*)lastWaylandBuffer,
-              (void*)mWaylandBuffer));
+  LOGWAYLAND(("    Buffer flip new back %p new front %p \n",
+              (void*)lastWaylandBuffer, (void*)mWaylandBuffer));
 
   mNeedScaleFactorUpdate = true;
 
   bool bufferNeedsResize = !mWaylandBuffer->IsMatchingSize(
       mBufferScreenRect.width, mBufferScreenRect.height);
   if (bufferNeedsResize) {
-    LOGWAYLAND(("%s [%p] Resize buffer to [%d x %d]\n", __PRETTY_FUNCTION__,
-                (void*)this, mBufferScreenRect.width,
+    LOGWAYLAND(("    Resize buffer to [%d x %d]\n", mBufferScreenRect.width,
                 mBufferScreenRect.height));
     mWaylandBuffer->Resize(mBufferScreenRect.width, mBufferScreenRect.height);
   }
@@ -675,8 +671,8 @@ already_AddRefed<gfx::DrawTarget> Window
     bool aCanSwitchBuffer) {
   WindowBackBuffer* buffer = GetWaylandBufferToDraw(aCanSwitchBuffer);
 
-  LOGWAYLAND(("%s [%p] Got buffer %p\n", __PRETTY_FUNCTION__, (void*)this,
-              (void*)buffer));
+  LOGWAYLAND(("WindowSurfaceWayland::LockWaylandBuffer [%p] Got buffer %p\n",
+              (void*)this, (void*)buffer));
 
   if (!buffer) {
     return nullptr;
@@ -691,7 +687,7 @@ already_AddRefed<gfx::DrawTarget> Window
 }
 
 void WindowSurfaceWayland::UnlockWaylandBuffer() {
-  LOGWAYLAND(("%s [%p]\n", __PRETTY_FUNCTION__, (void*)this));
+  LOGWAYLAND(("WindowSurfaceWayland::UnlockWaylandBuffer [%p]\n", (void*)this));
   mWaylandBuffer->Unlock();
 }
 
@@ -774,9 +770,11 @@ already_AddRefed<gfx::DrawTarget> Window
         mWindow->WaylandSurfaceNeedsClear() || isTransparentPopup;
   }
 
-  LOGWAYLAND(("%s [%p] lockSize [%d x %d] windowSize [%d x %d]\n",
-              __PRETTY_FUNCTION__, (void*)this, lockSize.width, lockSize.height,
-              lockedScreenRect.width, lockedScreenRect.height));
+  LOGWAYLAND(
+      ("WindowSurfaceWayland::Lock [%p] lockSize [%d x %d] windowSize [%d x "
+       "%d]\n",
+       (void*)this, lockSize.width, lockSize.height, lockedScreenRect.width,
+       lockedScreenRect.height));
   LOGWAYLAND(("   nsWindow = %p\n", mWindow));
   LOGWAYLAND(("   isPopup = %d\n", mWindow->IsWaylandPopup()));
   LOGWAYLAND(("   isTransparentPopup = %d\n", isTransparentPopup));
@@ -892,8 +890,10 @@ bool WindowSurfaceWayland::CommitImageSu
   MOZ_ASSERT(!rect.IsEmpty(), "Empty drawing?");
 #endif
 
-  LOGWAYLAND(("%s [%p] screenSize [%d x %d]\n", __PRETTY_FUNCTION__,
-              (void*)this, mBufferScreenRect.width, mBufferScreenRect.height));
+  LOGWAYLAND(
+      ("WindowSurfaceWayland::CommitImageSurfaceToWaylandBuffer [%p] "
+       "screenSize [%d x %d]\n",
+       (void*)this, mBufferScreenRect.width, mBufferScreenRect.height));
 
   mDelayedImageCommits.AppendElement(
       WindowImageSurface(mImageSurface, aRegion));
@@ -930,7 +930,7 @@ static void WaylandBufferDelayCommitHand
 void WindowSurfaceWayland::CommitWaylandBuffer() {
   MOZ_ASSERT(mPendingCommit, "Committing empty surface!");
 
-  LOGWAYLAND(("%s [%p]\n", __PRETTY_FUNCTION__, (void*)this));
+  LOGWAYLAND(("WindowSurfaceWayland::CommitWaylandBuffer [%p]\n", (void*)this));
   LOGWAYLAND(
       ("   mDrawToWaylandBufferDirectly = %d\n", mDrawToWaylandBufferDirectly));
   LOGWAYLAND(("   mWholeWindowBufferDamage = %d\n", mWholeWindowBufferDamage));
@@ -940,8 +940,8 @@ void WindowSurfaceWayland::CommitWayland
 
   wl_surface* waylandSurface = mWindow->GetWaylandSurface();
   if (!waylandSurface) {
-    LOGWAYLAND(("%s [%p] mWindow->GetWaylandSurface() failed, delay commit.\n",
-                __PRETTY_FUNCTION__, (void*)this));
+    LOGWAYLAND(("    [%p] mWindow->GetWaylandSurface() failed, delay commit.\n",
+                (void*)this));
 
     // Target window is not created yet - delay the commit. This can happen only
     // when the window is newly created and there's no active
@@ -969,8 +969,7 @@ void WindowSurfaceWayland::CommitWayland
   // We have an active frame callback request so handle it.
   if (mFrameCallback) {
     if (waylandSurface == mLastCommittedSurface) {
-      LOGWAYLAND(("%s [%p] wait for frame callback.\n", __PRETTY_FUNCTION__,
-                  (void*)this));
+      LOGWAYLAND(("    [%p] wait for frame callback.\n", (void*)this));
       // We have an active frame callback pending from our recent surface.
       // It means we should defer the commit to FrameCallbackHandler().
       return;
@@ -1022,10 +1021,11 @@ void WindowSurfaceWayland::Commit(const
     gfx::IntRect bounds = aInvalidRegion.GetBounds().ToUnknownRect();
     gfx::IntSize lockSize(bounds.XMost(), bounds.YMost());
 
-    LOGWAYLAND(("%s [%p] lockSize [%d x %d] screenSize [%d x %d]\n",
-                __PRETTY_FUNCTION__, (void*)this, lockSize.width,
-                lockSize.height, mBufferScreenRect.width,
-                mBufferScreenRect.height));
+    LOGWAYLAND(
+        ("WindowSurfaceWayland::Commit [%p] lockSize [%d x %d] screenSize [%d "
+         "x %d]\n",
+         (void*)this, lockSize.width, lockSize.height, mBufferScreenRect.width,
+         mBufferScreenRect.height));
     LOGWAYLAND(("    mDrawToWaylandBufferDirectly = %d\n",
                 mDrawToWaylandBufferDirectly));
     LOGWAYLAND(
@@ -1064,7 +1064,8 @@ void WindowSurfaceWayland::FrameCallback
   MOZ_ASSERT(mLastCommittedSurface != nullptr,
              "FrameCallbackHandler() called without valid wl_surface!");
 
-  LOGWAYLAND(("%s [%p]\n", __PRETTY_FUNCTION__, (void*)this));
+  LOGWAYLAND(
+      ("WindowSurfaceWayland::FrameCallbackHandler [%p]\n", (void*)this));
 
   wl_callback_destroy(mFrameCallback);
   mFrameCallback = nullptr;
@@ -1077,7 +1078,8 @@ void WindowSurfaceWayland::FrameCallback
 void WindowSurfaceWayland::DelayedCommitHandler() {
   MOZ_ASSERT(mDelayedCommitHandle != nullptr, "Missing mDelayedCommitHandle!");
 
-  LOGWAYLAND(("%s [%p]\n", __PRETTY_FUNCTION__, (void*)this));
+  LOGWAYLAND(
+      ("WindowSurfaceWayland::DelayedCommitHandler [%p]\n", (void*)this));
 
   *mDelayedCommitHandle = nullptr;
   free(mDelayedCommitHandle);
bgstack15