Bug 1586993 - [Linux] Add logging to nsWindow::UpdateOpaqueRegion, r=jhorak
authorMartin Stransky <stransky@redhat.com>
Tue, 08 Oct 2019 07:56:49 +0000
changeset 496715 3ceccf43b6c82299c27c75070ea04d8b03d07b7c
parent 496714 e547233969e4527a3e9b49d250f11af75c582383
child 496716 7e191fa6dccf09da5f5ea71fdfb126982c198515
push id36666
push userapavel@mozilla.com
push dateTue, 08 Oct 2019 16:00:46 +0000
treeherdermozilla-central@9a16c53ed5c3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjhorak
bugs1586993
milestone71.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1586993 - [Linux] Add logging to nsWindow::UpdateOpaqueRegion, r=jhorak Differential Revision: https://phabricator.services.mozilla.com/D48480
widget/gtk/nsWindow.cpp
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -4566,34 +4566,40 @@ void nsWindow::UpdateWindowDraggingRegio
 }
 
 void nsWindow::UpdateOpaqueRegion(const LayoutDeviceIntRegion& aOpaqueRegion) {
   // Available as of GTK 3.10+
   static auto sGdkWindowSetOpaqueRegion =
       (void (*)(GdkWindow*, cairo_region_t*))dlsym(
           RTLD_DEFAULT, "gdk_window_set_opaque_region");
 
+  LOG(("nsWindow::UpdateOpaqueRegion [%p]\n", (void*)this));
   if (!sGdkWindowSetOpaqueRegion) {
+    LOG(("    gdk_window_set_opaque_region is not available!\n"));
     return;
   }
 
   GdkWindow* window = (mCSDSupportLevel == CSD_SUPPORT_CLIENT)
                           ? gtk_widget_get_window(mShell)
                           : mGdkWindow;
 
   // gdk_window_set_opaque_region() work for toplevel Gdk windows only.
   // Also don't set shape mask if we use transparency bitmap.
   if (gdk_window_get_window_type(window) != GDK_WINDOW_TOPLEVEL ||
       mTransparencyBitmapForTitlebar) {
+    LOG(("    disabled due to %s\n", mTransparencyBitmapForTitlebar
+                                         ? "transparency bitmap"
+                                         : "non-toplevel window"));
     return;
   }
 
   // We don't tweak opaque regions for non-toplevel windows (popup, panels etc.)
   // as they can be transparent by gecko.
   if (mWindowType != eWindowType_toplevel) {
+    LOG(("    setting for non-toplevel window\n"));
     if (aOpaqueRegion.IsEmpty()) {
       (*sGdkWindowSetOpaqueRegion)(mGdkWindow, nullptr);
     } else {
       cairo_region_t* region = cairo_region_create();
       for (auto iter = aOpaqueRegion.RectIter(); !iter.Done(); iter.Next()) {
         const LayoutDeviceIntRect& r = iter.Get();
         cairo_rectangle_int_t rect = {r.x, r.y, r.width, r.height};
         cairo_region_union_rectangle(region, &rect);
@@ -4615,21 +4621,25 @@ void nsWindow::UpdateOpaqueRegion(const 
     int scale = GdkScaleFactor();
     int width = mBounds.width / scale;
     int height = mBounds.height / scale;
 
     cairo_rectangle_int_t rect = {decorationSize.left, decorationSize.top,
                                   width, height};
     cairo_region_union_rectangle(region, &rect);
 
+    LOG(("    setting for toplevel window %d,%d -> %d x %d\n", rect.x, rect.y,
+         rect.width, rect.height));
+
     // Subtract transparent corners which are used by
     // various Gtk themes for toplevel windows when titlebar
     // is rendered by gecko.
     if (mDrawInTitlebar && !mIsPIPWindow && mSizeMode == nsSizeMode_Normal &&
         !mIsTiled) {
+      LOG(("    substracted corners for titlebar decoration\n"));
       cairo_rectangle_int_t rect = {decorationSize.left, decorationSize.top,
                                     TITLEBAR_SHAPE_MASK_HEIGHT,
                                     TITLEBAR_SHAPE_MASK_HEIGHT};
       cairo_region_subtract_rectangle(region, &rect);
       rect = {
           decorationSize.left + width - TITLEBAR_SHAPE_MASK_HEIGHT,
           decorationSize.top,
           TITLEBAR_SHAPE_MASK_HEIGHT,