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/scroller.cc",
32 "android/shared_device_display_info.cc",
33 "android/shared_device_display_info.h",
34 "android/view_configuration.cc",
35 "android/view_configuration.h",
36 "animation/animation.cc",
37 "animation/animation.h",
38 "animation/animation_container.cc",
39 "animation/animation_container.h",
40 "animation/animation_container_element.h",
41 "animation/animation_container_observer.h",
42 "animation/animation_delegate.h",
43 "animation/linear_animation.cc",
44 "animation/linear_animation.h",
45 "animation/multi_animation.cc",
46 "animation/multi_animation.h",
47 "animation/slide_animation.cc",
48 "animation/slide_animation.h",
49 "animation/throb_animation.cc",
50 "animation/throb_animation.h",
58 "canvas_notimplemented.cc",
60 "canvas_paint_mac.mm",
61 "canvas_paint_win.cc",
64 "canvas_skia_paint.h",
65 "codec/jpeg_codec.cc",
73 "color_profile_mac.mm",
74 "color_profile_win.cc",
79 "display_change_notifier.cc",
80 "display_change_notifier.h",
81 "display_observer.cc",
88 "font_fallback_linux.cc",
89 "font_fallback_mac.cc",
90 "font_fallback_win.cc",
91 "font_fallback_win.h",
96 "font_render_params_android.cc",
97 "font_render_params_linux.cc",
98 "font_render_params_win.cc",
99 "font_render_params.cc",
100 "font_render_params.h",
106 "gpu_memory_buffer.cc",
107 "gpu_memory_buffer.h",
110 "image/canvas_image_source.cc",
111 "image/canvas_image_source.h",
114 "image/image_family.cc",
115 "image/image_family.h",
116 "image/image_ios.mm",
117 "image/image_mac.mm",
118 "image/image_png_rep.cc",
119 "image/image_png_rep.h",
120 "image/image_skia.cc",
121 "image/image_skia.h",
122 "image/image_skia_operations.cc",
123 "image/image_skia_operations.h",
124 "image/image_skia_rep.cc",
125 "image/image_skia_rep.h",
126 "image/image_skia_source.h",
127 "image/image_skia_util_ios.h",
128 "image/image_skia_util_ios.mm",
129 "image/image_skia_util_mac.h",
130 "image/image_skia_util_mac.mm",
131 "image/image_util.cc",
132 "image/image_util.h",
133 "image/image_util_ios.mm",
134 "interpolated_transform.cc",
135 "interpolated_transform.h",
136 "linux_font_delegate.cc",
137 "linux_font_delegate.h",
138 "mac/coordinate_conversion.h",
139 "mac/coordinate_conversion.mm",
140 "mac/scoped_ns_disable_screen_updates.h",
141 "native_widget_types.h",
142 "nine_image_painter.cc",
143 "nine_image_painter.h",
152 "platform_font_android.cc",
153 "platform_font_ios.h",
154 "platform_font_ios.mm",
155 "platform_font_mac.h",
156 "platform_font_mac.mm",
157 "platform_font_win.cc",
158 "platform_font_win.h",
161 "range/range_mac.mm",
162 "range/range_win.cc",
164 "scoped_cg_context_save_gstate_mac.h",
165 "scoped_ns_graphics_context_save_gstate_mac.h",
166 "scoped_ns_graphics_context_save_gstate_mac.mm",
167 "scoped_ui_graphics_push_context_ios.h",
168 "scoped_ui_graphics_push_context_ios.mm",
179 "selection_model.cc",
181 "sequential_id_generator.cc",
182 "sequential_id_generator.h",
185 "skbitmap_operations.cc",
186 "skbitmap_operations.h",
191 "sys_color_change_listener.cc",
192 "sys_color_change_listener.h",
198 "text_utils_android.cc",
212 "win/scoped_set_map_mode.h",
213 "win/singleton_hwnd.cc",
214 "win/singleton_hwnd.h",
215 "win/window_impl.cc",
219 defines = [ "GFX_IMPLEMENTATION" ]
225 "//base:base_static",
226 "//base/third_party/dynamic_annotations",
228 "//third_party/harfbuzz-ng",
229 "//third_party/icu:icui18n",
230 "//third_party/icu:icuuc",
231 "//third_party/libpng",
232 "//third_party/zlib",
235 forward_dependent_configs_from = [ "//skia" ]
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 deps += [ ":gfx_jni_headers" ]
297 sources -= [ "canvas_notimplemented.cc" ]
303 "/wd4267", # TODO(jschuh): C4267: http://crbug.com/167187 size_t -> int.
304 "/wd4324", # Structure was padded due to __declspec(align()), which is
318 configs += [ "//build/config/linux:fontconfig" ]
324 "platform_font_ozone.cc",
330 "nine_image_painter.cc",
331 "nine_image_painter.h",
351 "platform_font_pango.cc",
352 "platform_font_pango.h",
354 configs += [ "//build/config/linux:pangocairo" ]
356 if (use_pango && use_ozone) {
358 "platform_font_ozone.cc",
363 # Looking for gfx_geometry? It's //ui/gfx/geometry:geometry
365 source_set("test_support") {
367 "test/fontconfig_util_linux.cc",
368 "test/fontconfig_util_linux.h",
371 "test/ui_cocoa_test_helper.h",
372 "test/ui_cocoa_test_helper.mm",
378 "//base/test:test_support",
385 # The cocoa files don't apply to iOS.
387 "test/ui_cocoa_test_helper.h",
388 "test/ui_cocoa_test_helper.mm",
392 configs += [ "//build/config/linux:fontconfig" ]
396 test("gfx_unittests") {
398 "geometry/box_unittest.cc",
399 "geometry/cubic_bezier_unittest.cc",
400 "geometry/insets_unittest.cc",
401 "geometry/matrix3_unittest.cc",
402 "geometry/point_unittest.cc",
403 "geometry/point3_unittest.cc",
404 "geometry/quad_unittest.cc",
405 "geometry/rect_unittest.cc",
406 "geometry/safe_integer_conversions_unittest.cc",
407 "geometry/size_unittest.cc",
408 "geometry/vector2d_unittest.cc",
409 "geometry/vector3d_unittest.cc",
410 "mac/coordinate_conversion_unittest.mm",
411 "range/range_unittest.cc",
412 "test/run_all_unittests.cc",
419 "//base/test:test_support",
423 "//ui/resources:ui_test_pak",
428 "font_render_params_linux_unittest.cc",
429 "platform_font_pango_unittest.cc",
432 "//build/config/linux:pangocairo",
433 "//build/config/linux:pangoft2",
439 generate_jni("gfx_jni_headers") {
441 "../android/java/src/org/chromium/ui/gfx/BitmapHelper.java",
442 "../android/java/src/org/chromium/ui/gfx/DeviceDisplayInfo.java",
443 "../android/java/src/org/chromium/ui/gfx/ViewConfigurationHelper.java",