Title: [260072] trunk/Source/WebCore
Revision
260072
Author
csaave...@igalia.com
Date
2020-04-14 06:34:55 -0700 (Tue, 14 Apr 2020)

Log Message

[GTK] Adapt to GdkVisual deprecation and removal
https://bugs.webkit.org/show_bug.cgi?id=210489

Reviewed by Adrian Perez de Castro.

No new tests needed.

Update the GdkVisual used to get the screen depth per component in
GTK3 and use default values for GTK4, as visuals as an abstraction
are gone from GTK4. The use in WK is very limited so there's no
much gain from peeking into backend-specific values.

* platform/gtk/PlatformScreenGtk.cpp:
(WebCore::screenDepth): Guard GdkVisual call and leave
default value for GTK4.
(WebCore::screenDepthPerComponent): Update API and ditto.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (260071 => 260072)


--- trunk/Source/WebCore/ChangeLog	2020-04-14 12:19:08 UTC (rev 260071)
+++ trunk/Source/WebCore/ChangeLog	2020-04-14 13:34:55 UTC (rev 260072)
@@ -1,3 +1,22 @@
+2020-04-14  Claudio Saavedra  <csaave...@igalia.com>
+
+        [GTK] Adapt to GdkVisual deprecation and removal
+        https://bugs.webkit.org/show_bug.cgi?id=210489
+
+        Reviewed by Adrian Perez de Castro.
+
+        No new tests needed.
+
+        Update the GdkVisual used to get the screen depth per component in
+        GTK3 and use default values for GTK4, as visuals as an abstraction
+        are gone from GTK4. The use in WK is very limited so there's no
+        much gain from peeking into backend-specific values.
+
+        * platform/gtk/PlatformScreenGtk.cpp:
+        (WebCore::screenDepth): Guard GdkVisual call and leave
+        default value for GTK4.
+        (WebCore::screenDepthPerComponent): Update API and ditto.
+
 2020-04-14  Carlos Garcia Campos  <cgar...@igalia.com>
 
         [GTK][WPE] Scrollbar handle has no minimum size

Modified: trunk/Source/WebCore/platform/gtk/PlatformScreenGtk.cpp (260071 => 260072)


--- trunk/Source/WebCore/platform/gtk/PlatformScreenGtk.cpp	2020-04-14 12:19:08 UTC (rev 260071)
+++ trunk/Source/WebCore/platform/gtk/PlatformScreenGtk.cpp	2020-04-14 13:34:55 UTC (rev 260072)
@@ -46,6 +46,7 @@
 
 namespace WebCore {
 
+#if !USE(GTK4)
 static GdkVisual* systemVisual()
 {
     if (auto* screen = gdk_screen_get_default())
@@ -53,11 +54,14 @@
 
     return nullptr;
 }
+#endif
 
 int screenDepth(Widget*)
 {
+#if !USE(GTK4)
     if (auto* visual = systemVisual())
         return gdk_visual_get_depth(visual);
+#endif
 
     return 24;
 }
@@ -64,8 +68,13 @@
 
 int screenDepthPerComponent(Widget*)
 {
-    if (auto* visual = systemVisual())
-        return gdk_visual_get_bits_per_rgb(visual);
+#if !USE(GTK4)
+    if (auto* visual = systemVisual()) {
+        int redDepth;
+        gdk_visual_get_red_pixel_details(visual, nullptr, nullptr, &redDepth);
+        return redDepth;
+    }
+#endif
 
     return 8;
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to