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 import("//ui/ozone/ozone.gni")
15 # Several targets want to include this header file, and some of them are
16 # child dependencies of "gfx". Therefore, we separate it out here so multiple
17 # targets can all have a dependency for header checking purposes without
18 # creating circular dependencies.
19 source_set("gfx_export") {
27 "android/device_display_info.cc",
28 "android/device_display_info.h",
29 "android/gfx_jni_registrar.cc",
30 "android/gfx_jni_registrar.h",
31 "android/java_bitmap.cc",
32 "android/java_bitmap.h",
33 "android/scroller.cc",
35 "android/shared_device_display_info.cc",
36 "android/shared_device_display_info.h",
37 "android/view_configuration.cc",
38 "android/view_configuration.h",
39 "animation/animation.cc",
40 "animation/animation.h",
41 "animation/animation_container.cc",
42 "animation/animation_container.h",
43 "animation/animation_container_element.h",
44 "animation/animation_container_observer.h",
45 "animation/animation_delegate.h",
46 "animation/linear_animation.cc",
47 "animation/linear_animation.h",
48 "animation/multi_animation.cc",
49 "animation/multi_animation.h",
50 "animation/slide_animation.cc",
51 "animation/slide_animation.h",
52 "animation/throb_animation.cc",
53 "animation/throb_animation.h",
63 "canvas_paint_mac.mm",
64 "canvas_paint_win.cc",
67 "canvas_skia_paint.h",
68 "codec/jpeg_codec.cc",
76 "color_profile_mac.mm",
77 "color_profile_win.cc",
82 "display_observer.cc",
88 "font_fallback_win.cc",
89 "font_fallback_win.h",
94 "font_render_params_android.cc",
95 "font_render_params_linux.cc",
96 "font_render_params_linux.h",
97 "font_smoothing_win.cc",
98 "font_smoothing_win.h",
104 "gpu_memory_buffer.cc",
105 "gpu_memory_buffer.h",
108 "image/canvas_image_source.cc",
109 "image/canvas_image_source.h",
112 "image/image_family.cc",
113 "image/image_family.h",
114 "image/image_ios.mm",
115 "image/image_mac.mm",
116 "image/image_png_rep.cc",
117 "image/image_png_rep.h",
118 "image/image_skia.cc",
119 "image/image_skia.h",
120 "image/image_skia_operations.cc",
121 "image/image_skia_operations.h",
122 "image/image_skia_rep.cc",
123 "image/image_skia_rep.h",
124 "image/image_skia_source.h",
125 "image/image_skia_util_ios.h",
126 "image/image_skia_util_ios.mm",
127 "image/image_skia_util_mac.h",
128 "image/image_skia_util_mac.mm",
129 "image/image_util.cc",
130 "image/image_util.h",
131 "image/image_util_ios.mm",
132 "interpolated_transform.cc",
133 "interpolated_transform.h",
134 "linux_font_delegate.cc",
135 "linux_font_delegate.h",
136 "mac/scoped_ns_disable_screen_updates.h",
137 "native_widget_types.h",
138 "nine_image_painter.cc",
139 "nine_image_painter.h",
148 "platform_font_android.cc",
149 "platform_font_ios.h",
150 "platform_font_ios.mm",
151 "platform_font_mac.h",
152 "platform_font_mac.mm",
153 "platform_font_win.cc",
154 "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",
208 "win/scoped_set_map_mode.h",
209 "win/singleton_hwnd.cc",
210 "win/singleton_hwnd.h",
211 "win/window_impl.cc",
215 defines = [ "GFX_IMPLEMENTATION" ]
221 "//base:base_static",
222 "//base/third_party/dynamic_annotations",
224 "//third_party/harfbuzz-ng",
225 "//third_party/icu:icui18n",
226 "//third_party/icu:icuuc",
227 "//third_party/libpng",
228 "//third_party/zlib",
232 # Text rendering conditions (complicated so separated out).
233 if (is_android || is_ios) {
234 # We don't support RenderText on these platforms.
236 # These text rendering files are supported everywhere text rendering is.
240 "render_text_harfbuzz.cc",
241 "render_text_harfbuzz.h",
242 "text_utils_skia.cc",
244 # These are the "native" rendering routines, only one should apply.
246 sources += [ "render_text_win.cc" ]
248 sources += [ "render_text_mac.cc" ]
249 } else if (use_pango) {
250 sources += [ "render_text_pango.cc" ]
251 } else if (use_ozone) {
252 sources += [ "render_text_ozone.cc" ]
259 "codec/jpeg_codec.cc",
260 "codec/jpeg_codec.h",
263 deps += [ "//third_party:jpeg" ]
269 "animation/throb_animation.cc",
271 "display_observer.cc",
272 "selection_model.cc",
276 sources -= [ "screen_android.cc" ]
278 sources -= [ "path.cc" ]
281 # TODO(GYP) re-enable when base_java exists.
282 #if (!is_android_webview_build) {
283 # deps += [ "//base:base_java" ]
286 deps += [ ":gfx_jni_headers" ]
296 "/wd4267", # TODO(jschuh): C4267: http://crbug.com/167187 size_t -> int.
297 "/wd4324", # Structure was padded due to __declspec(align()), which is
311 configs += [ "//build/config/linux:fontconfig" ]
317 "platform_font_ozone.cc",
318 "ozone/impl/file_surface_factory.cc",
319 "ozone/impl/file_surface_factory.h",
320 "ozone/surface_factory_ozone.cc",
321 "ozone/surface_factory_ozone.h",
322 "ozone/surface_ozone.h",
323 "ozone/overlay_candidates_ozone.cc",
324 "ozone/overlay_candidates_ozone.h",
327 if (use_ozone && ozone_platform_dri) {
329 "ozone/dri/dri_skbitmap.cc",
330 "ozone/dri/dri_skbitmap.h",
331 "ozone/dri/dri_surface.cc",
332 "ozone/dri/dri_surface.h",
333 "ozone/dri/dri_surface_factory.cc",
334 "ozone/dri/dri_surface_factory.h",
335 "ozone/dri/dri_vsync_provider.cc",
336 "ozone/dri/dri_vsync_provider.h",
337 "ozone/dri/dri_wrapper.cc",
338 "ozone/dri/dri_wrapper.h",
339 "ozone/dri/hardware_display_controller.cc",
340 "ozone/dri/hardware_display_controller.h",
342 configs += [ "//build/config/linux:dridrm" ]
347 "nine_image_painter.cc",
348 "nine_image_painter.h",
368 "platform_font_pango.cc",
369 "platform_font_pango.h",
371 configs += [ "//build/config/linux:pangocairo" ]
375 # Looking for gfx_geometry? It's //ui/gfx/geometry:geometry
377 source_set("gfx_test_support") {
381 "test/ui_cocoa_test_helper.h",
382 "test/ui_cocoa_test_helper.mm",
387 "//base/test:test_support",
393 # The cocoa files don't apply to iOS.
395 "test/ui_cocoa_test_helper.h",
396 "test/ui_cocoa_test_helper.mm",
401 test("gfx_unittests") {
403 "geometry/box_unittest.cc",
404 "geometry/cubic_bezier_unittest.cc",
405 "geometry/insets_unittest.cc",
406 "geometry/matrix3_unittest.cc",
407 "geometry/point_unittest.cc",
408 "geometry/point3_unittest.cc",
409 "geometry/quad_unittest.cc",
410 "geometry/rect_unittest.cc",
411 "geometry/safe_integer_conversions_unittest.cc",
412 "geometry/size_unittest.cc",
413 "geometry/vector2d_unittest.cc",
414 "geometry/vector3d_unittest.cc",
415 "range/range_unittest.cc",
421 "//base/test:run_all_unittests",
422 "//base/test:run_all_unittests",
429 generate_jni("gfx_jni_headers") {
431 "../android/java/src/org/chromium/ui/gfx/BitmapHelper.java",
432 "../android/java/src/org/chromium/ui/gfx/DeviceDisplayInfo.java",
433 "../android/java/src/org/chromium/ui/gfx/ViewConfigurationHelper.java",
440 component("gfx_x11") {
442 "x/x11_atom_cache.cc",
443 "x/x11_atom_cache.h",
444 "x/x11_connection.cc",
445 "x/x11_connection.h",
446 "x/x11_error_tracker.cc",
447 "x/x11_error_tracker.h",
454 defines = [ "GFX_IMPLEMENTATION" ]
455 configs += [ "//build/config/linux:x11" ]