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")
7 import("//build/config/android/config.gni")
8 import("//build/config/android/rules.gni")
13 defines = [ "GL_GLEXT_PROTOTYPES" ]
18 output_name = "gl_wrapper" # Avoid colliding with OS X"s libGL.dylib.
21 "android/gl_jni_registrar.cc",
22 "android/gl_jni_registrar.h",
23 "android/scoped_java_surface.cc",
24 "android/scoped_java_surface.h",
25 "android/surface_texture.cc",
26 "android/surface_texture.h",
27 "android/surface_texture_listener.cc",
28 "android/surface_texture_listener.h",
31 "gl_bindings_autogen_gl.cc",
32 "gl_bindings_autogen_gl.h",
33 "gl_bindings_autogen_osmesa.cc",
34 "gl_bindings_autogen_osmesa.h",
35 "gl_bindings_skia_in_process.cc",
36 "gl_bindings_skia_in_process.h",
39 "gl_context_android.cc",
41 "gl_context_osmesa.cc",
42 "gl_context_osmesa.h",
45 "gl_context_stub_with_extensions.cc",
46 "gl_context_stub_with_extensions.h",
50 "gl_enums_implementation_autogen.h",
58 "gl_gl_api_implementation.cc",
59 "gl_gl_api_implementation.h",
63 "gl_image_ref_counted_memory.cc",
64 "gl_image_ref_counted_memory.h",
65 "gl_image_shared_memory.cc",
66 "gl_image_shared_memory.h",
69 "gl_implementation.cc",
70 "gl_implementation.h",
71 "gl_implementation_android.cc",
72 "gl_implementation_mac.cc",
73 "gl_implementation_win.cc",
74 "gl_osmesa_api_implementation.cc",
75 "gl_osmesa_api_implementation.h",
78 "gl_state_restorer.cc",
79 "gl_state_restorer.h",
82 "gl_surface_android.cc",
84 "gl_surface_osmesa.cc",
85 "gl_surface_osmesa.h",
93 "gpu_switching_manager.cc",
94 "gpu_switching_manager.h",
99 "scoped_make_current.cc",
100 "scoped_make_current.h",
101 "sync_control_vsync_provider.cc",
102 "sync_control_vsync_provider.h",
105 defines = [ "GL_IMPLEMENTATION" ]
108 "//third_party/switfshader/include",
109 "//third_party/mesa/src/include",
112 all_dependent_configs = [ ":gl_config" ]
114 public_configs = [ "//third_party/khronos:khronos_headers" ]
117 "//base/third_party/dynamic_annotations",
122 "//third_party/mesa:mesa_headers",
123 "//ui/events/platform",
128 if (is_win || is_android || is_linux) {
132 "gl_bindings_autogen_egl.cc",
133 "gl_bindings_autogen_egl.h",
144 if (is_android || is_linux) {
146 "gl_implementation_osmesa.cc",
147 "gl_implementation_osmesa.h",
151 deps += [ "//third_party/libevent" ]
153 "gl_image_linux_dma_buffer.cc",
154 "gl_image_linux_dma_buffer.h",
159 "gl_bindings_autogen_glx.cc",
160 "gl_bindings_autogen_glx.h",
164 "gl_egl_api_implementation.cc",
165 "gl_egl_api_implementation.h",
166 "gl_glx_api_implementation.cc",
167 "gl_glx_api_implementation.h",
170 "gl_implementation_x11.cc",
177 "//build/config/linux:x11",
178 "//build/config/linux:xcomposite",
179 "//build/config/linux:xext",
182 deps += [ "//ui/gfx/x" ]
186 "angle_platform_impl.cc",
187 "angle_platform_impl.h",
188 "gl_bindings_autogen_wgl.cc",
189 "gl_bindings_autogen_wgl.h",
192 "gl_egl_api_implementation.cc",
193 "gl_egl_api_implementation.h",
196 "gl_wgl_api_implementation.cc",
197 "gl_wgl_api_implementation.h",
200 libs = [ "dwmapi.lib" ]
201 ldflags = [ "/DELAYLOAD:dwmapi.dll" ]
204 "//third_party/angle:libEGL",
205 "//third_party/angle:libGLESv2",
206 "//third_party/mesa:osmesa",
215 "gl_image_io_surface.cc",
216 "gl_image_io_surface.h",
222 "IOSurface.framework",
228 "gl_egl_api_implementation.cc",
229 "gl_egl_api_implementation.h",
230 "gl_image_surface_texture.cc",
231 "gl_image_surface_texture.h",
235 "GL_GLEXT_PROTOTYPES",
236 "EGL_EGLEXT_PROTOTYPES",
243 "//ui/android:ui_java",
248 "gl_context_ozone.cc",
249 "gl_egl_api_implementation.cc",
250 "gl_egl_api_implementation.h",
251 "gl_implementation_ozone.cc",
252 "gl_surface_ozone.cc",
256 "//ui/ozone:ozone_base",
261 source_set("gl_unittest_utils") {
264 "gl_bindings_autogen_mock.cc",
265 "gl_bindings_autogen_mock.h",
268 "gl_mock_autogen_gl.h",
271 configs += [ "//third_party/khronos:khronos_headers" ]
280 generate_jar_jni("surface_jni_headers") {
281 jni_package = "ui/gl"
282 classes = [ "android/view/Surface.class" ]
285 generate_jni("gl_jni_headers") {
287 ":surface_jni_headers",
290 "../android/java/src/org/chromium/ui/gl/SurfaceTextureListener.java",
291 "../android/java/src/org/chromium/ui/gl/SurfaceTexturePlatformWrapper.java",
293 jni_package = "ui/gl"