OLD | NEW |
---|---|
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("//build/config/ui.gni") | 5 import("//build/config/ui.gni") |
6 import("//ui/ozone/ozone.gni") | |
6 import("//testing/test.gni") | 7 import("//testing/test.gni") |
7 | 8 |
9 use_egl = is_win || is_android || is_linux | |
rjkroege
2016/04/27 19:08:12
So: what do ozone configurations that are !ozone_p
kylechar
2016/04/27 19:36:32
They use EGL or osemsa. What do you mean made expl
| |
10 use_glx = use_x11 || ozone_platform_x11 | |
11 | |
8 if (is_android) { | 12 if (is_android) { |
9 import("//build/config/android/config.gni") | 13 import("//build/config/android/config.gni") |
10 import("//build/config/android/rules.gni") | 14 import("//build/config/android/rules.gni") |
11 } | 15 } |
12 | 16 |
13 config("gl_config") { | 17 config("gl_config") { |
14 if (use_x11) { | 18 defines = [] |
15 defines = [ "GL_GLEXT_PROTOTYPES" ] | 19 if (use_glx) { |
20 defines += [ | |
21 "GL_GLEXT_PROTOTYPES", | |
22 "USE_GLX", | |
23 ] | |
24 } | |
25 if (use_egl) { | |
26 defines += [ "USE_EGL" ] | |
16 } | 27 } |
17 } | 28 } |
18 | 29 |
19 component("gl") { | 30 component("gl") { |
20 output_name = "gl_wrapper" # Avoid colliding with OS X"s libGL.dylib. | 31 output_name = "gl_wrapper" # Avoid colliding with OS X"s libGL.dylib. |
21 | 32 |
22 sources = [ | 33 sources = [ |
23 "android/gl_jni_registrar.cc", | 34 "android/gl_jni_registrar.cc", |
24 "android/gl_jni_registrar.h", | 35 "android/gl_jni_registrar.h", |
25 "android/scoped_java_surface.cc", | 36 "android/scoped_java_surface.cc", |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
128 ] | 139 ] |
129 public_deps = [ | 140 public_deps = [ |
130 "//base", | 141 "//base", |
131 "//third_party/mesa:mesa_headers", | 142 "//third_party/mesa:mesa_headers", |
132 "//ui/base/", | 143 "//ui/base/", |
133 "//ui/events/platform", | 144 "//ui/events/platform", |
134 "//ui/gfx", | 145 "//ui/gfx", |
135 "//ui/gfx/geometry", | 146 "//ui/gfx/geometry", |
136 ] | 147 ] |
137 | 148 |
138 if (is_win || is_android || is_linux) { | 149 if (use_egl) { |
139 sources += [ | 150 sources += [ |
140 "egl_util.cc", | 151 "egl_util.cc", |
141 "egl_util.h", | 152 "egl_util.h", |
142 "gl_bindings_autogen_egl.cc", | 153 "gl_bindings_autogen_egl.cc", |
143 "gl_bindings_autogen_egl.h", | 154 "gl_bindings_autogen_egl.h", |
144 "gl_context_egl.cc", | 155 "gl_context_egl.cc", |
145 "gl_context_egl.h", | 156 "gl_context_egl.h", |
157 "gl_egl_api_implementation.cc", | |
158 "gl_egl_api_implementation.h", | |
146 "gl_fence_egl.cc", | 159 "gl_fence_egl.cc", |
147 "gl_fence_egl.h", | 160 "gl_fence_egl.h", |
148 "gl_image_egl.cc", | 161 "gl_image_egl.cc", |
149 "gl_image_egl.h", | 162 "gl_image_egl.h", |
150 "gl_surface_egl.cc", | 163 "gl_surface_egl.cc", |
151 "gl_surface_egl.h", | 164 "gl_surface_egl.h", |
152 ] | 165 ] |
153 } | 166 } |
154 if (is_android || is_linux) { | 167 if (is_android || is_linux) { |
155 sources += [ | 168 sources += [ |
156 "gl_implementation_osmesa.cc", | 169 "gl_implementation_osmesa.cc", |
157 "gl_implementation_osmesa.h", | 170 "gl_implementation_osmesa.h", |
158 ] | 171 ] |
159 } | 172 } |
160 if (!is_android) { # TODO(GYP) Enable on Android when osmesa links. | 173 if (!is_android) { # TODO(GYP) Enable on Android when osmesa links. |
161 deps += [ "//third_party/mesa:osmesa" ] | 174 deps += [ "//third_party/mesa:osmesa" ] |
162 } | 175 } |
163 if (use_x11) { | 176 if (use_x11) { |
164 sources += [ | 177 sources += [ |
178 "gl_context_x11.cc", | |
179 "gl_implementation_x11.cc", | |
180 "gl_surface_egl_x11.cc", | |
181 "gl_surface_egl_x11.h", | |
182 "gl_surface_x11.cc", | |
183 ] | |
184 | |
185 data_deps = [ | |
186 "//third_party/angle:libEGL", | |
187 "//third_party/angle:libGLESv2", | |
188 ] | |
189 } | |
190 if (use_ozone) { | |
191 sources += [ | |
192 "gl_context_ozone.cc", | |
193 "gl_image_ozone_native_pixmap.cc", | |
194 "gl_image_ozone_native_pixmap.h", | |
195 "gl_implementation_ozone.cc", | |
196 "gl_surface_ozone.cc", | |
197 ] | |
198 | |
199 deps += [ "//ui/ozone" ] | |
200 | |
201 if (ozone_platform_x11) { | |
202 deps += [ "//ui/events/platform/x11" ] | |
203 } | |
204 } | |
205 if (use_glx) { | |
206 sources += [ | |
165 "gl_bindings_autogen_glx.cc", | 207 "gl_bindings_autogen_glx.cc", |
166 "gl_bindings_autogen_glx.h", | 208 "gl_bindings_autogen_glx.h", |
167 "gl_context_glx.cc", | 209 "gl_context_glx.cc", |
168 "gl_context_glx.h", | 210 "gl_context_glx.h", |
169 "gl_context_x11.cc", | |
170 "gl_egl_api_implementation.cc", | |
171 "gl_egl_api_implementation.h", | |
172 "gl_glx_api_implementation.cc", | 211 "gl_glx_api_implementation.cc", |
173 "gl_glx_api_implementation.h", | 212 "gl_glx_api_implementation.h", |
174 "gl_image_glx.cc", | 213 "gl_image_glx.cc", |
175 "gl_image_glx.h", | 214 "gl_image_glx.h", |
176 "gl_implementation_x11.cc", | |
177 "gl_surface_egl_x11.cc", | |
178 "gl_surface_egl_x11.h", | |
179 "gl_surface_glx.cc", | 215 "gl_surface_glx.cc", |
180 "gl_surface_glx.h", | 216 "gl_surface_glx.h", |
181 "gl_surface_x11.cc", | |
182 ] | 217 ] |
183 | 218 |
184 configs += [ | 219 configs += [ |
185 "//build/config/linux:x11", | 220 "//build/config/linux:x11", |
186 "//build/config/linux:xcomposite", | 221 "//build/config/linux:xcomposite", |
187 "//build/config/linux:xext", | 222 "//build/config/linux:xext", |
188 ] | 223 ] |
189 | 224 |
190 deps += [ "//ui/gfx/x" ] | 225 deps += [ "//ui/gfx/x" ] |
191 data_deps = [ | |
192 "//third_party/angle:libEGL", | |
193 "//third_party/angle:libGLESv2", | |
194 ] | |
195 } | 226 } |
196 if (is_win) { | 227 if (is_win) { |
197 sources += [ | 228 sources += [ |
198 "angle_platform_impl.cc", | 229 "angle_platform_impl.cc", |
199 "angle_platform_impl.h", | 230 "angle_platform_impl.h", |
200 "gl_bindings_autogen_wgl.cc", | 231 "gl_bindings_autogen_wgl.cc", |
201 "gl_bindings_autogen_wgl.h", | 232 "gl_bindings_autogen_wgl.h", |
202 "gl_context_wgl.cc", | 233 "gl_context_wgl.cc", |
203 "gl_context_wgl.h", | 234 "gl_context_wgl.h", |
204 "gl_egl_api_implementation.cc", | |
205 "gl_egl_api_implementation.h", | |
206 "gl_surface_wgl.cc", | 235 "gl_surface_wgl.cc", |
207 "gl_surface_wgl.h", | 236 "gl_surface_wgl.h", |
208 "gl_wgl_api_implementation.cc", | 237 "gl_wgl_api_implementation.cc", |
209 "gl_wgl_api_implementation.h", | 238 "gl_wgl_api_implementation.h", |
210 "vsync_provider_win.cc", | 239 "vsync_provider_win.cc", |
211 "vsync_provider_win.h", | 240 "vsync_provider_win.h", |
212 ] | 241 ] |
213 | 242 |
214 libs = [ "dwmapi.lib" ] | 243 libs = [ "dwmapi.lib" ] |
215 ldflags = [ "/DELAYLOAD:dwmapi.dll" ] | 244 ldflags = [ "/DELAYLOAD:dwmapi.dll" ] |
(...skipping 19 matching lines...) Expand all Loading... | |
235 ] | 264 ] |
236 | 265 |
237 libs = [ | 266 libs = [ |
238 "IOSurface.framework", | 267 "IOSurface.framework", |
239 "OpenGL.framework", | 268 "OpenGL.framework", |
240 "Quartz.framework", | 269 "Quartz.framework", |
241 ] | 270 ] |
242 } | 271 } |
243 if (is_android) { | 272 if (is_android) { |
244 sources += [ | 273 sources += [ |
245 "gl_egl_api_implementation.cc", | |
246 "gl_egl_api_implementation.h", | |
247 "gl_image_surface_texture.cc", | 274 "gl_image_surface_texture.cc", |
248 "gl_image_surface_texture.h", | 275 "gl_image_surface_texture.h", |
249 ] | 276 ] |
250 | 277 |
251 defines += [ | 278 defines += [ |
252 "GL_GLEXT_PROTOTYPES", | 279 "GL_GLEXT_PROTOTYPES", |
253 "EGL_EGLEXT_PROTOTYPES", | 280 "EGL_EGLEXT_PROTOTYPES", |
254 ] | 281 ] |
255 | 282 |
256 libs = [ "android" ] | 283 libs = [ "android" ] |
257 | 284 |
258 deps += [ | 285 deps += [ |
259 ":gl_jni_headers", | 286 ":gl_jni_headers", |
260 "//ui/android:ui_java", | 287 "//ui/android:ui_java", |
261 ] | 288 ] |
262 } | 289 } |
263 if (use_ozone) { | |
264 sources += [ | |
265 "gl_context_ozone.cc", | |
266 "gl_egl_api_implementation.cc", | |
267 "gl_egl_api_implementation.h", | |
268 "gl_image_ozone_native_pixmap.cc", | |
269 "gl_image_ozone_native_pixmap.h", | |
270 "gl_implementation_ozone.cc", | |
271 "gl_surface_ozone.cc", | |
272 ] | |
273 deps += [ "//ui/ozone" ] | |
274 } | |
275 } | 290 } |
276 | 291 |
277 source_set("gl_unittest_utils") { | 292 source_set("gl_unittest_utils") { |
278 testonly = true | 293 testonly = true |
279 sources = [ | 294 sources = [ |
280 "gl_bindings_autogen_mock.cc", | 295 "gl_bindings_autogen_mock.cc", |
281 "gl_bindings_autogen_mock.h", | 296 "gl_bindings_autogen_mock.h", |
282 "gl_mock.cc", | 297 "gl_mock.cc", |
283 "gl_mock.h", | 298 "gl_mock.h", |
284 "gl_mock_autogen_gl.h", | 299 "gl_mock_autogen_gl.h", |
(...skipping 26 matching lines...) Expand all Loading... | |
311 | 326 |
312 public_deps = [ | 327 public_deps = [ |
313 ":gl", | 328 ":gl", |
314 ] | 329 ] |
315 deps = [ | 330 deps = [ |
316 "//testing/gtest", | 331 "//testing/gtest", |
317 ] | 332 ] |
318 | 333 |
319 if (use_x11) { | 334 if (use_x11) { |
320 configs += [ "//build/config/linux:x11" ] | 335 configs += [ "//build/config/linux:x11" ] |
321 deps += [ | 336 deps += [ "//ui/platform_window/x11" ] |
322 "//ui/gfx/x", | |
323 "//ui/platform_window/x11", | |
324 ] | |
325 } | 337 } |
326 } | 338 } |
327 | 339 |
328 test("gl_unittests") { | 340 test("gl_unittests") { |
329 sources = [ | 341 sources = [ |
330 "gl_api_unittest.cc", | 342 "gl_api_unittest.cc", |
331 "gl_image_ref_counted_memory_unittest.cc", | 343 "gl_image_ref_counted_memory_unittest.cc", |
332 "gl_image_shared_memory_unittest.cc", | 344 "gl_image_shared_memory_unittest.cc", |
333 "gpu_timing_unittest.cc", | 345 "gpu_timing_unittest.cc", |
334 "test/run_all_unittests.cc", | 346 "test/run_all_unittests.cc", |
335 ] | 347 ] |
336 | 348 |
337 if (is_win || is_android || is_linux) { | 349 if (use_egl) { |
338 sources += [ | 350 sources += [ |
339 "egl_api_unittest.cc", | 351 "egl_api_unittest.cc", |
340 "test/egl_initialization_displays_unittest.cc", | 352 "test/egl_initialization_displays_unittest.cc", |
341 ] | 353 ] |
342 } | 354 } |
343 | 355 |
344 if (use_x11) { | 356 if (use_glx) { |
345 sources += [ "glx_api_unittest.cc" ] | 357 sources += [ "glx_api_unittest.cc" ] |
346 } | 358 } |
347 | 359 |
348 if (use_ozone) { | 360 if (use_ozone) { |
349 sources += [ "gl_image_ozone_native_pixmap_unittest.cc" ] | 361 sources += [ "gl_image_ozone_native_pixmap_unittest.cc" ] |
350 } | 362 } |
351 | 363 |
352 if (is_mac) { | 364 if (is_mac) { |
353 sources += [ "gl_image_io_surface_unittest.cc" ] | 365 sources += [ "gl_image_io_surface_unittest.cc" ] |
354 } | 366 } |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
386 sources = [ | 398 sources = [ |
387 "../android/java/src/org/chromium/ui/gl/SurfaceTextureListener.java", | 399 "../android/java/src/org/chromium/ui/gl/SurfaceTextureListener.java", |
388 "../android/java/src/org/chromium/ui/gl/SurfaceTexturePlatformWrapper.java ", | 400 "../android/java/src/org/chromium/ui/gl/SurfaceTexturePlatformWrapper.java ", |
389 ] | 401 ] |
390 public_deps = [ | 402 public_deps = [ |
391 ":surface_jni_headers", | 403 ":surface_jni_headers", |
392 ] | 404 ] |
393 jni_package = "ui/gl" | 405 jni_package = "ui/gl" |
394 } | 406 } |
395 } | 407 } |
OLD | NEW |