Fix search results being clipped in app list.
[chromium-blink-merge.git] / ui / gl / BUILD.gn
blobefee0ee1c3135b13ae3d4c565a63126c54ba620b
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 if (is_android) {
7   import("//build/config/android/config.gni")
8   import("//build/config/android/rules.gni")
11 config("gl_config") {
12   if (use_x11) {
13     defines = [ "GL_GLEXT_PROTOTYPES" ]
14   }
17 component("gl") {
18   output_name = "gl_wrapper"  # Avoid colliding with OS X"s libGL.dylib.
20   sources = [
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",
29     "gl_bindings.cc",
30     "gl_bindings.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",
37     "gl_context.cc",
38     "gl_context.h",
39     "gl_context_android.cc",
40     "gl_context_mac.mm",
41     "gl_context_osmesa.cc",
42     "gl_context_osmesa.h",
43     "gl_context_stub.cc",
44     "gl_context_stub.h",
45     "gl_context_stub_with_extensions.cc",
46     "gl_context_stub_with_extensions.h",
47     "gl_context_win.cc",
48     "gl_enums.cc",
49     "gl_enums.h",
50     "gl_enums_implementation_autogen.h",
51     "gl_export.h",
52     "gl_fence.cc",
53     "gl_fence.h",
54     "gl_fence_arb.cc",
55     "gl_fence_arb.h",
56     "gl_fence_nv.cc",
57     "gl_fence_nv.h",
58     "gl_gl_api_implementation.cc",
59     "gl_gl_api_implementation.h",
60     "gl_image.h",
61     "gl_image_memory.cc",
62     "gl_image_memory.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",
67     "gl_image_stub.cc",
68     "gl_image_stub.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",
76     "gl_share_group.cc",
77     "gl_share_group.h",
78     "gl_state_restorer.cc",
79     "gl_state_restorer.h",
80     "gl_surface.cc",
81     "gl_surface.h",
82     "gl_surface_android.cc",
83     "gl_surface_mac.cc",
84     "gl_surface_osmesa.cc",
85     "gl_surface_osmesa.h",
86     "gl_surface_stub.cc",
87     "gl_surface_stub.h",
88     "gl_surface_win.cc",
89     "gl_switches.cc",
90     "gl_switches.h",
91     "gl_version_info.cc",
92     "gl_version_info.h",
93     "gpu_switching_manager.cc",
94     "gpu_switching_manager.h",
95     "gpu_timing.cc",
96     "gpu_timing.h",
97     "scoped_binders.cc",
98     "scoped_binders.h",
99     "scoped_make_current.cc",
100     "scoped_make_current.h",
101     "sync_control_vsync_provider.cc",
102     "sync_control_vsync_provider.h",
103   ]
105   defines = [ "GL_IMPLEMENTATION" ]
107   include_dirs = [
108     "//third_party/switfshader/include",
109     "//third_party/mesa/src/include",
110   ]
112   all_dependent_configs = [ ":gl_config" ]
114   public_configs = [ "//third_party/khronos:khronos_headers" ]
116   deps = [
117     "//base/third_party/dynamic_annotations",
118     "//skia",
119   ]
120   public_deps = [
121     "//base",
122     "//third_party/mesa:mesa_headers",
123     "//ui/events/platform",
124     "//ui/gfx",
125     "//ui/gfx/geometry",
126   ]
128   if (is_win || is_android || is_linux) {
129     sources += [
130       "egl_util.cc",
131       "egl_util.h",
132       "gl_bindings_autogen_egl.cc",
133       "gl_bindings_autogen_egl.h",
134       "gl_context_egl.cc",
135       "gl_context_egl.h",
136       "gl_fence_egl.cc",
137       "gl_fence_egl.h",
138       "gl_image_egl.cc",
139       "gl_image_egl.h",
140       "gl_surface_egl.cc",
141       "gl_surface_egl.h",
142     ]
143   }
144   if (is_android || is_linux) {
145     sources += [
146       "gl_implementation_osmesa.cc",
147       "gl_implementation_osmesa.h",
148     ]
149   }
150   if (is_linux) {
151     deps += [ "//third_party/libevent" ]
152     sources += [
153       "gl_image_linux_dma_buffer.cc",
154       "gl_image_linux_dma_buffer.h",
155     ]
156   }
157   if (use_x11) {
158     sources += [
159       "gl_bindings_autogen_glx.cc",
160       "gl_bindings_autogen_glx.h",
161       "gl_context_glx.cc",
162       "gl_context_glx.h",
163       "gl_context_x11.cc",
164       "gl_egl_api_implementation.cc",
165       "gl_egl_api_implementation.h",
166       "gl_glx_api_implementation.cc",
167       "gl_glx_api_implementation.h",
168       "gl_image_glx.cc",
169       "gl_image_glx.h",
170       "gl_implementation_x11.cc",
171       "gl_surface_glx.cc",
172       "gl_surface_glx.h",
173       "gl_surface_x11.cc",
174     ]
176     configs += [
177       "//build/config/linux:x11",
178       "//build/config/linux:xcomposite",
179       "//build/config/linux:xext",
180     ]
182     deps += [ "//ui/gfx/x" ]
183   }
184   if (is_win) {
185     sources += [
186       "angle_platform_impl.cc",
187       "angle_platform_impl.h",
188       "gl_bindings_autogen_wgl.cc",
189       "gl_bindings_autogen_wgl.h",
190       "gl_context_wgl.cc",
191       "gl_context_wgl.h",
192       "gl_egl_api_implementation.cc",
193       "gl_egl_api_implementation.h",
194       "gl_surface_wgl.cc",
195       "gl_surface_wgl.h",
196       "gl_wgl_api_implementation.cc",
197       "gl_wgl_api_implementation.h",
198     ]
200     libs = [ "dwmapi.lib" ]
201     ldflags = [ "/DELAYLOAD:dwmapi.dll" ]
203     data_deps = [
204       "//third_party/angle:libEGL",
205       "//third_party/angle:libGLESv2",
206       "//third_party/mesa:osmesa",
207     ]
208   }
209   if (is_mac) {
210     sources += [
211       "gl_context_cgl.cc",
212       "gl_context_cgl.h",
213       "gl_fence_apple.cc",
214       "gl_fence_apple.h",
215       "gl_image_io_surface.cc",
216       "gl_image_io_surface.h",
217       "scoped_cgl.cc",
218       "scoped_cgl.h",
219     ]
221     libs = [
222       "IOSurface.framework",
223       "OpenGL.framework",
224     ]
225   }
226   if (is_android) {
227     sources += [
228       "gl_egl_api_implementation.cc",
229       "gl_egl_api_implementation.h",
230       "gl_image_surface_texture.cc",
231       "gl_image_surface_texture.h",
232     ]
234     defines += [
235       "GL_GLEXT_PROTOTYPES",
236       "EGL_EGLEXT_PROTOTYPES",
237     ]
239     libs = [ "android" ]
241     deps += [
242       ":gl_jni_headers",
243       "//ui/android:ui_java",
244     ]
245   }
246   if (use_ozone) {
247     sources += [
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",
253     ]
254     deps += [
255       "//ui/ozone",
256       "//ui/ozone:ozone_base",
257     ]
258   }
261 source_set("gl_unittest_utils") {
262   testonly = true
263   sources = [
264     "gl_bindings_autogen_mock.cc",
265     "gl_bindings_autogen_mock.h",
266     "gl_mock.cc",
267     "gl_mock.h",
268     "gl_mock_autogen_gl.h",
269   ]
271   configs += [ "//third_party/khronos:khronos_headers" ]
273   deps = [
274     ":gl",
275     "//testing/gmock",
276   ]
279 if (is_android) {
280   generate_jar_jni("surface_jni_headers") {
281     jni_package = "ui/gl"
282     classes = [ "android/view/Surface.class" ]
283   }
285   generate_jni("gl_jni_headers") {
286     deps = [
287       ":surface_jni_headers",
288     ]
289     sources = [
290       "../android/java/src/org/chromium/ui/gl/SurfaceTextureListener.java",
291       "../android/java/src/org/chromium/ui/gl/SurfaceTexturePlatformWrapper.java",
292     ]
293     jni_package = "ui/gl"
294   }