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",
207 "win/direct_write.cc",
208 "win/direct_write.h",
213 "win/scoped_set_map_mode.h",
214 "win/singleton_hwnd.cc",
215 "win/singleton_hwnd.h",
216 "win/window_impl.cc",
220 defines = [ "GFX_IMPLEMENTATION" ]
225 "//base:base_static",
226 "//base/third_party/dynamic_annotations",
228 "//third_party/harfbuzz-ng",
229 "//third_party/libpng",
230 "//third_party/zlib",
239 # Text rendering conditions (complicated so separated out).
240 if (is_android || is_ios) {
241 # We don't support RenderText on these platforms.
243 # These text rendering files are supported everywhere text rendering is.
247 "render_text_harfbuzz.cc",
248 "render_text_harfbuzz.h",
249 "text_utils_skia.cc",
251 # These are the "native" rendering routines, only one should apply.
253 sources += [ "render_text_win.cc" ]
255 sources += [ "render_text_mac.cc" ]
256 } else if (use_pango) {
257 sources += [ "render_text_pango.cc" ]
258 } else if (use_ozone) {
259 sources += [ "render_text_ozone.cc" ]
266 "codec/jpeg_codec.cc",
267 "codec/jpeg_codec.h",
270 deps += [ "//third_party:jpeg" ]
276 "animation/throb_animation.cc",
278 "selection_model.cc",
282 sources -= [ "screen_android.cc" ]
284 sources -= [ "path.cc" ]
287 # TODO(GYP) re-enable when base_java exists.
288 #if (!is_android_webview_build) {
289 # deps += [ "//base:base_java" ]
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",
348 "//build/config/linux:x11",
360 "platform_font_pango.cc",
361 "platform_font_pango.h",
363 configs += [ "//build/config/linux:pangocairo" ]
365 if (use_pango && use_ozone) {
367 "platform_font_ozone.cc",
372 # Looking for gfx_geometry? It's //ui/gfx/geometry:geometry
374 source_set("test_support") {
377 "image/image_unittest_util.cc",
378 "image/image_unittest_util.h",
379 "image/image_unittest_util_ios.mm",
380 "image/image_unittest_util_mac.mm",
381 "test/fontconfig_util_linux.cc",
382 "test/fontconfig_util_linux.h",
385 "test/ui_cocoa_test_helper.h",
386 "test/ui_cocoa_test_helper.mm",
395 "//base/test:test_support",
402 # The cocoa files don't apply to iOS.
404 "test/ui_cocoa_test_helper.h",
405 "test/ui_cocoa_test_helper.mm",
409 configs += [ "//build/config/linux:fontconfig" ]
413 test("gfx_unittests") {
416 "image/image_skia_unittest.cc",
417 "image/image_unittest.cc",
418 "screen_unittest.cc",
419 "test/run_all_unittests.cc",
420 "text_elider_unittest.cc",
421 "text_utils_unittest.cc",
426 "animation/animation_container_unittest.cc",
427 "animation/animation_unittest.cc",
428 "animation/multi_animation_unittest.cc",
429 "animation/slide_animation_unittest.cc",
430 "animation/tween_unittest.cc",
432 "break_list_unittest.cc",
433 "canvas_unittest.cc",
434 "canvas_unittest_mac.mm",
435 "codec/jpeg_codec_unittest.cc",
436 "codec/png_codec_unittest.cc",
437 "color_analysis_unittest.cc",
438 "color_profile_mac_unittest.mm",
439 "color_utils_unittest.cc",
440 "display_change_notifier_unittest.cc",
441 "display_unittest.cc",
442 "font_list_unittest.cc",
443 "geometry/box_unittest.cc",
444 "geometry/cubic_bezier_unittest.cc",
445 "geometry/insets_unittest.cc",
446 "geometry/matrix3_unittest.cc",
447 "geometry/point_unittest.cc",
448 "geometry/point3_unittest.cc",
449 "geometry/quad_unittest.cc",
450 "geometry/r_tree_unittest.cc",
451 "geometry/rect_unittest.cc",
452 "geometry/safe_integer_conversions_unittest.cc",
453 "geometry/scroll_offset_unittest.cc",
454 "geometry/size_unittest.cc",
455 "geometry/vector2d_unittest.cc",
456 "geometry/vector3d_unittest.cc",
457 "mac/coordinate_conversion_unittest.mm",
458 "platform_font_mac_unittest.mm",
459 "range/range_mac_unittest.mm",
460 "range/range_unittest.cc",
461 "range/range_win_unittest.cc",
462 "render_text_unittest.cc",
463 "sequential_id_generator_unittest.cc",
464 "shadow_value_unittest.cc",
465 "skbitmap_operations_unittest.cc",
466 "skrect_conversion_unittest.cc",
467 "transform_util_unittest.cc",
468 "utf16_indexing_unittest.cc",
476 "//base/test:test_support",
478 "//third_party/icu:icuuc",
479 "//third_party/libpng",
480 "//third_party/zlib",
484 "//ui/resources:ui_test_pak",
489 "font_render_params_linux_unittest.cc",
490 "platform_font_pango_unittest.cc",
493 "//build/config/linux:pangocairo",
494 "//build/config/linux:pangoft2",
498 if (!is_mac && !is_ios) {
500 "transform_unittest.cc",
501 "interpolated_transform_unittest.cc",
505 if (use_ozone && !use_pango) {
507 "canvas_unittest.cc",
508 "font_list_unittest.cc",
510 "render_text_unittest.cc",
511 "text_elider_unittest.cc",
517 # Do not run display_change_notifier_unittest.cc on Android because it
518 # does not compile display_observer.cc
519 "display_change_notifier_unittest.cc",
523 #'../../testing/android/native_test.gyp:native_test_native_code', TODO(GYP)
527 if (is_android || is_ios) {
529 "render_text_unittest.cc",
535 "screen_unittest.cc",
541 "color_profile_win_unittest.cc",
542 "font_fallback_win_unittest.cc",
543 "icon_util_unittest.cc",
544 "icon_util_unittests.rc",
545 "platform_font_win_unittest.cc",
549 "/DELAYLOAD:d2d1.dll",
550 "/DELAYLOAD:d3d10_1.dll",
560 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
561 cflags = [ "/wd4267" ]
566 generate_jni("gfx_jni_headers") {
568 "../android/java/src/org/chromium/ui/gfx/BitmapHelper.java",
569 "../android/java/src/org/chromium/ui/gfx/DeviceDisplayInfo.java",
570 "../android/java/src/org/chromium/ui/gfx/ViewConfigurationHelper.java",