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/linux/pkg_config.gni") | 5 import("//build/config/linux/pkg_config.gni") |
6 import("//build/config/ui.gni") | 6 import("//build/config/ui.gni") |
7 import("//testing/test.gni") | 7 import("//testing/test.gni") |
8 | 8 |
9 use_egl = is_win || is_android || is_linux | 9 use_egl = is_win || is_android || is_linux |
10 use_glx = use_x11 | 10 use_glx = use_x11 |
11 | 11 |
12 if (is_android) { | 12 if (is_android) { |
13 import("//build/config/android/config.gni") | 13 import("//build/config/android/config.gni") |
14 import("//build/config/android/rules.gni") | 14 import("//build/config/android/rules.gni") |
15 } | 15 } |
16 | 16 |
17 if (target_os == "chromeos") { | |
18 pkg_config("libdrm") { | |
19 packages = [ "libdrm" ] | |
20 } | |
21 } | |
22 | |
23 config("gl_config") { | 17 config("gl_config") { |
24 defines = [] | 18 defines = [] |
25 if (use_glx) { | 19 if (use_glx) { |
26 defines += [ | 20 defines += [ |
27 "GL_GLEXT_PROTOTYPES", | 21 "GL_GLEXT_PROTOTYPES", |
28 "USE_GLX", | 22 "USE_GLX", |
29 ] | 23 ] |
30 } | 24 } |
31 if (use_egl) { | 25 if (use_egl) { |
32 defines += [ "USE_EGL" ] | 26 defines += [ "USE_EGL" ] |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 deps = [ | 306 deps = [ |
313 "//testing/gtest", | 307 "//testing/gtest", |
314 ] | 308 ] |
315 | 309 |
316 if (use_x11) { | 310 if (use_x11) { |
317 configs += [ "//build/config/linux:x11" ] | 311 configs += [ "//build/config/linux:x11" ] |
318 deps += [ "//ui/platform_window/x11" ] | 312 deps += [ "//ui/platform_window/x11" ] |
319 } | 313 } |
320 } | 314 } |
321 | 315 |
| 316 source_set("run_all_unittests") { |
| 317 testonly = true |
| 318 |
| 319 sources = [ |
| 320 "test/run_all_unittests.cc", |
| 321 ] |
| 322 |
| 323 deps = [ |
| 324 "//base", |
| 325 ] |
| 326 |
| 327 public_deps = [ |
| 328 "//base/test:test_support", |
| 329 ] |
| 330 |
| 331 if (use_ozone) { |
| 332 deps += [ "//ui/ozone" ] |
| 333 } |
| 334 } |
| 335 |
322 test("gl_unittests") { | 336 test("gl_unittests") { |
323 sources = [ | 337 sources = [ |
324 "gl_api_unittest.cc", | 338 "gl_api_unittest.cc", |
325 "gl_image_ref_counted_memory_unittest.cc", | 339 "gl_image_ref_counted_memory_unittest.cc", |
326 "gl_image_shared_memory_unittest.cc", | 340 "gl_image_shared_memory_unittest.cc", |
327 "gl_version_info_unittest.cc", | 341 "gl_version_info_unittest.cc", |
328 "gpu_timing_unittest.cc", | 342 "gpu_timing_unittest.cc", |
329 "test/run_all_unittests.cc", | |
330 ] | 343 ] |
331 | 344 |
332 if (use_egl) { | 345 if (use_egl) { |
333 sources += [ | 346 sources += [ |
334 "egl_api_unittest.cc", | 347 "egl_api_unittest.cc", |
335 "test/egl_initialization_displays_unittest.cc", | 348 "test/egl_initialization_displays_unittest.cc", |
336 ] | 349 ] |
337 } | 350 } |
338 | 351 |
339 if (use_glx) { | 352 if (use_glx) { |
340 sources += [ "glx_api_unittest.cc" ] | 353 sources += [ "glx_api_unittest.cc" ] |
341 } | 354 } |
342 | 355 |
343 if (use_ozone) { | |
344 sources += [ "gl_image_ozone_native_pixmap_unittest.cc" ] | |
345 if (target_os == "chromeos" && target_cpu != "arm") { | |
346 sources += [ "gl_image_ozone_native_pixmap_drm_unittest.cc" ] | |
347 } | |
348 } | |
349 | |
350 if (is_mac) { | 356 if (is_mac) { |
351 sources += [ "gl_image_io_surface_unittest.cc" ] | 357 sources += [ "gl_image_io_surface_unittest.cc" ] |
352 libs = [ "IOSurface.framework" ] | 358 libs = [ "IOSurface.framework" ] |
353 } | 359 } |
354 | 360 |
355 if (is_win) { | 361 if (is_win) { |
356 sources += [ "wgl_api_unittest.cc" ] | 362 sources += [ "wgl_api_unittest.cc" ] |
357 } | 363 } |
358 | 364 |
359 include_dirs = [ "//third_party/khronos" ] | 365 include_dirs = [ "//third_party/khronos" ] |
360 | 366 |
361 deps = [ | 367 deps = [ |
362 ":gl", | 368 ":gl", |
363 ":gl_unittest_utils", | 369 ":gl_unittest_utils", |
| 370 ":run_all_unittests", |
364 ":test_support", | 371 ":test_support", |
365 "//base", | 372 "//base", |
366 "//base/test:test_support", | |
367 "//testing/gmock", | 373 "//testing/gmock", |
368 "//testing/gtest", | 374 "//testing/gtest", |
369 "//ui/gfx", | 375 "//ui/gfx", |
370 "//ui/gfx/geometry", | 376 "//ui/gfx/geometry", |
371 "//ui/gl/init", | 377 "//ui/gl/init", |
372 ] | 378 ] |
373 | 379 |
374 if (target_os == "chromeos") { | |
375 configs += [ ":libdrm" ] | |
376 } | |
377 | |
378 data_deps = [ | 380 data_deps = [ |
379 "//third_party/mesa:osmesa", | 381 "//third_party/mesa:osmesa", |
380 ] | 382 ] |
381 | |
382 if (use_ozone) { | |
383 deps += [ "//ui/ozone" ] | |
384 } | |
385 } | 383 } |
386 | 384 |
387 if (is_android) { | 385 if (is_android) { |
388 generate_jar_jni("surface_jni_headers") { | 386 generate_jar_jni("surface_jni_headers") { |
389 jni_package = "ui/gl" | 387 jni_package = "ui/gl" |
390 classes = [ "android/view/Surface.class" ] | 388 classes = [ "android/view/Surface.class" ] |
391 } | 389 } |
392 | 390 |
393 generate_jni("gl_jni_headers") { | 391 generate_jni("gl_jni_headers") { |
394 sources = [ | 392 sources = [ |
395 "../android/java/src/org/chromium/ui/gl/SurfaceTextureListener.java", | 393 "../android/java/src/org/chromium/ui/gl/SurfaceTextureListener.java", |
396 "../android/java/src/org/chromium/ui/gl/SurfaceTexturePlatformWrapper.java
", | 394 "../android/java/src/org/chromium/ui/gl/SurfaceTexturePlatformWrapper.java
", |
397 ] | 395 ] |
398 public_deps = [ | 396 public_deps = [ |
399 ":surface_jni_headers", | 397 ":surface_jni_headers", |
400 ] | 398 ] |
401 jni_package = "ui/gl" | 399 jni_package = "ui/gl" |
402 } | 400 } |
403 } | 401 } |
OLD | NEW |