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/khronos",
110 "//third_party/mesa/src/include",
113 all_dependent_configs = [ ":gl_config" ]
116 "//base/third_party/dynamic_annotations",
117 "//gpu/command_buffer/common",
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" ]
209 "gl_image_io_surface.cc",
210 "gl_image_io_surface.h",
216 "IOSurface.framework",
222 "gl_egl_api_implementation.cc",
223 "gl_egl_api_implementation.h",
224 "gl_image_surface_texture.cc",
225 "gl_image_surface_texture.h",
229 "GL_GLEXT_PROTOTYPES",
230 "EGL_EGLEXT_PROTOTYPES",
235 deps += [ ":gl_jni_headers" ]
239 "gl_context_ozone.cc",
240 "gl_egl_api_implementation.cc",
241 "gl_egl_api_implementation.h",
242 "gl_implementation_ozone.cc",
243 "gl_surface_ozone.cc",
247 "//ui/ozone:ozone_base",
251 if (is_android && !is_android_webview_build) {
252 deps += [ "//ui/android:ui_java" ]
256 source_set("gl_unittest_utils") {
259 "gl_bindings_autogen_mock.cc",
260 "gl_bindings_autogen_mock.h",
263 "gl_mock_autogen_gl.h",
266 configs += [ "//third_party/khronos:khronos_headers" ]
275 generate_jar_jni("surface_jni_headers") {
276 jni_package = "ui/gl"
277 classes = [ "android/view/Surface.class" ]
280 generate_jni("gl_jni_headers") {
282 ":surface_jni_headers",
285 "../android/java/src/org/chromium/ui/gl/SurfaceTextureListener.java",
286 "../android/java/src/org/chromium/ui/gl/SurfaceTexturePlatformWrapper.java",
288 jni_package = "ui/gl"