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:default_optimization" ]
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/apps.icon",
425 "vector_icons/autofill.icon",
426 "vector_icons/bar_close.1x.icon",
427 "vector_icons/bar_close.icon",
428 "vector_icons/blocked_badge.icon",
429 "vector_icons/check_circle.icon",
430 "vector_icons/code.icon",
431 "vector_icons/cookie.icon",
432 "vector_icons/crashed_tab.icon",
433 "vector_icons/extension.icon",
434 "vector_icons/file_download.icon",
435 "vector_icons/file_download_shelf.icon",
436 "vector_icons/find_next.1x.icon",
437 "vector_icons/find_next.icon",
438 "vector_icons/find_prev.1x.icon",
439 "vector_icons/find_prev.icon",
440 "vector_icons/folder.icon",
441 "vector_icons/folder_managed.icon",
442 "vector_icons/folder_supervised.icon",
443 "vector_icons/fullscreen.icon",
444 "vector_icons/globe.icon",
445 "vector_icons/help_outline.icon",
446 "vector_icons/image.icon",
447 "vector_icons/laptop.icon",
448 "vector_icons/location_on.icon",
449 "vector_icons/midi.icon",
450 "vector_icons/mixed_content.icon",
451 "vector_icons/mode_edit.icon",
452 "vector_icons/my_location.icon",
453 "vector_icons/notifications.icon",
454 "vector_icons/paintbrush.icon",
455 "vector_icons/photo_camera.icon",
456 "vector_icons/protocol_handler.icon",
457 "vector_icons/remove_box.icon",
458 "vector_icons/sad_tab.icon",
459 "vector_icons/smartphone.icon",
460 "vector_icons/star.icon",
461 "vector_icons/star_border.icon",
462 "vector_icons/supervisor_account.icon",
463 "vector_icons/tab.icon",
464 "vector_icons/tab_audio.1x.icon",
465 "vector_icons/tab_audio.icon",
466 "vector_icons/tab_audio_muting.1x.icon",
467 "vector_icons/tab_audio_muting.icon",
468 "vector_icons/tablet.icon",
469 "vector_icons/translate.icon",
470 "vector_icons/warning.icon",
471 "vector_icons/warning_badge.icon",
472 "vector_icons/web.icon",
475 vector_icons_cc_file,
480 "--working_directory=" + rebase_path("vector_icons/"),
481 "--output_cc=" + rebase_path(vector_icons_cc_file, root_build_dir),
482 "--output_h=" + rebase_path(vector_icons_h_file, root_build_dir),
486 # Looking for gfx_geometry? It's //ui/gfx/geometry:geometry
488 source_set("test_support") {
491 "image/image_unittest_util.cc",
492 "image/image_unittest_util.h",
493 "image/image_unittest_util_ios.mm",
494 "image/image_unittest_util_mac.mm",
495 "test/fontconfig_util_linux.cc",
496 "test/fontconfig_util_linux.h",
499 "test/test_screen.cc",
500 "test/test_screen.h",
501 "test/ui_cocoa_test_helper.h",
502 "test/ui_cocoa_test_helper.mm",
511 "//base/test:test_support",
518 # The cocoa files don't apply to iOS.
520 "test/ui_cocoa_test_helper.h",
521 "test/ui_cocoa_test_helper.mm",
525 configs += [ "//build/config/linux:fontconfig" ]
529 # TODO(GYP): Delete this after we've converted everything to GN.
530 # The _run targets exist only for compatibility w/ GYP.
531 group("gfx_unittests_run") {
538 test("gfx_unittests") {
540 "font_render_params_linux_unittest.cc",
542 "image/image_family_unittest.cc",
543 "image/image_ios_unittest.mm",
544 "image/image_skia_unittest.cc",
545 "image/image_unittest.cc",
546 "platform_font_linux_unittest.cc",
547 "screen_unittest.cc",
548 "test/run_all_unittests.cc",
549 "text_elider_unittest.cc",
550 "text_utils_unittest.cc",
555 "$root_out_dir/ui_test.pak",
560 "animation/animation_container_unittest.cc",
561 "animation/animation_unittest.cc",
562 "animation/multi_animation_unittest.cc",
563 "animation/slide_animation_unittest.cc",
564 "animation/tween_unittest.cc",
566 "break_list_unittest.cc",
567 "canvas_unittest.cc",
568 "canvas_unittest_mac.mm",
569 "codec/jpeg_codec_unittest.cc",
570 "codec/png_codec_unittest.cc",
571 "color_analysis_unittest.cc",
572 "color_profile_mac_unittest.mm",
573 "color_utils_unittest.cc",
574 "display_change_notifier_unittest.cc",
575 "display_unittest.cc",
576 "font_fallback_mac_unittest.cc",
577 "font_list_unittest.cc",
578 "geometry/box_unittest.cc",
579 "geometry/cubic_bezier_unittest.cc",
580 "geometry/insets_unittest.cc",
581 "geometry/matrix3_unittest.cc",
582 "geometry/point3_unittest.cc",
583 "geometry/point_unittest.cc",
584 "geometry/quad_unittest.cc",
585 "geometry/rect_unittest.cc",
586 "geometry/safe_integer_conversions_unittest.cc",
587 "geometry/scroll_offset_unittest.cc",
588 "geometry/size_unittest.cc",
589 "geometry/vector2d_unittest.cc",
590 "geometry/vector3d_unittest.cc",
591 "image/image_mac_unittest.mm",
592 "image/image_util_unittest.cc",
593 "mac/coordinate_conversion_unittest.mm",
594 "nine_image_painter_unittest.cc",
595 "platform_font_mac_unittest.mm",
596 "range/range_mac_unittest.mm",
597 "range/range_unittest.cc",
598 "range/range_win_unittest.cc",
599 "sequential_id_generator_unittest.cc",
600 "shadow_value_unittest.cc",
601 "skbitmap_operations_unittest.cc",
602 "skrect_conversion_unittest.cc",
603 "transform_util_unittest.cc",
604 "utf16_indexing_unittest.cc",
608 if (!is_android && !is_ios) {
609 sources += [ "render_text_unittest.cc" ]
612 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
613 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
619 "//base/test:test_support",
621 "//third_party/icu:icuuc",
622 "//third_party/libpng",
623 "//third_party/zlib",
627 "//ui/resources:ui_test_pak",
630 data_deps = [ "//ui/resources:ui_test_pak" ]
632 if (!is_mac && !is_ios) {
634 "interpolated_transform_unittest.cc",
635 "transform_unittest.cc",
641 # Do not run display_change_notifier_unittest.cc on Android because it
642 # does not compile display_observer.cc
643 "display_change_notifier_unittest.cc",
648 sources -= [ "screen_unittest.cc" ]
649 } else if (!is_ios) {
650 sources -= [ "nine_image_painter_unittest.cc" ]
654 sources += [ "chromeos/codec/jpeg_codec_robust_slow_unittest.cc" ]
659 "color_profile_win_unittest.cc",
660 "font_fallback_win_unittest.cc",
661 "icon_util_unittest.cc",
662 "icon_util_unittests.rc",
663 "path_win_unittest.cc",
664 "platform_font_win_unittest.cc",
668 "/DELAYLOAD:d2d1.dll",
669 "/DELAYLOAD:d3d10_1.dll",
682 generate_jni("gfx_jni_headers") {
684 "../android/java/src/org/chromium/ui/gfx/BitmapHelper.java",
685 "../android/java/src/org/chromium/ui/gfx/DeviceDisplayInfo.java",
686 "../android/java/src/org/chromium/ui/gfx/ViewConfigurationHelper.java",