Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / ui / gfx / gfx.gyp
blobc6bb8a5f96745747a2d17db210d94f48ce2cf3a4
1 # Copyright (c) 2013 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.
6   'variables': {
7     'chromium_code': 1,
8   },
9   'targets': [
10     {
11       'target_name': 'gfx_geometry',
12       'type': '<(component)',
13       'dependencies': [
14         '<(DEPTH)/base/base.gyp:base',
15       ],
16       'defines': [
17         'GFX_IMPLEMENTATION',
18       ],
19       'sources': [
20         'geometry/box_f.cc',
21         'geometry/box_f.h',
22         'geometry/cubic_bezier.cc',
23         'geometry/cubic_bezier.h',
24         'geometry/dip_util.cc',
25         'geometry/dip_util.h',
26         'geometry/insets.cc',
27         'geometry/insets.h',
28         'geometry/insets_base.h',
29         'geometry/insets_f.cc',
30         'geometry/insets_f.h',
31         'geometry/matrix3_f.cc',
32         'geometry/matrix3_f.h',
33         'geometry/point.cc',
34         'geometry/point.h',
35         'geometry/point3_f.cc',
36         'geometry/point3_f.h',
37         'geometry/point_conversions.cc',
38         'geometry/point_conversions.h',
39         'geometry/point_f.cc',
40         'geometry/point_f.h',
41         'geometry/quad_f.cc',
42         'geometry/quad_f.h',
43         'geometry/rect.cc',
44         'geometry/rect.h',
45         'geometry/rect_conversions.cc',
46         'geometry/rect_conversions.h',
47         'geometry/rect_f.cc',
48         'geometry/rect_f.h',
49         'geometry/safe_integer_conversions.h',
50         'geometry/scroll_offset.cc',
51         'geometry/scroll_offset.h',
52         'geometry/size.cc',
53         'geometry/size.h',
54         'geometry/size_conversions.cc',
55         'geometry/size_conversions.h',
56         'geometry/size_f.cc',
57         'geometry/size_f.h',
58         'geometry/vector2d.cc',
59         'geometry/vector2d.h',
60         'geometry/vector2d_conversions.cc',
61         'geometry/vector2d_conversions.h',
62         'geometry/vector2d_f.cc',
63         'geometry/vector2d_f.h',
64         'geometry/vector3d_f.cc',
65         'geometry/vector3d_f.h',
66       ],
67       'includes': [
68         '../../build/android/increase_size_for_speed.gypi',
69       ],
70     },
71     {
72       'target_name': 'gfx',
73       'type': '<(component)',
74       'dependencies': [
75         '<(DEPTH)/base/base.gyp:base',
76         '<(DEPTH)/base/base.gyp:base_i18n',
77         '<(DEPTH)/base/base.gyp:base_static',
78         '<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
79         '<(DEPTH)/skia/skia.gyp:skia',
80         '<(DEPTH)/third_party/harfbuzz-ng/harfbuzz.gyp:harfbuzz-ng',
81         '<(DEPTH)/third_party/icu/icu.gyp:icui18n',
82         '<(DEPTH)/third_party/icu/icu.gyp:icuuc',
83         '<(DEPTH)/third_party/libpng/libpng.gyp:libpng',
84         '<(DEPTH)/third_party/zlib/zlib.gyp:zlib',
85         'gfx_geometry',
86       ],
87       # text_elider.h includes ICU headers.
88       'export_dependent_settings': [
89         '<(DEPTH)/skia/skia.gyp:skia',
90         '<(DEPTH)/third_party/icu/icu.gyp:icui18n',
91         '<(DEPTH)/third_party/icu/icu.gyp:icuuc',
92       ],
93       'defines': [
94         'GFX_IMPLEMENTATION',
95       ],
96       'include_dirs': [
97         '<(DEPTH)/third_party/icu/source/common',
98       ],
99       'sources': [
100         'android/device_display_info.cc',
101         'android/device_display_info.h',
102         'android/gfx_jni_registrar.cc',
103         'android/gfx_jni_registrar.h',
104         'android/java_bitmap.cc',
105         'android/java_bitmap.h',
106         'android/shared_device_display_info.cc',
107         'android/shared_device_display_info.h',
108         'android/view_configuration.cc',
109         'android/view_configuration.h',
110         'animation/animation.cc',
111         'animation/animation.h',
112         'animation/animation_container.cc',
113         'animation/animation_container.h',
114         'animation/animation_container_element.h',
115         'animation/animation_container_observer.h',
116         'animation/animation_delegate.h',
117         'animation/linear_animation.cc',
118         'animation/linear_animation.h',
119         'animation/multi_animation.cc',
120         'animation/multi_animation.h',
121         'animation/slide_animation.cc',
122         'animation/slide_animation.h',
123         'animation/throb_animation.cc',
124         'animation/throb_animation.h',
125         'animation/tween.cc',
126         'animation/tween.h',
127         'break_list.h',
128         'blit.cc',
129         'blit.h',
130         'break_list.h',
131         'buffer_format_util.cc',
132         'buffer_format_util.h',
133         'canvas.cc',
134         'canvas.h',
135         'canvas_notimplemented.cc',
136         'canvas_paint_mac.h',
137         'canvas_paint_mac.mm',
138         'canvas_skia.cc',
139         'canvas_skia_paint.h',
140         'codec/jpeg_codec.cc',
141         'codec/jpeg_codec.h',
142         'codec/png_codec.cc',
143         'codec/png_codec.h',
144         'color_analysis.cc',
145         'color_analysis.h',
146         'color_profile.cc',
147         'color_profile.h',
148         'color_profile_mac.mm',
149         'color_profile_win.cc',
150         'color_utils.cc',
151         'color_utils.h',
152         'display.cc',
153         'display.h',
154         'display_change_notifier.cc',
155         'display_change_notifier.h',
156         'display_observer.cc',
157         'display_observer.h',
158         'favicon_size.cc',
159         'favicon_size.h',
160         'font.cc',
161         'font.h',
162         'font_fallback.h',
163         'font_fallback_linux.cc',
164         'font_fallback_mac.mm',
165         'font_fallback_win.cc',
166         'font_fallback_win.h',
167         'font_list.cc',
168         'font_list.h',
169         'font_list_impl.cc',
170         'font_list_impl.h',
171         'font_render_params.cc',
172         'font_render_params.h',
173         'font_render_params_android.cc',
174         'font_render_params_linux.cc',
175         'font_render_params_mac.cc',
176         'font_render_params_win.cc',
177         'generic_shared_memory_id.cc',
178         'generic_shared_memory_id.h',
179         'gfx_export.h',
180         'gfx_paths.cc',
181         'gfx_paths.h',
182         
183         'harfbuzz_font_skia.cc',
184         'harfbuzz_font_skia.h',
185         'hud_font.cc',
186         'hud_font.h',
187         'image/canvas_image_source.cc',
188         'image/canvas_image_source.h',
189         'image/image.cc',
190         'image/image.h',
191         'image/image_family.cc',
192         'image/image_family.h',
193         'image/image_ios.mm',
194         'image/image_mac.mm',
195         'image/image_png_rep.cc',
196         'image/image_png_rep.h',
197         'image/image_skia.cc',
198         'image/image_skia.h',
199         'image/image_skia_operations.cc',
200         'image/image_skia_operations.h',
201         'image/image_skia_rep.cc',
202         'image/image_skia_rep.h',
203         'image/image_skia_source.h',
204         'image/image_skia_util_ios.h',
205         'image/image_skia_util_ios.mm',
206         'image/image_skia_util_mac.h',
207         'image/image_skia_util_mac.mm',
208         'image/image_util.cc',
209         'image/image_util.h',
210         'image/image_util_ios.mm',
211         'interpolated_transform.cc',
212         'interpolated_transform.h',
213         'ios/NSString+CrStringDrawing.h',
214         'ios/NSString+CrStringDrawing.mm',
215         'ios/uikit_util.h',
216         'ios/uikit_util.mm',
217         'linux_font_delegate.cc',
218         'linux_font_delegate.h',
219         'mac/coordinate_conversion.h',
220         'mac/coordinate_conversion.mm',
221         'mac/nswindow_frame_controls.h',
222         'mac/nswindow_frame_controls.mm',
223         'mac/scoped_cocoa_disable_screen_updates.h',
224         'native_pixmap_handle_ozone.h',
225         'native_widget_types.h',
226         'nine_image_painter.cc',
227         'nine_image_painter.h',
228         'overlay_transform.h',
229         'paint_throbber.cc',
230         'paint_throbber.h',
231         'path.cc',
232         'path.h',
233         'path_win.cc',
234         'path_win.h',
235         'path_x11.cc',
236         'path_x11.h',
237         'platform_font.h',
238         'platform_font_android.cc',
239         'platform_font_ios.h',
240         'platform_font_ios.mm',
241         'platform_font_linux.cc',
242         'platform_font_linux.h',
243         'platform_font_mac.h',
244         'platform_font_mac.mm',
245         'platform_font_win.cc',
246         'platform_font_win.h',
247         'range/range.cc',
248         'range/range.h',
249         'range/range_f.cc',
250         'range/range_f.h',
251         'range/range_mac.mm',
252         'range/range_win.cc',
253         'render_text.cc',
254         'render_text.h',
255         'render_text_harfbuzz.cc',
256         'render_text_harfbuzz.h',
257         'render_text_mac.cc',
258         'render_text_mac.h',
259         'scoped_canvas.h',
260         'scoped_cg_context_save_gstate_mac.h',
261         'scoped_ns_graphics_context_save_gstate_mac.h',
262         'scoped_ns_graphics_context_save_gstate_mac.mm',
263         'scoped_ui_graphics_push_context_ios.h',
264         'scoped_ui_graphics_push_context_ios.mm',
265         'screen.cc',
266         'screen.h',
267         'screen_android.cc',
268         'screen_aura.cc',
269         'screen_ios.mm',
270         'screen_mac.mm',
271         'screen_win.cc',
272         'screen_win.h',
273         'scrollbar_size.cc',
274         'scrollbar_size.h',
275         'selection_model.cc',
276         'selection_model.h',
277         'sequential_id_generator.cc',
278         'sequential_id_generator.h',
279         'shadow_value.cc',
280         'shadow_value.h',
281         'skbitmap_operations.cc',
282         'skbitmap_operations.h',
283         'skia_util.cc',
284         'skia_util.h',
285         'swap_result.h',
286         'switches.cc',
287         'switches.h',
288         'text_constants.h',
289         'text_elider.cc',
290         'text_elider.h',
291         'text_utils.cc',
292         'text_utils.h',
293         'text_utils_android.cc',
294         'text_utils_ios.mm',
295         'text_utils_skia.cc',
296         'transform.cc',
297         'transform.h',
298         'transform_util.cc',
299         'transform_util.h',
300         'ui_gfx_exports.cc',
301         'utf16_indexing.cc',
302         'utf16_indexing.h',
303         'vsync_provider.h',
304         'win/direct_manipulation.cc',
305         'win/direct_manipulation.h',
306         'win/direct_write.cc',
307         'win/direct_write.h',
308         'win/dpi.cc',
309         'win/dpi.h',
310         'win/hwnd_util.cc',
311         'win/hwnd_util.h',
312         'win/metro_mode.cc',
313         'win/metro_mode.h',
314         'win/scoped_set_map_mode.h',
315         'win/singleton_hwnd.cc',
316         'win/singleton_hwnd.h',
317         'win/singleton_hwnd_observer.cc',
318         'win/singleton_hwnd_observer.h',
319         'win/window_impl.cc',
320         'win/window_impl.h',
321       ],
322       'includes': [
323         '../../build/android/increase_size_for_speed.gypi',
324       ],
325       'conditions': [
326         ['OS=="ios"', {
327           # Linkable dependents need to set the linker flag '-ObjC' in order to
328           # use the categories in this target (e.g. NSString+CrStringDrawing.h).
329           'link_settings': {
330             'xcode_settings': {'OTHER_LDFLAGS': ['-ObjC']},
331           },
332           'sources!': [
333             'blit.cc',
334             'blit.h',
335             'canvas.cc',
336             'canvas.h',
337             'canvas_notimplemented.cc',
338             'canvas_paint_mac.h',
339             'canvas_paint_mac.mm',
340             'canvas_skia.cc',
341             'canvas_skia_paint.h',
342             'codec/jpeg_codec.cc',
343           ],
344         }, {
345           'sources':[
346             'gpu_memory_buffer.cc',
347             'gpu_memory_buffer.h',
348           ],
349           'dependencies': [
350             '<(libjpeg_gyp_path):libjpeg',
351           ],
352         }],
353         # TODO(asvitkine): Switch all platforms to use canvas_skia.cc.
354         #                  http://crbug.com/105550
355         ['use_canvas_skia==1', {
356           'sources!': [
357             'canvas_notimplemented.cc',
358           ],
359         }, {  # use_canvas_skia!=1
360           'sources!': [
361             'canvas_skia.cc',
362           ],
363         }],
364         ['OS=="win"', {
365           'sources': [
366             'gdi_util.cc',
367             'gdi_util.h',
368             'icon_util.cc',
369             'icon_util.h',
370             'sys_color_change_listener.cc',
371             'sys_color_change_listener.h',
372           ],
373           # TODO(jschuh): C4267: http://crbug.com/167187 size_t -> int
374           # C4324 is structure was padded due to __declspec(align()), which is
375           # uninteresting.
376           'msvs_disabled_warnings': [ 4267, 4324 ],
377         }],
378         ['OS=="android"', {
379           'sources!': [
380             'animation/throb_animation.cc',
381             'selection_model.cc',
382           ],
383           'dependencies': [
384             'gfx_jni_headers',
385             '<(DEPTH)/base/base.gyp:base_java',
386           ],
387           'link_settings': {
388             'libraries': [
389               '-landroid',
390               '-ljnigraphics',
391             ],
392           },
393         }],
394         ['chromeos==1', {
395           # Chrome OS requires robust JPEG decoding for the login screen.
396           'sources': [
397             'chromeos/codec/jpeg_codec_robust_slow.cc',
398             'chromeos/codec/jpeg_codec_robust_slow.h',
399           ],
400           'dependencies': [
401             '<(libjpeg_ijg_gyp_path):libjpeg',
402           ],
403         }],
404         ['use_aura==0 and toolkit_views==0', {
405           'sources!': [
406             'nine_image_painter.cc',
407             'nine_image_painter.h',
408           ],
409         }],
410         ['OS=="android" and use_aura==0', {
411           'sources!': [
412             'path.cc',
413           ],
414         }],
415         ['OS=="android" and use_aura==1', {
416           'sources!': [
417             'screen_android.cc',
418           ],
419         }],
420         ['OS=="android" or OS=="ios"', {
421           'sources!': [
422             'harfbuzz_font_skia.cc',
423             'harfbuzz_font_skia.h',
424             'render_text.cc',
425             'render_text.h',
426             'render_text_harfbuzz.cc',
427             'render_text_harfbuzz.h',
428             'text_utils_skia.cc',
429           ],
430         }, {  # desktop platforms
431         }],
432         ['use_x11==1', {
433           'dependencies': [
434             '../../build/linux/system.gyp:x11',
435             'x/gfx_x11.gyp:gfx_x11',
436           ],
437         }],
438         ['use_cairo==1', {
439           'dependencies': [
440             '<(DEPTH)/build/linux/system.gyp:pangocairo',
441           ],
442         }],
443         ['desktop_linux==1 or chromeos==1', {
444           'dependencies': [
445             # font_render_params_linux.cc uses fontconfig
446             '<(DEPTH)/build/linux/system.gyp:fontconfig',
447           ],
448         }],
449       ],
450       'target_conditions': [
451         # Need 'target_conditions' to override default filename_rules to include
452         # the file on iOS.
453         ['OS == "ios"', {
454           'sources/': [
455             ['include', '^scoped_cg_context_save_gstate_mac\\.h$'],
456           ],
457         }],
458       ],
459     },
460     # Separate from gfx to limit the impact of the hard_dependency.
461     {
462       'target_name': 'gfx_vector_icons',
463       'type': '<(component)',
464       'dependencies': [
465         '<(DEPTH)/base/base.gyp:base',
466         '<(DEPTH)/skia/skia.gyp:skia',
467         'gfx',
468         'gfx_geometry',
469       ],
470       'defines': [
471         'GFX_IMPLEMENTATION',
472       ],
473       'sources': [
474         'paint_vector_icon.cc',
475         'paint_vector_icon.h',
476         'vector_icons_public.h',
477       ],
478       'variables': {
479         'vector_icons_cc_file': '<(INTERMEDIATE_DIR)/ui/gfx/vector_icons.cc',
480         'vector_icons_h_file': '<(SHARED_INTERMEDIATE_DIR)/ui/gfx/vector_icons.h',
481       },
482       'include_dirs': [
483         '<(SHARED_INTERMEDIATE_DIR)',
484       ],
485       'actions': [
486         {
487           # GN version: //ui/gfx:aggregate_vector_icons
488           'action_name': 'aggregate_vector_icons',
489           'inputs': [
490             'vector_icons/',
491           ],
492           'outputs': [
493             '<(vector_icons_cc_file)',
494             '<(vector_icons_h_file)',
495           ],
496           'action': [ 'python',
497                       'vector_icons/aggregate_vector_icons.py',
498                       '--working_directory=vector_icons/',
499                       '--output_cc=<(vector_icons_cc_file)',
500                       '--output_h=<(vector_icons_h_file)',
501           ],
502           'message': 'Aggregating vector resources.',
503           'process_outputs_as_sources': 1,
504         },
505       ],
506       # Export a hard dependency because of generated header files.
507       'hard_dependency': 1,
508     },
509     {
510       'target_name': 'gfx_test_support',
511       'type': 'static_library',
512       'sources': [
513         'image/image_unittest_util.cc',
514         'image/image_unittest_util.h',
515         'image/image_unittest_util_ios.mm',
516         'image/image_unittest_util_mac.mm',
517         'test/fontconfig_util_linux.cc',
518         'test/fontconfig_util_linux.h',
519         'test/gfx_util.cc',
520         'test/gfx_util.h',
521         'test/test_screen.h',
522         'test/test_screen.cc',
523         'test/ui_cocoa_test_helper.h',
524         'test/ui_cocoa_test_helper.mm',
525       ],
526       'dependencies': [
527         '../../base/base.gyp:base',
528         '../../skia/skia.gyp:skia',
529         '../../testing/gtest.gyp:gtest',
530       ],
531       'conditions': [
532         ['OS == "mac"', {
533           'link_settings': {
534             'libraries': [
535               '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
536             ],
537           },
538         }],
539         ['OS=="ios"', {
540           # The cocoa files don't apply to iOS.
541           'sources/': [
542             ['exclude', 'cocoa']
543           ],
544         }],
545         ['OS=="linux"', {
546           'dependencies': [
547             '../../build/linux/system.gyp:fontconfig',
548           ],
549         }],
550       ],
551     },
552   ],
553   'conditions': [
554     ['OS=="android"' , {
555      'targets': [
556        {
557          'target_name': 'gfx_jni_headers',
558          'type': 'none',
559          'sources': [
560            '../android/java/src/org/chromium/ui/gfx/BitmapHelper.java',
561            '../android/java/src/org/chromium/ui/gfx/DeviceDisplayInfo.java',
562            '../android/java/src/org/chromium/ui/gfx/ViewConfigurationHelper.java',
563          ],
564          'variables': {
565            'jni_gen_package': 'ui/gfx',
566          },
567          'includes': [ '../../build/jni_generator.gypi' ],
568        },
569      ],
570     }],
571   ],