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 import("//testing/test.gni")
9 import("//build/config/android/config.gni")
10 import("//build/config/android/rules.gni")
13 # Several targets want to include this header file, and some of them are
14 # child dependencies of "gfx". Therefore, we separate it out here so multiple
15 # targets can all have a dependency for header checking purposes without
16 # creating circular dependencies.
17 source_set("gfx_export") {
23 vector_icons_cc_file = "$target_gen_dir/vector_icons.cc"
24 vector_icons_h_file = "$target_gen_dir/vector_icons.h"
28 "android/device_display_info.cc",
29 "android/device_display_info.h",
30 "android/gfx_jni_registrar.cc",
31 "android/gfx_jni_registrar.h",
32 "android/java_bitmap.cc",
33 "android/java_bitmap.h",
34 "android/shared_device_display_info.cc",
35 "android/shared_device_display_info.h",
36 "android/view_configuration.cc",
37 "android/view_configuration.h",
38 "animation/animation.cc",
39 "animation/animation.h",
40 "animation/animation_container.cc",
41 "animation/animation_container.h",
42 "animation/animation_container_element.h",
43 "animation/animation_container_observer.h",
44 "animation/animation_delegate.h",
45 "animation/linear_animation.cc",
46 "animation/linear_animation.h",
47 "animation/multi_animation.cc",
48 "animation/multi_animation.h",
49 "animation/slide_animation.cc",
50 "animation/slide_animation.h",
51 "animation/throb_animation.cc",
52 "animation/throb_animation.h",
56 "buffer_format_util.cc",
57 "buffer_format_util.h",
58 "codec/jpeg_codec.cc",
66 "color_profile_mac.mm",
67 "color_profile_win.cc",
72 "display_change_notifier.cc",
73 "display_change_notifier.h",
74 "display_observer.cc",
81 "font_fallback_linux.cc",
82 "font_fallback_mac.mm",
83 "font_fallback_win.cc",
84 "font_fallback_win.h",
89 "font_render_params.cc",
90 "font_render_params.h",
91 "font_render_params_android.cc",
92 "font_render_params_linux.cc",
93 "font_render_params_mac.cc",
94 "font_render_params_win.cc",
97 "generic_shared_memory_id.cc",
98 "generic_shared_memory_id.h",
107 "image/image_family.cc",
108 "image/image_family.h",
109 "image/image_ios.mm",
110 "image/image_mac.mm",
111 "image/image_png_rep.cc",
112 "image/image_png_rep.h",
113 "image/image_skia.cc",
114 "image/image_skia.h",
115 "image/image_skia_rep.cc",
116 "image/image_skia_rep.h",
117 "image/image_skia_source.h",
118 "image/image_skia_util_ios.h",
119 "image/image_skia_util_ios.mm",
120 "image/image_skia_util_mac.h",
121 "image/image_skia_util_mac.mm",
122 "image/image_util.cc",
123 "image/image_util.h",
124 "image/image_util_ios.mm",
125 "interpolated_transform.cc",
126 "interpolated_transform.h",
127 "linux_font_delegate.cc",
128 "linux_font_delegate.h",
129 "mac/coordinate_conversion.h",
130 "mac/coordinate_conversion.mm",
131 "mac/nswindow_frame_controls.h",
132 "mac/nswindow_frame_controls.mm",
133 "mac/scoped_cocoa_disable_screen_updates.h",
134 "native_widget_types.h",
135 "nine_image_painter.cc",
136 "nine_image_painter.h",
144 "platform_font_android.cc",
145 "platform_font_ios.h",
146 "platform_font_ios.mm",
147 "platform_font_linux.cc",
148 "platform_font_linux.h",
149 "platform_font_mac.h",
150 "platform_font_mac.mm",
151 "platform_font_win.cc",
152 "platform_font_win.h",
157 "range/range_mac.mm",
158 "range/range_win.cc",
160 "scoped_cg_context_save_gstate_mac.h",
161 "scoped_ns_graphics_context_save_gstate_mac.h",
162 "scoped_ns_graphics_context_save_gstate_mac.mm",
163 "scoped_ui_graphics_push_context_ios.h",
164 "scoped_ui_graphics_push_context_ios.mm",
175 "selection_model.cc",
177 "sequential_id_generator.cc",
178 "sequential_id_generator.h",
181 "skbitmap_operations.cc",
182 "skbitmap_operations.h",
187 "sys_color_change_listener.cc",
188 "sys_color_change_listener.h",
194 "text_utils_android.cc",
204 "win/direct_manipulation.cc",
205 "win/direct_manipulation.h",
206 "win/direct_write.cc",
207 "win/direct_write.h",
214 "win/scoped_set_map_mode.h",
215 "win/singleton_hwnd.cc",
216 "win/singleton_hwnd.h",
217 "win/singleton_hwnd_observer.cc",
218 "win/singleton_hwnd_observer.h",
219 "win/window_impl.cc",
228 "canvas_notimplemented.cc",
229 "canvas_paint_mac.h",
230 "canvas_paint_mac.mm",
232 "canvas_skia_paint.h",
233 "gpu_memory_buffer.cc",
234 "gpu_memory_buffer.h",
235 "image/canvas_image_source.cc",
236 "image/canvas_image_source.h",
237 "image/image_skia_operations.cc",
238 "image/image_skia_operations.h",
245 "//build/config:precompiled_headers",
247 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
248 "//build/config/compiler:no_size_t_to_int_warning",
251 defines = [ "GFX_IMPLEMENTATION" ]
257 "//base:base_static",
258 "//base/third_party/dynamic_annotations",
260 "//third_party/harfbuzz-ng",
261 "//third_party/libpng",
262 "//third_party/zlib",
271 # Text rendering conditions (complicated so separated out).
272 if (use_aura || is_mac) {
273 # Mac doesn't use RenderTextHarfBuzz by default yet.
275 "harfbuzz_font_skia.cc",
276 "harfbuzz_font_skia.h",
277 "render_text_harfbuzz.cc",
278 "render_text_harfbuzz.h",
279 "render_text_mac.cc",
281 "text_utils_skia.cc",
291 # We don't support RenderText on these platforms.
294 if (is_android && use_aura) {
296 "platform_font_android.cc",
297 "text_utils_android.cc",
299 set_sources_assignment_filter([])
300 sources += [ "platform_font_linux.cc" ]
301 set_sources_assignment_filter(sources_assignment_filter)
307 "codec/jpeg_codec.cc",
308 "codec/jpeg_codec.h",
311 deps += [ "//third_party:jpeg" ]
318 "canvas_notimplemented.cc",
321 sources += [ "font_fallback_android.cc" ]
324 "animation/throb_animation.cc",
327 "selection_model.cc",
332 configs -= [ "//build/config/compiler:optimize" ]
333 configs += [ "//build/config/compiler:optimize_max" ]
344 } else if (!is_ios) {
345 sources -= [ "canvas_notimplemented.cc" ]
349 if (use_aura || (!is_ios && !is_android)) {
351 "paint_vector_icon.cc",
352 "paint_vector_icon.h",
353 "vector_icon_types.h",
354 "vector_icons_public.h",
355 vector_icons_cc_file,
358 deps += [ ":aggregate_vector_icons" ]
363 cflags = [ "/wd4324" ] # Structure was padded due to __declspec(align()), which is
371 "sys_color_change_listener.cc",
372 "sys_color_change_listener.h",
378 configs += [ "//build/config/linux:fontconfig" ]
383 # Robust JPEG decoding for the login screen.
385 "chromeos/codec/jpeg_codec_robust_slow.cc",
386 "chromeos/codec/jpeg_codec_robust_slow.h",
388 deps += [ "//third_party/libjpeg" ]
392 sources -= [ "screen_aura.cc" ]
393 if (!toolkit_views) {
395 "nine_image_painter.cc",
396 "nine_image_painter.h",
402 deps += [ "//ui/gfx/x" ]
403 configs += [ "//build/config/linux:x11" ]
405 sources -= [ "path_x11.cc" ]
409 sources += [ "native_pixmap_handle_ozone.h" ]
413 configs += [ "//build/config/linux:pangocairo" ]
417 # GYP version: ui/gfx/gfx.gyp:aggregate_vector_icons
418 action("aggregate_vector_icons") {
419 script = "vector_icons/aggregate_vector_icons.py"
421 "vector_icon_types.h",
422 "vector_icons/account_box.icon",
423 "vector_icons/account_child_invert.icon",
424 "vector_icons/blocked_badge.icon",
425 "vector_icons/check_circle.icon",
426 "vector_icons/code.icon",
427 "vector_icons/cookie.icon",
428 "vector_icons/extension.icon",
429 "vector_icons/file_download.icon",
430 "vector_icons/file_download_shelf.icon",
431 "vector_icons/find_close.1x.icon",
432 "vector_icons/find_close.icon",
433 "vector_icons/find_next.1x.icon",
434 "vector_icons/find_next.icon",
435 "vector_icons/find_prev.1x.icon",
436 "vector_icons/find_prev.icon",
437 "vector_icons/fullscreen.icon",
438 "vector_icons/help_outline.icon",
439 "vector_icons/image.icon",
440 "vector_icons/laptop.icon",
441 "vector_icons/location_on.icon",
442 "vector_icons/midi.icon",
443 "vector_icons/mixed_content.icon",
444 "vector_icons/mode_edit.icon",
445 "vector_icons/my_location.icon",
446 "vector_icons/notifications.icon",
447 "vector_icons/photo_camera.icon",
448 "vector_icons/remove_box.icon",
449 "vector_icons/smartphone.icon",
450 "vector_icons/supervisor_account.icon",
451 "vector_icons/tab.icon",
452 "vector_icons/tab_audio.1x.icon",
453 "vector_icons/tab_audio.icon",
454 "vector_icons/tab_audio_muting.1x.icon",
455 "vector_icons/tab_audio_muting.icon",
456 "vector_icons/tablet.icon",
457 "vector_icons/translate.icon",
458 "vector_icons/warning.icon",
459 "vector_icons/web.icon",
462 vector_icons_cc_file,
467 "--working_directory=" + rebase_path("vector_icons/"),
468 "--output_cc=" + rebase_path(vector_icons_cc_file, root_build_dir),
469 "--output_h=" + rebase_path(vector_icons_h_file, root_build_dir),
473 # Looking for gfx_geometry? It's //ui/gfx/geometry:geometry
475 source_set("test_support") {
478 "image/image_unittest_util.cc",
479 "image/image_unittest_util.h",
480 "image/image_unittest_util_ios.mm",
481 "image/image_unittest_util_mac.mm",
482 "test/fontconfig_util_linux.cc",
483 "test/fontconfig_util_linux.h",
486 "test/test_screen.cc",
487 "test/test_screen.h",
488 "test/ui_cocoa_test_helper.h",
489 "test/ui_cocoa_test_helper.mm",
498 "//base/test:test_support",
505 # The cocoa files don't apply to iOS.
507 "test/ui_cocoa_test_helper.h",
508 "test/ui_cocoa_test_helper.mm",
512 configs += [ "//build/config/linux:fontconfig" ]
516 # TODO(GYP): Delete this after we've converted everything to GN.
517 # The _run targets exist only for compatibility w/ GYP.
518 group("gfx_unittests_run") {
525 test("gfx_unittests") {
527 "font_render_params_linux_unittest.cc",
529 "image/image_family_unittest.cc",
530 "image/image_ios_unittest.mm",
531 "image/image_skia_unittest.cc",
532 "image/image_unittest.cc",
533 "platform_font_linux_unittest.cc",
534 "screen_unittest.cc",
535 "test/run_all_unittests.cc",
536 "text_elider_unittest.cc",
537 "text_utils_unittest.cc",
542 "$root_out_dir/ui_test.pak",
547 "animation/animation_container_unittest.cc",
548 "animation/animation_unittest.cc",
549 "animation/multi_animation_unittest.cc",
550 "animation/slide_animation_unittest.cc",
551 "animation/tween_unittest.cc",
553 "break_list_unittest.cc",
554 "canvas_unittest.cc",
555 "canvas_unittest_mac.mm",
556 "codec/jpeg_codec_unittest.cc",
557 "codec/png_codec_unittest.cc",
558 "color_analysis_unittest.cc",
559 "color_profile_mac_unittest.mm",
560 "color_utils_unittest.cc",
561 "display_change_notifier_unittest.cc",
562 "display_unittest.cc",
563 "font_fallback_mac_unittest.cc",
564 "font_list_unittest.cc",
565 "geometry/box_unittest.cc",
566 "geometry/cubic_bezier_unittest.cc",
567 "geometry/insets_unittest.cc",
568 "geometry/matrix3_unittest.cc",
569 "geometry/point3_unittest.cc",
570 "geometry/point_unittest.cc",
571 "geometry/quad_unittest.cc",
572 "geometry/rect_unittest.cc",
573 "geometry/safe_integer_conversions_unittest.cc",
574 "geometry/scroll_offset_unittest.cc",
575 "geometry/size_unittest.cc",
576 "geometry/vector2d_unittest.cc",
577 "geometry/vector3d_unittest.cc",
578 "image/image_mac_unittest.mm",
579 "image/image_util_unittest.cc",
580 "mac/coordinate_conversion_unittest.mm",
581 "nine_image_painter_unittest.cc",
582 "platform_font_mac_unittest.mm",
583 "range/range_mac_unittest.mm",
584 "range/range_unittest.cc",
585 "range/range_win_unittest.cc",
586 "sequential_id_generator_unittest.cc",
587 "shadow_value_unittest.cc",
588 "skbitmap_operations_unittest.cc",
589 "skrect_conversion_unittest.cc",
590 "transform_util_unittest.cc",
591 "utf16_indexing_unittest.cc",
595 if (!is_android && !is_ios) {
596 sources += [ "render_text_unittest.cc" ]
599 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
600 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
606 "//base/test:test_support",
608 "//third_party/icu:icuuc",
609 "//third_party/libpng",
610 "//third_party/zlib",
614 "//ui/resources:ui_test_pak",
617 data_deps = [ "//ui/resources:ui_test_pak" ]
619 if (!is_mac && !is_ios) {
621 "interpolated_transform_unittest.cc",
622 "transform_unittest.cc",
628 # Do not run display_change_notifier_unittest.cc on Android because it
629 # does not compile display_observer.cc
630 "display_change_notifier_unittest.cc",
635 sources -= [ "screen_unittest.cc" ]
636 } else if (!is_ios) {
637 sources -= [ "nine_image_painter_unittest.cc" ]
641 sources += [ "chromeos/codec/jpeg_codec_robust_slow_unittest.cc" ]
646 "color_profile_win_unittest.cc",
647 "font_fallback_win_unittest.cc",
648 "icon_util_unittest.cc",
649 "icon_util_unittests.rc",
650 "path_win_unittest.cc",
651 "platform_font_win_unittest.cc",
655 "/DELAYLOAD:d2d1.dll",
656 "/DELAYLOAD:d3d10_1.dll",
669 generate_jni("gfx_jni_headers") {
671 "../android/java/src/org/chromium/ui/gfx/BitmapHelper.java",
672 "../android/java/src/org/chromium/ui/gfx/DeviceDisplayInfo.java",
673 "../android/java/src/org/chromium/ui/gfx/ViewConfigurationHelper.java",