<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[287075] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/287075">287075</a></dd>
<dt>Author</dt> <dd>clord@igalia.com</dd>
<dt>Date</dt> <dd>2021-12-15 08:33:45 -0800 (Wed, 15 Dec 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>[GTK] Use libgbm and the ANGLE gbm backend to fix initialisation
https://bugs.webkit.org/show_bug.cgi?id=234293

Reviewed by Don Olmstead.

.:

Add cmake files to find gbm and libdrm.

* Source/cmake/FindGBM.cmake: Added.
* Source/cmake/FindLibDRM.cmake: Added.

Source/ThirdParty/ANGLE:

Use GBM backend for GTK platform.

* CMakeLists.txt:
* GL.cmake:
* PlatformGTK.cmake:

Source/WebCore:

Make ANGLE context non-TEXTURE_2D drawingBufferTextureTarget Cocoa-specific.

* platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLANGLE::drawingBufferTextureTarget):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkChangeLog">trunk/ChangeLog</a></li>
<li><a href="#trunkSourceThirdPartyANGLECMakeListstxt">trunk/Source/ThirdParty/ANGLE/CMakeLists.txt</a></li>
<li><a href="#trunkSourceThirdPartyANGLEChangeLog">trunk/Source/ThirdParty/ANGLE/ChangeLog</a></li>
<li><a href="#trunkSourceThirdPartyANGLEGLcmake">trunk/Source/ThirdParty/ANGLE/GL.cmake</a></li>
<li><a href="#trunkSourceThirdPartyANGLEPlatformGTKcmake">trunk/Source/ThirdParty/ANGLE/PlatformGTK.cmake</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsangleGraphicsContextGLANGLEcpp">trunk/Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourcecmakeFindGBMcmake">trunk/Source/cmake/FindGBM.cmake</a></li>
<li><a href="#trunkSourcecmakeFindLibDRMcmake">trunk/Source/cmake/FindLibDRM.cmake</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/ChangeLog (287074 => 287075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/ChangeLog  2021-12-15 16:25:24 UTC (rev 287074)
+++ trunk/ChangeLog     2021-12-15 16:33:45 UTC (rev 287075)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2021-12-15  Chris Lord  <clord@igalia.com>
+
+        [GTK] Use libgbm and the ANGLE gbm backend to fix initialisation
+        https://bugs.webkit.org/show_bug.cgi?id=234293
+
+        Reviewed by Don Olmstead.
+
+        Add cmake files to find gbm and libdrm.
+
+        * Source/cmake/FindGBM.cmake: Added.
+        * Source/cmake/FindLibDRM.cmake: Added.
+
</ins><span class="cx"> 2021-12-11  Aakash Jain  <aakash_jain@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Update my github username.
</span></span></pre></div>
<a id="trunkSourceThirdPartyANGLECMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/ThirdParty/ANGLE/CMakeLists.txt (287074 => 287075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/ThirdParty/ANGLE/CMakeLists.txt     2021-12-15 16:25:24 UTC (rev 287074)
+++ trunk/Source/ThirdParty/ANGLE/CMakeLists.txt        2021-12-15 16:33:45 UTC (rev 287075)
</span><span class="lines">@@ -9,9 +9,7 @@
</span><span class="cx">     set(angle_is_winuwp FALSE)
</span><span class="cx"> elseif (UNIX)
</span><span class="cx">     set(is_linux TRUE)
</span><del>-    if (ENABLE_X11_TARGET)
-        set(angle_use_x11 TRUE)
-    endif ()
</del><ins>+    set(ozone_platform_gbm TRUE)
</ins><span class="cx"> endif ()
</span><span class="cx"> 
</span><span class="cx"> include(Compiler.cmake)
</span></span></pre></div>
<a id="trunkSourceThirdPartyANGLEChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/ThirdParty/ANGLE/ChangeLog (287074 => 287075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/ThirdParty/ANGLE/ChangeLog  2021-12-15 16:25:24 UTC (rev 287074)
+++ trunk/Source/ThirdParty/ANGLE/ChangeLog     2021-12-15 16:33:45 UTC (rev 287075)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2021-12-15  Chris Lord  <clord@igalia.com>
+
+        [GTK] Use libgbm and the ANGLE gbm backend to fix initialisation
+        https://bugs.webkit.org/show_bug.cgi?id=234293
+
+        Reviewed by Don Olmstead.
+
+        Use GBM backend for GTK platform.
+
+        * CMakeLists.txt:
+        * GL.cmake:
+        * PlatformGTK.cmake:
+
</ins><span class="cx"> 2021-12-15  Kyle Piddington  <kpiddington@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [ANGLE] Roll ANGLE to 12-14-2021 (5ee7dfbd5a3)
</span></span></pre></div>
<a id="trunkSourceThirdPartyANGLEGLcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/ThirdParty/ANGLE/GL.cmake (287074 => 287075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/ThirdParty/ANGLE/GL.cmake   2021-12-15 16:25:24 UTC (rev 287074)
+++ trunk/Source/ThirdParty/ANGLE/GL.cmake      2021-12-15 16:33:45 UTC (rev 287075)
</span><span class="lines">@@ -163,9 +163,6 @@
</span><span class="cx">         "src/libANGLE/renderer/gl/egl/gbm/SurfaceGbm.cpp"
</span><span class="cx">         "src/libANGLE/renderer/gl/egl/gbm/SurfaceGbm.h"
</span><span class="cx">     )
</span><del>-
-    pkg_config("src/libANGLE/renderer/gl/libdrm") 
-    set(packages "src/libANGLE/renderer/gl/libdrm" )
</del><span class="cx"> endif()
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceThirdPartyANGLEPlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/ThirdParty/ANGLE/PlatformGTK.cmake (287074 => 287075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/ThirdParty/ANGLE/PlatformGTK.cmake  2021-12-15 16:25:24 UTC (rev 287074)
+++ trunk/Source/ThirdParty/ANGLE/PlatformGTK.cmake     2021-12-15 16:33:45 UTC (rev 287075)
</span><span class="lines">@@ -22,10 +22,22 @@
</span><span class="cx"> 
</span><span class="cx">     list(APPEND ANGLE_DEFINITIONS
</span><span class="cx">         ANGLE_ENABLE_OPENGL
</span><ins>+        ANGLE_USE_GBM
+        USE_SYSTEM_EGL
</ins><span class="cx">     )
</span><span class="cx"> 
</span><ins>+    find_package(LibDRM REQUIRED)
+    find_package(GBM REQUIRED)
+
+    list(APPEND ANGLE_PRIVATE_INCLUDE_DIRECTORIES
+        ${LIBDRM_INCLUDE_DIR}
+        {GBM_INCLUDE_DIR}
+    )
+
</ins><span class="cx">     list(APPEND ANGLEGLESv2_LIBRARIES
</span><span class="cx">         ${CMAKE_DL_LIBS}
</span><ins>+        ${LIBDRM_LIBRARIES}
+        ${GBM_LIBRARIES}
</ins><span class="cx">         Threads::Threads
</span><span class="cx">     )
</span><span class="cx"> 
</span><span class="lines">@@ -34,24 +46,4 @@
</span><span class="cx">     else ()
</span><span class="cx">         list(APPEND ANGLEGLESv2_LIBRARIES OpenGL::GLES)
</span><span class="cx">     endif ()
</span><del>-
-    # NOTE: When both Wayland and X11 are enabled, ANGLE_USE_X11 will be
-    # defined and the X11 type definitions will be used for code involving
-    # both. That works because types for both Wayland and X11 have the same
-    # sizes and the code in WebKit casts the values to the proper types as
-    # needed.
-    set(GTK_ANGLE_DEFINITIONS)
-
-    if (ENABLE_X11_TARGET)
-        list(APPEND ANGLE_SOURCES ${libangle_gl_glx_sources})
-        list(APPEND ANGLEGLESv2_LIBRARIES X11)
-        list(APPEND GTK_ANGLE_DEFINITIONS ANGLE_USE_X11)
-    endif ()
-
-    # Allow building ANGLE on platforms which may not provide X11 headers.
-    if (NOT GTK_ANGLE_DEFINITIONS)
-        list(APPEND GTK_ANGLE_DEFINITIONS USE_SYSTEM_EGL)
-    endif ()
-
-    list(APPEND ANGLE_DEFINITIONS ${GTK_ANGLE_DEFINITIONS})
</del><span class="cx"> endif ()
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (287074 => 287075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-12-15 16:25:24 UTC (rev 287074)
+++ trunk/Source/WebCore/ChangeLog      2021-12-15 16:33:45 UTC (rev 287075)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2021-12-15  Chris Lord  <clord@igalia.com>
+
+        [GTK] Use libgbm and the ANGLE gbm backend to fix initialisation
+        https://bugs.webkit.org/show_bug.cgi?id=234293
+
+        Reviewed by Don Olmstead.
+
+        Make ANGLE context non-TEXTURE_2D drawingBufferTextureTarget Cocoa-specific.
+
+        * platform/graphics/angle/GraphicsContextGLANGLE.cpp:
+        (WebCore::GraphicsContextGLANGLE::drawingBufferTextureTarget):
+
</ins><span class="cx"> 2021-12-15  Carlos Garcia Campos  <cgarcia@igalia.com>
</span><span class="cx"> 
</span><span class="cx">         [GTK][a11y] Add support for loading events when building with ATSPI
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsangleGraphicsContextGLANGLEcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp (287074 => 287075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp  2021-12-15 16:25:24 UTC (rev 287074)
+++ trunk/Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp     2021-12-15 16:33:45 UTC (rev 287075)
</span><span class="lines">@@ -73,7 +73,7 @@
</span><span class="cx"> 
</span><span class="cx"> GCGLenum GraphicsContextGLANGLE::drawingBufferTextureTarget()
</span><span class="cx"> {
</span><del>-#if PLATFORM(WIN)
</del><ins>+#if !PLATFORM(COCOA)
</ins><span class="cx">     m_drawingBufferTextureTarget = EGL_TEXTURE_2D;
</span><span class="cx"> #else
</span><span class="cx">     if (m_drawingBufferTextureTarget == -1)
</span></span></pre></div>
<a id="trunkSourcecmakeFindGBMcmake"></a>
<div class="addfile"><h4>Added: trunk/Source/cmake/FindGBM.cmake (0 => 287075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/cmake/FindGBM.cmake                         (rev 0)
+++ trunk/Source/cmake/FindGBM.cmake    2021-12-15 16:33:45 UTC (rev 287075)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+# - Find GBM
+# This module looks for GBM. This module defines the
+# following variables:
+#  GBM_FOUND - system has gbm
+#  GBM_INCLUDE_DIRS - the gbm include directories
+#  GBM_LIBRARIES - link these to use gbm
+
+find_package(PkgConfig QUIET)
+pkg_check_modules(PC_GBM QUIET gbm)
+
+find_library(GBM_LIBRARIES
+    NAMES gbm
+    HINTS ${PC_GBM_LIBDIR}
+          ${PC_GBM_LIBRARY_DIRS}
+)
+
+find_path(GBM_INCLUDE_DIR
+    NAMES gbm.h
+    HINTS ${PC_GBM_INCLUDEDIR}
+          ${PC_GBM_INCLUDE_DIRS}
+)
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(GBM DEFAULT_MSG GBM_LIBRARIES GBM_INCLUDE_DIR)
+
+mark_as_advanced(
+  GBM_INCLUDE_DIR
+  GBM_LIBRARIES
+)
</ins></span></pre></div>
<a id="trunkSourcecmakeFindLibDRMcmake"></a>
<div class="addfile"><h4>Added: trunk/Source/cmake/FindLibDRM.cmake (0 => 287075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/cmake/FindLibDRM.cmake                              (rev 0)
+++ trunk/Source/cmake/FindLibDRM.cmake 2021-12-15 16:33:45 UTC (rev 287075)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+# - Find libdrm
+# This module looks for libdrm. This module defines the
+# following variables:
+#  LIBDRM_FOUND - system has libdrm
+#  LIBDRM_INCLUDE_DIRS - the libdrm include directories
+#  LIBDRM_LIBRARIES - link these to use libdrm
+
+find_package(PkgConfig QUIET)
+pkg_check_modules(PC_LIBDRM QUIET libdrm)
+
+find_library(LIBDRM_LIBRARIES
+    NAMES drm
+    HINTS ${PC_LIBDRM_LIBDIR}
+          ${PC_LIBDRM_LIBRARY_DIRS}
+)
+
+find_path(LIBDRM_INCLUDE_DIR
+    NAMES drm.h
+    HINTS ${PC_LIBDRM_INCLUDEDIR}
+          ${PC_LIBDRM_INCLUDE_DIRS}
+    PATH_SUFFIXES libdrm
+)
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibDRM DEFAULT_MSG LIBDRM_LIBRARIES LIBDRM_INCLUDE_DIR)
+
+mark_as_advanced(
+  LIBDRM_INCLUDE_DIR
+  LIBDRM_LIBRARIES
+)
</ins></span></pre>
</div>
</div>

</body>
</html>