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")
8 import("//build/config/android/config.gni")
9 import("//build/config/android/rules.gni")
12 # Several targets want to include this header file, and some of them are
13 # child dependencies of "gfx". Therefore, we separate it out here so multiple
14 # targets can all have a dependency for header checking purposes without
15 # creating circular dependencies.
16 source_set("gfx_export") {
24 "android/device_display_info.cc",
25 "android/device_display_info.h",
26 "android/gfx_jni_registrar.cc",
27 "android/gfx_jni_registrar.h",
28 "android/java_bitmap.cc",
29 "android/java_bitmap.h",
30 "android/shared_device_display_info.cc",
31 "android/shared_device_display_info.h",
32 "android/view_configuration.cc",
33 "android/view_configuration.h",
34 "animation/animation.cc",
35 "animation/animation.h",
36 "animation/animation_container.cc",
37 "animation/animation_container.h",
38 "animation/animation_container_element.h",
39 "animation/animation_container_observer.h",
40 "animation/animation_delegate.h",
41 "animation/linear_animation.cc",
42 "animation/linear_animation.h",
43 "animation/multi_animation.cc",
44 "animation/multi_animation.h",
45 "animation/slide_animation.cc",
46 "animation/slide_animation.h",
47 "animation/throb_animation.cc",
48 "animation/throb_animation.h",
56 "canvas_notimplemented.cc",
58 "canvas_paint_mac.mm",
59 "canvas_paint_win.cc",
62 "canvas_skia_paint.h",
63 "codec/jpeg_codec.cc",
71 "color_profile_mac.mm",
72 "color_profile_win.cc",
77 "display_change_notifier.cc",
78 "display_change_notifier.h",
79 "display_observer.cc",
86 "font_fallback_linux.cc",
87 "font_fallback_mac.cc",
88 "font_fallback_win.cc",
89 "font_fallback_win.h",
94 "font_render_params.cc",
95 "font_render_params.h",
96 "font_render_params_android.cc",
97 "font_render_params_linux.cc",
98 "font_render_params_mac.cc",
99 "font_render_params_win.cc",
105 "gpu_memory_buffer.cc",
106 "gpu_memory_buffer.h",
109 "image/canvas_image_source.cc",
110 "image/canvas_image_source.h",
113 "image/image_family.cc",
114 "image/image_family.h",
115 "image/image_ios.mm",
116 "image/image_mac.mm",
117 "image/image_png_rep.cc",
118 "image/image_png_rep.h",
119 "image/image_skia.cc",
120 "image/image_skia.h",
121 "image/image_skia_operations.cc",
122 "image/image_skia_operations.h",
123 "image/image_skia_rep.cc",
124 "image/image_skia_rep.h",
125 "image/image_skia_source.h",
126 "image/image_skia_util_ios.h",
127 "image/image_skia_util_ios.mm",
128 "image/image_skia_util_mac.h",
129 "image/image_skia_util_mac.mm",
130 "image/image_util.cc",
131 "image/image_util.h",
132 "image/image_util_ios.mm",
133 "interpolated_transform.cc",
134 "interpolated_transform.h",
135 "linux_font_delegate.cc",
136 "linux_font_delegate.h",
137 "mac/coordinate_conversion.h",
138 "mac/coordinate_conversion.mm",
139 "mac/scoped_ns_disable_screen_updates.h",
140 "native_widget_types.h",
141 "nine_image_painter.cc",
142 "nine_image_painter.h",
151 "platform_font_android.cc",
152 "platform_font_ios.h",
153 "platform_font_ios.mm",
154 "platform_font_mac.h",
155 "platform_font_mac.mm",
156 "platform_font_win.cc",
157 "platform_font_win.h",
160 "range/range_mac.mm",
161 "range/range_win.cc",
163 "scoped_cg_context_save_gstate_mac.h",
164 "scoped_ns_graphics_context_save_gstate_mac.h",
165 "scoped_ns_graphics_context_save_gstate_mac.mm",
166 "scoped_ui_graphics_push_context_ios.h",
167 "scoped_ui_graphics_push_context_ios.mm",
178 "selection_model.cc",
180 "sequential_id_generator.cc",
181 "sequential_id_generator.h",
184 "skbitmap_operations.cc",
185 "skbitmap_operations.h",
190 "sys_color_change_listener.cc",
191 "sys_color_change_listener.h",
197 "text_utils_android.cc",
211 "win/scoped_set_map_mode.h",
212 "win/singleton_hwnd.cc",
213 "win/singleton_hwnd.h",
214 "win/window_impl.cc",
218 defines = [ "GFX_IMPLEMENTATION" ]
223 "//base:base_static",
224 "//base/third_party/dynamic_annotations",
226 "//third_party/harfbuzz-ng",
227 "//third_party/libpng",
228 "//third_party/zlib",
237 # Text rendering conditions (complicated so separated out).
238 if (is_android || is_ios) {
239 # We don't support RenderText on these platforms.
241 # These text rendering files are supported everywhere text rendering is.
245 "render_text_harfbuzz.cc",
246 "render_text_harfbuzz.h",
247 "text_utils_skia.cc",
249 # These are the "native" rendering routines, only one should apply.
251 sources += [ "render_text_win.cc" ]
253 sources += [ "render_text_mac.cc" ]
254 } else if (use_pango) {
255 sources += [ "render_text_pango.cc" ]
256 } else if (use_ozone) {
257 sources += [ "render_text_ozone.cc" ]
264 "codec/jpeg_codec.cc",
265 "codec/jpeg_codec.h",
268 deps += [ "//third_party:jpeg" ]
274 "animation/throb_animation.cc",
276 "display_observer.cc",
277 "selection_model.cc",
281 sources -= [ "screen_android.cc" ]
283 sources -= [ "path.cc" ]
286 # TODO(GYP) re-enable when base_java exists.
287 #if (!is_android_webview_build) {
288 # deps += [ "//base:base_java" ]
291 # TODO(jdduke): Revisit optimization after gauging benefit, crbug/419051.
293 configs -= [ "//build/config/compiler:optimize" ]
294 configs += [ "//build/config/compiler:optimize_max" ]
297 deps += [ ":gfx_jni_headers" ]
303 sources -= [ "canvas_notimplemented.cc" ]
309 "/wd4267", # TODO(jschuh): C4267: http://crbug.com/167187 size_t -> int.
310 "/wd4324", # Structure was padded due to __declspec(align()), which is
324 configs += [ "//build/config/linux:fontconfig" ]
330 "platform_font_ozone.cc",
336 "nine_image_painter.cc",
337 "nine_image_painter.h",
357 "platform_font_pango.cc",
358 "platform_font_pango.h",
360 configs += [ "//build/config/linux:pangocairo" ]
362 if (use_pango && use_ozone) {
364 "platform_font_ozone.cc",
369 # Looking for gfx_geometry? It's //ui/gfx/geometry:geometry
371 source_set("test_support") {
374 "image/image_unittest_util.cc",
375 "image/image_unittest_util.h",
376 "image/image_unittest_util_ios.mm",
377 "image/image_unittest_util_mac.mm",
378 "test/fontconfig_util_linux.cc",
379 "test/fontconfig_util_linux.h",
382 "test/ui_cocoa_test_helper.h",
383 "test/ui_cocoa_test_helper.mm",
392 "//base/test:test_support",
399 # The cocoa files don't apply to iOS.
401 "test/ui_cocoa_test_helper.h",
402 "test/ui_cocoa_test_helper.mm",
406 configs += [ "//build/config/linux:fontconfig" ]
410 test("gfx_unittests") {
413 "image/image_skia_unittest.cc",
414 "image/image_unittest.cc",
415 "screen_unittest.cc",
416 "test/run_all_unittests.cc",
417 "text_elider_unittest.cc",
418 "text_utils_unittest.cc",
423 "animation/animation_container_unittest.cc",
424 "animation/animation_unittest.cc",
425 "animation/multi_animation_unittest.cc",
426 "animation/slide_animation_unittest.cc",
427 "animation/tween_unittest.cc",
429 "break_list_unittest.cc",
430 "canvas_unittest.cc",
431 "canvas_unittest_mac.mm",
432 "codec/jpeg_codec_unittest.cc",
433 "codec/png_codec_unittest.cc",
434 "color_analysis_unittest.cc",
435 "color_utils_unittest.cc",
436 "display_change_notifier_unittest.cc",
437 "display_unittest.cc",
438 "font_list_unittest.cc",
439 "geometry/box_unittest.cc",
440 "geometry/cubic_bezier_unittest.cc",
441 "geometry/insets_unittest.cc",
442 "geometry/matrix3_unittest.cc",
443 "geometry/point_unittest.cc",
444 "geometry/point3_unittest.cc",
445 "geometry/quad_unittest.cc",
446 "geometry/r_tree_unittest.cc",
447 "geometry/rect_unittest.cc",
448 "geometry/safe_integer_conversions_unittest.cc",
449 "geometry/scroll_offset_unittest.cc",
450 "geometry/size_unittest.cc",
451 "geometry/vector2d_unittest.cc",
452 "geometry/vector3d_unittest.cc",
453 "mac/coordinate_conversion_unittest.mm",
454 "platform_font_mac_unittest.mm",
455 "range/range_mac_unittest.mm",
456 "range/range_unittest.cc",
457 "range/range_win_unittest.cc",
458 "render_text_unittest.cc",
459 "sequential_id_generator_unittest.cc",
460 "shadow_value_unittest.cc",
461 "skbitmap_operations_unittest.cc",
462 "skrect_conversion_unittest.cc",
463 "transform_util_unittest.cc",
464 "utf16_indexing_unittest.cc",
472 "//base/test:test_support",
474 "//third_party/icu:icuuc",
475 "//third_party/libpng",
476 "//third_party/zlib",
480 "//ui/resources:ui_test_pak",
485 "font_render_params_linux_unittest.cc",
486 "platform_font_pango_unittest.cc",
489 "//build/config/linux:pangocairo",
490 "//build/config/linux:pangoft2",
494 if (!is_mac && !is_ios) {
496 "transform_unittest.cc",
497 "interpolated_transform_unittest.cc",
501 if (use_ozone && !use_pango) {
503 "canvas_unittest.cc",
504 "font_list_unittest.cc",
506 "render_text_unittest.cc",
507 "text_elider_unittest.cc",
513 # Do not run display_change_notifier_unittest.cc on Android because it
514 # does not compile display_observer.cc
515 "display_change_notifier_unittest.cc",
519 #'../../testing/android/native_test.gyp:native_test_native_code', TODO(GYP)
523 if (is_android || is_ios) {
525 "render_text_unittest.cc",
531 "screen_unittest.cc",
537 "color_profile_win_unittest.cc",
538 "font_fallback_win_unittest.cc",
539 "icon_util_unittest.cc",
540 "icon_util_unittests.rc",
541 "platform_font_win_unittest.cc",
545 "/DELAYLOAD:d2d1.dll",
546 "/DELAYLOAD:d3d10_1.dll",
556 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
557 cflags = [ "/wd4267" ]
562 generate_jni("gfx_jni_headers") {
564 "../android/java/src/org/chromium/ui/gfx/BitmapHelper.java",
565 "../android/java/src/org/chromium/ui/gfx/DeviceDisplayInfo.java",
566 "../android/java/src/org/chromium/ui/gfx/ViewConfigurationHelper.java",