Index: ui/gl/BUILD.gn |
diff --git a/ui/gl/BUILD.gn b/ui/gl/BUILD.gn |
index 9d92df53943b4ed66c807001b151defae4e094b7..f496aca1dd0d9f00eaf6297c5564e79c33d164a1 100644 |
--- a/ui/gl/BUILD.gn |
+++ b/ui/gl/BUILD.gn |
@@ -3,6 +3,7 @@ |
# found in the LICENSE file. |
import("//build/config/ui.gni") |
+import("//ui/ozone/ozone.gni") |
import("//testing/test.gni") |
if (is_android) { |
@@ -11,8 +12,15 @@ if (is_android) { |
} |
config("gl_config") { |
- if (use_x11) { |
- defines = [ "GL_GLEXT_PROTOTYPES" ] |
+ defines = [] |
+ if (use_x11 || ozone_platform_x11) { |
+ defines += [ |
+ "GL_GLEXT_PROTOTYPES", |
+ "USE_GLX", |
+ ] |
+ } |
+ if (is_win || is_android || is_linux) { |
+ defines += [ "USE_EGL" ] |
} |
} |
@@ -142,6 +150,8 @@ component("gl") { |
"gl_bindings_autogen_egl.h", |
"gl_context_egl.cc", |
"gl_context_egl.h", |
+ "gl_egl_api_implementation.cc", |
+ "gl_egl_api_implementation.h", |
"gl_fence_egl.cc", |
"gl_fence_egl.h", |
"gl_image_egl.cc", |
@@ -161,23 +171,40 @@ component("gl") { |
} |
if (use_x11) { |
sources += [ |
+ "gl_context_x11.cc", |
+ "gl_implementation_x11.cc", |
+ "gl_surface_egl_x11.cc", |
+ "gl_surface_egl_x11.h", |
+ "gl_surface_x11.cc", |
+ ] |
+ |
+ data_deps = [ |
+ "//third_party/angle:libEGL", |
+ "//third_party/angle:libGLESv2", |
+ ] |
+ } |
+ if (use_ozone) { |
+ sources += [ |
+ "gl_context_ozone.cc", |
+ "gl_image_ozone_native_pixmap.cc", |
+ "gl_image_ozone_native_pixmap.h", |
+ "gl_implementation_ozone.cc", |
+ "gl_surface_ozone.cc", |
+ ] |
+ deps += [ "//ui/ozone" ] |
+ } |
+ if (use_x11 || ozone_platform_x11) { |
+ sources += [ |
"gl_bindings_autogen_glx.cc", |
"gl_bindings_autogen_glx.h", |
"gl_context_glx.cc", |
"gl_context_glx.h", |
- "gl_context_x11.cc", |
- "gl_egl_api_implementation.cc", |
- "gl_egl_api_implementation.h", |
"gl_glx_api_implementation.cc", |
"gl_glx_api_implementation.h", |
"gl_image_glx.cc", |
"gl_image_glx.h", |
- "gl_implementation_x11.cc", |
- "gl_surface_egl_x11.cc", |
- "gl_surface_egl_x11.h", |
"gl_surface_glx.cc", |
"gl_surface_glx.h", |
- "gl_surface_x11.cc", |
] |
configs += [ |
@@ -187,10 +214,9 @@ component("gl") { |
] |
deps += [ "//ui/gfx/x" ] |
- data_deps = [ |
- "//third_party/angle:libEGL", |
- "//third_party/angle:libGLESv2", |
- ] |
+ } |
+ if (ozone_platform_x11) { |
+ deps += [ "//ui/events/platform/x11" ] |
} |
if (is_win) { |
sources += [ |
@@ -200,8 +226,6 @@ component("gl") { |
"gl_bindings_autogen_wgl.h", |
"gl_context_wgl.cc", |
"gl_context_wgl.h", |
- "gl_egl_api_implementation.cc", |
- "gl_egl_api_implementation.h", |
"gl_surface_wgl.cc", |
"gl_surface_wgl.h", |
"gl_wgl_api_implementation.cc", |
@@ -239,8 +263,6 @@ component("gl") { |
} |
if (is_android) { |
sources += [ |
- "gl_egl_api_implementation.cc", |
- "gl_egl_api_implementation.h", |
"gl_image_surface_texture.cc", |
"gl_image_surface_texture.h", |
] |
@@ -257,18 +279,6 @@ component("gl") { |
"//ui/android:ui_java", |
] |
} |
- if (use_ozone) { |
- sources += [ |
- "gl_context_ozone.cc", |
- "gl_egl_api_implementation.cc", |
- "gl_egl_api_implementation.h", |
- "gl_image_ozone_native_pixmap.cc", |
- "gl_image_ozone_native_pixmap.h", |
- "gl_implementation_ozone.cc", |
- "gl_surface_ozone.cc", |
- ] |
- deps += [ "//ui/ozone" ] |
- } |
} |
source_set("gl_unittest_utils") { |
@@ -313,7 +323,7 @@ source_set("test_support") { |
"//testing/gtest", |
] |
- if (use_x11) { |
+ if (use_x11 || ozone_platform_x11) { |
configs += [ "//build/config/linux:x11" ] |
deps += [ |
"//ui/gfx/x", |
@@ -338,7 +348,7 @@ test("gl_unittests") { |
] |
} |
- if (use_x11) { |
+ if (use_x11 || ozone_platform_x11) { |
sources += [ "glx_api_unittest.cc" ] |
} |