Ozone: Remove the use_wayland_egl build flag

This flag is always enabled by default. It was introduced to allow
building the Wayland Ozone platform without the egl packages but these
were added to the sysroot in
https://codereview.chromium.org/2415933004
so that should no longer be a problem.

BUG=None

Review-Url: https://chromiumcodereview.appspot.com/2431383002
Cr-Commit-Position: refs/heads/master@{#426414}
diff --git a/ui/ozone/platform/wayland/BUILD.gn b/ui/ozone/platform/wayland/BUILD.gn
index 3592805..494ab60 100644
--- a/ui/ozone/platform/wayland/BUILD.gn
+++ b/ui/ozone/platform/wayland/BUILD.gn
@@ -6,20 +6,16 @@
 
 import("//build/config/linux/pkg_config.gni")
 
-declare_args() {
-  use_wayland_egl = true
-}
-
-if (use_wayland_egl) {
-  pkg_config("wayland-egl") {
-    packages = [ "wayland-egl" ]
-  }
+pkg_config("wayland-egl") {
+  packages = [ "wayland-egl" ]
 }
 
 source_set("wayland") {
   sources = [
     "client_native_pixmap_factory_wayland.cc",
     "client_native_pixmap_factory_wayland.h",
+    "gl_surface_wayland.cc",
+    "gl_surface_wayland.h",
     "ozone_platform_wayland.cc",
     "ozone_platform_wayland.h",
     "wayland_connection.cc",
@@ -53,17 +49,10 @@
 
   defines = [ "OZONE_IMPLEMENTATION" ]
 
-  if (use_wayland_egl) {
-    sources += [
-      "gl_surface_wayland.cc",
-      "gl_surface_wayland.h",
-    ]
-    configs += [
-      ":wayland-egl",
-      "//third_party/khronos:khronos_headers",
-    ]
-    defines += [ "USE_WAYLAND_EGL" ]
-  }
+  configs += [
+    ":wayland-egl",
+    "//third_party/khronos:khronos_headers",
+  ]
 }
 
 source_set("wayland_unittests") {
diff --git a/ui/ozone/platform/wayland/wayland_surface_factory.cc b/ui/ozone/platform/wayland/wayland_surface_factory.cc
index 757f549..46752c9 100644
--- a/ui/ozone/platform/wayland/wayland_surface_factory.cc
+++ b/ui/ozone/platform/wayland/wayland_surface_factory.cc
@@ -14,15 +14,12 @@
 #include "ui/gfx/vsync_provider.h"
 #include "ui/ozone/common/egl_util.h"
 #include "ui/ozone/common/gl_ozone_egl.h"
+#include "ui/ozone/platform/wayland/gl_surface_wayland.h"
 #include "ui/ozone/platform/wayland/wayland_connection.h"
 #include "ui/ozone/platform/wayland/wayland_object.h"
 #include "ui/ozone/platform/wayland/wayland_window.h"
 #include "ui/ozone/public/surface_ozone_canvas.h"
 
-#if defined(USE_WAYLAND_EGL)
-#include "ui/ozone/platform/wayland/gl_surface_wayland.h"
-#endif
-
 namespace ui {
 
 static void DeleteSharedMemory(void* pixels, void* context) {
@@ -152,7 +149,6 @@
 
 scoped_refptr<gl::GLSurface> GLOzoneEGLWayland::CreateViewGLSurface(
     gfx::AcceleratedWidget widget) {
-#if defined(USE_WAYLAND_EGL)
   DCHECK(connection_);
   WaylandWindow* window = connection_->GetWindow(widget);
   DCHECK(window);
@@ -162,23 +158,16 @@
   if (!egl_window)
     return nullptr;
   return gl::InitializeGLSurface(new GLSurfaceWayland(std::move(egl_window)));
-#else
-  return nullptr;
-#endif
 }
 
 scoped_refptr<gl::GLSurface> GLOzoneEGLWayland::CreateOffscreenGLSurface(
     const gfx::Size& size) {
-#if defined(USE_WAYLAND_EGL)
   if (gl::GLSurfaceEGL::IsEGLSurfacelessContextSupported() &&
       size.width() == 0 && size.height() == 0) {
     return gl::InitializeGLSurface(new gl::SurfacelessEGL(size));
   } else {
     return gl::InitializeGLSurface(new gl::PbufferGLSurfaceEGL(size));
   }
-#else
-  return nullptr;
-#endif
 }
 
 intptr_t GLOzoneEGLWayland::GetNativeDisplay() {
@@ -186,12 +175,8 @@
 }
 
 bool GLOzoneEGLWayland::LoadGLES2Bindings() {
-#if defined(USE_WAYLAND_EGL)
   setenv("EGL_PLATFORM", "wayland", 0);
   return LoadDefaultEGLGLES2Bindings();
-#else
-  return false;
-#endif
 }
 
 }  // namespace