1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 import("//build/config/ui.gni")
6 import("//testing/test.gni")
9 import("//build/config/android/config.gni")
10 import("//build/config/android/rules.gni")
15 defines = [ "GL_GLEXT_PROTOTYPES" ]
20 output_name = "gl_wrapper" # Avoid colliding with OS X"s libGL.dylib.
23 "android/gl_jni_registrar.cc",
24 "android/gl_jni_registrar.h",
25 "android/scoped_java_surface.cc",
26 "android/scoped_java_surface.h",
27 "android/surface_texture.cc",
28 "android/surface_texture.h",
29 "android/surface_texture_listener.cc",
30 "android/surface_texture_listener.h",
33 "gl_bindings_autogen_gl.cc",
34 "gl_bindings_autogen_gl.h",
35 "gl_bindings_autogen_osmesa.cc",
36 "gl_bindings_autogen_osmesa.h",
37 "gl_bindings_skia_in_process.cc",
38 "gl_bindings_skia_in_process.h",
41 "gl_context_android.cc",
43 "gl_context_osmesa.cc",
44 "gl_context_osmesa.h",
47 "gl_context_stub_with_extensions.cc",
48 "gl_context_stub_with_extensions.h",
52 "gl_enums_implementation_autogen.h",
60 "gl_gl_api_implementation.cc",
61 "gl_gl_api_implementation.h",
65 "gl_image_ref_counted_memory.cc",
66 "gl_image_ref_counted_memory.h",
67 "gl_image_shared_memory.cc",
68 "gl_image_shared_memory.h",
71 "gl_implementation.cc",
72 "gl_implementation.h",
73 "gl_implementation_android.cc",
74 "gl_implementation_mac.cc",
75 "gl_implementation_win.cc",
76 "gl_osmesa_api_implementation.cc",
77 "gl_osmesa_api_implementation.h",
80 "gl_state_restorer.cc",
81 "gl_state_restorer.h",
84 "gl_surface_android.cc",
86 "gl_surface_osmesa.cc",
87 "gl_surface_osmesa.h",
95 "gpu_switching_manager.cc",
96 "gpu_switching_manager.h",
101 "scoped_make_current.cc",
102 "scoped_make_current.h",
103 "sync_control_vsync_provider.cc",
104 "sync_control_vsync_provider.h",
107 defines = [ "GL_IMPLEMENTATION" ]
110 "//third_party/switfshader/include",
111 "//third_party/mesa/src/include",
114 all_dependent_configs = [ ":gl_config" ]
116 public_configs = [ "//third_party/khronos:khronos_headers" ]
119 "//base/third_party/dynamic_annotations",
124 "//third_party/mesa:mesa_headers",
125 "//ui/events/platform",
130 if (is_win || is_android || is_linux) {
134 "gl_bindings_autogen_egl.cc",
135 "gl_bindings_autogen_egl.h",
146 if (is_android || is_linux) {
148 "gl_implementation_osmesa.cc",
149 "gl_implementation_osmesa.h",
153 deps += [ "//third_party/libevent" ]
155 "gl_image_linux_dma_buffer.cc",
156 "gl_image_linux_dma_buffer.h",
161 "gl_bindings_autogen_glx.cc",
162 "gl_bindings_autogen_glx.h",
166 "gl_egl_api_implementation.cc",
167 "gl_egl_api_implementation.h",
168 "gl_glx_api_implementation.cc",
169 "gl_glx_api_implementation.h",
172 "gl_implementation_x11.cc",
179 "//build/config/linux:x11",
180 "//build/config/linux:xcomposite",
181 "//build/config/linux:xext",
184 deps += [ "//ui/gfx/x" ]
188 "angle_platform_impl.cc",
189 "angle_platform_impl.h",
190 "gl_bindings_autogen_wgl.cc",
191 "gl_bindings_autogen_wgl.h",
194 "gl_egl_api_implementation.cc",
195 "gl_egl_api_implementation.h",
198 "gl_wgl_api_implementation.cc",
199 "gl_wgl_api_implementation.h",
202 libs = [ "dwmapi.lib" ]
203 ldflags = [ "/DELAYLOAD:dwmapi.dll" ]
206 "//third_party/angle:libEGL",
207 "//third_party/angle:libGLESv2",
208 "//third_party/mesa:osmesa",
217 "gl_image_io_surface.h",
218 "gl_image_io_surface.mm",
224 "IOSurface.framework",
231 "gl_egl_api_implementation.cc",
232 "gl_egl_api_implementation.h",
233 "gl_image_surface_texture.cc",
234 "gl_image_surface_texture.h",
238 "GL_GLEXT_PROTOTYPES",
239 "EGL_EGLEXT_PROTOTYPES",
246 "//ui/android:ui_java",
251 "gl_context_ozone.cc",
252 "gl_egl_api_implementation.cc",
253 "gl_egl_api_implementation.h",
254 "gl_implementation_ozone.cc",
255 "gl_surface_ozone.cc",
259 "//ui/ozone:ozone_base",
264 source_set("gl_unittest_utils") {
267 "gl_bindings_autogen_mock.cc",
268 "gl_bindings_autogen_mock.h",
271 "gl_mock_autogen_gl.h",
272 "gpu_timing_fake.cc",
276 configs += [ "//third_party/khronos:khronos_headers" ]
284 source_set("test_support") {
286 "test/gl_surface_test_support.cc",
287 "test/gl_surface_test_support.h",
290 configs += [ "//third_party/khronos:khronos_headers" ]
297 configs += [ "//build/config/linux:x11" ]
300 "//ui/platform_window/x11",
305 # TODO(GYP): Delete this after we've converted everything to GN.
306 # The _run targets exist only for compatibility w/ GYP.
307 group("gl_unittests_run") {
314 test("gl_unittests") {
316 "gl_api_unittest.cc",
317 "gpu_timing_unittest.cc",
318 "test/run_all_unittests.cc",
321 if (is_win || is_android || is_linux) {
323 "egl_api_unittest.cc",
324 "test/egl_initialization_displays_unittest.cc",
328 include_dirs = [ "//third_party/khronos" ]
332 ":gl_unittest_utils",
335 "//base/test:test_support",
342 generate_jar_jni("surface_jni_headers") {
343 jni_package = "ui/gl"
344 classes = [ "android/view/Surface.class" ]
347 generate_jni("gl_jni_headers") {
349 ":surface_jni_headers",
352 "../android/java/src/org/chromium/ui/gl/SurfaceTextureListener.java",
353 "../android/java/src/org/chromium/ui/gl/SurfaceTexturePlatformWrapper.java",
355 jni_package = "ui/gl"