[Android] Expose FaviconService to Java for the Native NTP.
[chromium-blink-merge.git] / skia / skia.gyp
blob3b5fb947099b940bb876969639842ccf83467dec
1 # Copyright (c) 2012 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   'targets': [
7     {
8       'target_name': 'skia',
9       'type': '<(component)',
10       'variables': {
11         'conditions': [
12           ['OS== "ios"', {
13             'skia_support_gpu': 0,
14           }, {
15             'skia_support_gpu': 1,
16           }],
17         ],
19         'optimize': 'max',
21         # These two set the paths so we can include skia/gyp/core.gypi
22         'skia_src_path': '../third_party/skia/src',
23         'skia_include_path': '../third_party/skia/include',
24       },
26       'includes': [
27         '../third_party/skia/gyp/core.gypi',
28         '../third_party/skia/gyp/effects.gypi',
29       ],
31       'sources': [
32         # this should likely be moved into src/utils in skia
33         '../third_party/skia/src/core/SkFlate.cpp',
34         # We don't want to add this to Skia's core.gypi since it is
35         # Android only. Include it here and remove it for everyone
36         # but Android later.
37         '../third_party/skia/src/core/SkPaintOptionsAndroid.cpp',
39         '../third_party/skia/src/ports/SkImageDecoder_empty.cpp',
40         #'../third_party/skia/src/images/bmpdecoderhelper.cpp',
41         #'../third_party/skia/src/images/bmpdecoderhelper.h',
42         #'../third_party/skia/src/images/SkFDStream.cpp',
43         #'../third_party/skia/src/images/SkImageDecoder.cpp',
44         #'../third_party/skia/src/images/SkImageDecoder_FactoryDefault.cpp',
45         #'../third_party/skia/src/images/SkImageDecoder_FactoryRegistrar.cpp',
46         #'../third_party/skia/src/images/SkImageDecoder_fpdfemb.cpp',
47         #'../third_party/skia/src/images/SkImageDecoder_libbmp.cpp',
48         #'../third_party/skia/src/images/SkImageDecoder_libgif.cpp',
49         #'../third_party/skia/src/images/SkImageDecoder_libico.cpp',
50         #'../third_party/skia/src/images/SkImageDecoder_libjpeg.cpp',
51         #'../third_party/skia/src/images/SkImageDecoder_libpng.cpp',
52         #'../third_party/skia/src/images/SkImageDecoder_libpvjpeg.cpp',
53         #'../third_party/skia/src/images/SkImageDecoder_wbmp.cpp',
54         #'../third_party/skia/src/images/SkImageEncoder.cpp',
55         #'../third_party/skia/src/images/SkImageEncoder_Factory.cpp',
56         #'../third_party/skia/src/images/SkImageRef.cpp',
57         #'../third_party/skia/src/images/SkImageRefPool.cpp',
58         #'../third_party/skia/src/images/SkImageRefPool.h',
59         #'../third_party/skia/src/images/SkImageRef_GlobalPool.cpp',
60         #'../third_party/skia/src/images/SkMovie.cpp',
61         #'../third_party/skia/src/images/SkMovie_gif.cpp',
62         '../third_party/skia/src/images/SkScaledBitmapSampler.cpp',
63         '../third_party/skia/src/images/SkScaledBitmapSampler.h',
65         '../third_party/skia/src/opts/opts_check_SSE2.cpp',
67         '../third_party/skia/src/pdf/SkPDFCatalog.cpp',
68         '../third_party/skia/src/pdf/SkPDFCatalog.h',
69         '../third_party/skia/src/pdf/SkPDFDevice.cpp',
70         '../third_party/skia/src/pdf/SkPDFDocument.cpp',
71         '../third_party/skia/src/pdf/SkPDFFont.cpp',
72         '../third_party/skia/src/pdf/SkPDFFont.h',
73         '../third_party/skia/src/pdf/SkPDFFormXObject.cpp',
74         '../third_party/skia/src/pdf/SkPDFFormXObject.h',
75         '../third_party/skia/src/pdf/SkPDFGraphicState.cpp',
76         '../third_party/skia/src/pdf/SkPDFGraphicState.h',
77         '../third_party/skia/src/pdf/SkPDFImage.cpp',
78         '../third_party/skia/src/pdf/SkPDFImage.h',
79         '../third_party/skia/src/pdf/SkPDFImageStream.cpp',
80         '../third_party/skia/src/pdf/SkPDFImageStream.h',
81         '../third_party/skia/src/pdf/SkPDFPage.cpp',
82         '../third_party/skia/src/pdf/SkPDFPage.h',
83         '../third_party/skia/src/pdf/SkPDFShader.cpp',
84         '../third_party/skia/src/pdf/SkPDFShader.h',
85         '../third_party/skia/src/pdf/SkPDFStream.cpp',
86         '../third_party/skia/src/pdf/SkPDFStream.h',
87         '../third_party/skia/src/pdf/SkPDFTypes.cpp',
88         '../third_party/skia/src/pdf/SkPDFTypes.h',
89         '../third_party/skia/src/pdf/SkPDFUtils.cpp',
90         '../third_party/skia/src/pdf/SkPDFUtils.h',
92         #'../third_party/skia/src/ports/SkPurgeableMemoryBlock_android.cpp',
93         #'../third_party/skia/src/ports/SkPurgeableMemoryBlock_mac.cpp',
94         '../third_party/skia/src/ports/SkPurgeableMemoryBlock_none.cpp',
96         '../third_party/skia/src/ports/SkFontConfigInterface_android.cpp',
97         #'../third_party/skia/src/ports/SkFontHost_FONTPATH.cpp',
98         '../third_party/skia/src/ports/SkFontHost_FreeType.cpp',
99         '../third_party/skia/src/ports/SkFontHost_FreeType_common.cpp',
100         '../third_party/skia/src/ports/SkFontHost_FreeType_common.h',
101         '../third_party/skia/src/ports/SkFontConfigParser_android.cpp',
102         #'../third_party/skia/src/ports/SkFontHost_ascender.cpp',
103         #'../third_party/skia/src/ports/SkFontHost_linux.cpp',
104         '../third_party/skia/src/ports/SkFontHost_mac.cpp',
105         #'../third_party/skia/src/ports/SkFontHost_none.cpp',
106         '../third_party/skia/src/ports/SkFontHost_win.cpp',
107         '../third_party/skia/src/ports/SkGlobalInitialization_chromium.cpp',
108         #'../third_party/skia/src/ports/SkImageDecoder_CG.cpp',
109         #'../third_party/skia/src/ports/SkImageDecoder_empty.cpp',
110         #'../third_party/skia/src/ports/SkImageRef_ashmem.cpp',
111         #'../third_party/skia/src/ports/SkImageRef_ashmem.h',
112         #'../third_party/skia/src/ports/SkOSEvent_android.cpp',
113         #'../third_party/skia/src/ports/SkOSEvent_dummy.cpp',
114         '../third_party/skia/src/ports/SkOSFile_posix.cpp',
115         '../third_party/skia/src/ports/SkOSFile_stdio.cpp',
116         '../third_party/skia/src/ports/SkOSFile_win.cpp', 
117         #'../third_party/skia/src/ports/SkThread_none.cpp',
118         '../third_party/skia/src/ports/SkThread_pthread.cpp',
119         '../third_party/skia/src/ports/SkThread_win.cpp',
120         '../third_party/skia/src/ports/SkTime_Unix.cpp',
121         #'../third_party/skia/src/ports/SkXMLParser_empty.cpp',
122         #'../third_party/skia/src/ports/SkXMLParser_expat.cpp',
123         #'../third_party/skia/src/ports/SkXMLParser_tinyxml.cpp',
124         #'../third_party/skia/src/ports/SkXMLPullParser_expat.cpp',
126         '../third_party/skia/src/sfnt/SkOTUtils.cpp',
127         '../third_party/skia/src/sfnt/SkOTUtils.h',
129         '../third_party/skia/include/utils/mac/SkCGUtils.h',
130         '../third_party/skia/include/utils/SkDeferredCanvas.h',
131         '../third_party/skia/include/utils/SkMatrix44.h',
132         '../third_party/skia/src/utils/mac/SkCreateCGImageRef.cpp',
133         '../third_party/skia/src/utils/SkBase64.cpp',
134         '../third_party/skia/src/utils/SkBase64.h',
135         '../third_party/skia/src/utils/SkBitSet.cpp',
136         '../third_party/skia/src/utils/SkBitSet.h',
137         '../third_party/skia/src/utils/SkDeferredCanvas.cpp',
138         '../third_party/skia/src/utils/SkMatrix44.cpp',
139         '../third_party/skia/src/utils/SkNullCanvas.cpp',
140         '../third_party/skia/include/utils/SkNWayCanvas.h',
141         '../third_party/skia/src/utils/SkNWayCanvas.cpp',
142         '../third_party/skia/src/utils/SkPictureUtils.cpp',
143         '../third_party/skia/src/utils/SkRTConf.cpp',
144         '../third_party/skia/include/utils/SkRTConf.h',
145         '../third_party/skia/include/pdf/SkPDFDevice.h',
146         '../third_party/skia/include/pdf/SkPDFDocument.h',
148         '../third_party/skia/include/ports/SkTypeface_win.h',
150         #'../third_party/skia/include/images/SkImageDecoder.h',
151         #'../third_party/skia/include/images/SkImageEncoder.h',
152         '../third_party/skia/include/images/SkImageRef.h',
153         '../third_party/skia/include/images/SkImageRef_GlobalPool.h',
154         '../third_party/skia/include/images/SkMovie.h',
155         '../third_party/skia/include/images/SkPageFlipper.h',
157         '../third_party/skia/include/utils/SkNullCanvas.h',
158         '../third_party/skia/include/utils/SkPictureUtils.h',
159         'ext/analysis_canvas.cc',
160         'ext/analysis_canvas.h',
161         'ext/bitmap_platform_device.h',
162         'ext/bitmap_platform_device_android.cc',
163         'ext/bitmap_platform_device_android.h',
164         'ext/bitmap_platform_device_data.h',
165         'ext/bitmap_platform_device_linux.cc',
166         'ext/bitmap_platform_device_linux.h',
167         'ext/bitmap_platform_device_mac.cc',
168         'ext/bitmap_platform_device_mac.h',
169         'ext/bitmap_platform_device_win.cc',
170         'ext/bitmap_platform_device_win.h',
171         'ext/convolver.cc',
172         'ext/convolver.h',
173         'ext/google_logging.cc',
174         'ext/image_operations.cc',
175         'ext/image_operations.h',
176         'ext/lazy_pixel_ref.cc',
177         'ext/lazy_pixel_ref.h',
178         'ext/lazy_pixel_ref_utils.cc',
179         'ext/lazy_pixel_ref_utils.h',
180         'ext/SkThread_chrome.cc',
181         'ext/paint_simplifier.cc',
182         'ext/paint_simplifier.h',
183         'ext/platform_canvas.cc',
184         'ext/platform_canvas.h',
185         'ext/platform_device.cc',
186         'ext/platform_device.h',
187         'ext/platform_device_linux.cc',
188         'ext/platform_device_mac.cc',
189         'ext/platform_device_win.cc',
190         'ext/recursive_gaussian_convolution.cc',
191         'ext/recursive_gaussian_convolution.h',
192         'ext/refptr.h',
193         'ext/SkMemory_new_handler.cpp',
194         'ext/skia_trace_shim.h',
195         'ext/skia_utils_base.cc',
196         'ext/skia_utils_base.h',
197         'ext/skia_utils_ios.mm',
198         'ext/skia_utils_ios.h',
199         'ext/skia_utils_mac.mm',
200         'ext/skia_utils_mac.h',
201         'ext/skia_utils_win.cc',
202         'ext/skia_utils_win.h',
203         'ext/vector_canvas.cc',
204         'ext/vector_canvas.h',
205         'ext/vector_platform_device_emf_win.cc',
206         'ext/vector_platform_device_emf_win.h',
207         'ext/vector_platform_device_skia.cc',
208         'ext/vector_platform_device_skia.h',
209       ],
210       'include_dirs': [
211         '..',
212         'config',
213         '../third_party/skia/include/config',
214         '../third_party/skia/include/core',
215         '../third_party/skia/include/effects',
216         '../third_party/skia/include/images',
217         '../third_party/skia/include/lazy',
218         '../third_party/skia/include/pathops',
219         '../third_party/skia/include/pdf',
220         '../third_party/skia/include/pipe',
221         '../third_party/skia/include/ports',
222         '../third_party/skia/include/utils',
223         '../third_party/skia/src/core',
224         '../third_party/skia/src/image',
225         '../third_party/skia/src/sfnt',
226         '../third_party/skia/src/utils',
227         '../third_party/skia/src/lazy',
228       ],
229       'msvs_disabled_warnings': [4244, 4267, 4341, 4345, 4390, 4554, 4748, 4800],
230       'defines': [
231         #'SK_GAMMA_SRGB',
232         #'SK_GAMMA_APPLY_TO_A8',
233         'SK_BUILD_NO_IMAGE_ENCODE',
234         'GR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"',
235         'GR_STATIC_RECT_VB=1',
236         'GR_AGGRESSIVE_SHADER_OPTS=1',
237         'SK_DEFERRED_CANVAS_USES_GPIPE=1',
238         'SK_ENABLE_INST_COUNT=0',
240         # this flag can be removed entirely once this has baked for a while
241         'SK_ALLOW_OVER_32K_BITMAPS',
243         # skia uses static initializers to initialize the serialization logic
244         # of its "pictures" library. This is currently not used in chrome; if
245         # it ever gets used the processes that use it need to call
246         # SkGraphics::Init().
247         'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0',
249         # Disable this check because it is too strict for some Chromium-specific
250         # subclasses of SkPixelRef. See bug: crbug.com/171776.
251         'SK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK',
253         'IGNORE_ROT_AA_RECT_OPT',
254       ],
255       'sources!': [
256         '../third_party/skia/include/core/SkTypes.h',
257       ],
258       'conditions': [
259         ['skia_support_gpu != 0', {
260           'includes': [
261             '../third_party/skia/gyp/gpu.gypi',
262           ],
263           'sources': [
264             '<@(skgpu_sources)',
265           ],
266           'include_dirs': [
267             '../third_party/skia/include/gpu',
268             '../third_party/skia/include/gpu/gl',
269             '../third_party/skia/src/gpu',
270           ],
271         }, {  # skia_support_gpu == 0
272           'defines': [
273             'SK_SUPPORT_GPU=0',
274           ],
275         }],
276         ['release_valgrind_build == 1', {
277           'defines': [
278             'SK_DEBUG_PATH_REF=1',
279           ],
280           'direct_dependent_settings': {
281             'defines': [
282               'SK_DEBUG_PATH_REF=1',
283             ],
284           },
285         }],
286         #Settings for text blitting, chosen to approximate the system browser.
287         [ 'OS == "linux"', {
288           'defines': [
289             'SK_GAMMA_EXPONENT=1.2',
290             'SK_GAMMA_CONTRAST=0.2',
291           ],
292         }],
293         ['OS == "android"', {
294           'defines': [
295             'SK_GAMMA_APPLY_TO_A8',
296             'SK_GAMMA_EXPONENT=1.4',
297             'SK_GAMMA_CONTRAST=0.0',
298           ],
299         }],
300         ['OS == "win"', {
301           'defines': [
302             'SK_GAMMA_SRGB',
303             'SK_GAMMA_CONTRAST=0.5',
304           ],
305         }],
306         ['OS == "mac"', {
307           'defines': [
308             'SK_GAMMA_SRGB',
309             'SK_GAMMA_CONTRAST=0.0',
310           ],
311         }],
313         # For POSIX platforms, prefer the Mutex implementation provided by Skia
314         # since it does not generate static initializers.
315         [ 'OS == "android" or OS == "linux" or OS == "mac" or OS == "ios"', {
316           'defines+': [
317             'SK_USE_POSIX_THREADS',
318           ],
319           'direct_dependent_settings': {
320             'defines': [
321               'SK_USE_POSIX_THREADS',
322             ],
323           },
324           'sources!': [
325             'ext/SkThread_chrome.cc',
326           ],
327         }],
328         [ 'OS != "android"', {
329           'sources/': [
330             ['exclude', '_android\\.(cc|cpp)$'],
331           ],
332           'sources!': [
333             '../third_party/skia/src/core/SkPaintOptionsAndroid.cpp',
334           ],
335           'defines': [
336             'SK_DEFAULT_FONT_CACHE_LIMIT=(20*1024*1024)',
337           ],
338         }],
339         [ 'OS != "ios"', {
340           'sources/': [
341             ['exclude', '_ios\\.(cc|cpp|mm?)$'],
342           ],
343           'dependencies': [
344             '<(DEPTH)/third_party/WebKit/Source/WebKit/chromium/skia_webkit.gyp:skia_webkit',
345           ],
346         }],
347         [ 'OS != "mac"', {
348           'sources/': [
349             ['exclude', '_mac\\.(cc|cpp|mm?)$'],
350             ['exclude', '/mac/']
351           ],
352         }],
353         [ 'OS != "win"', {
354           'sources/': [ ['exclude', '_win\\.(cc|cpp)$'] ],
355         }],
356         [ 'target_arch == "arm" and arm_version >= 7 and arm_neon == 1', {
357           'defines': [
358             '__ARM_HAVE_NEON',
359           ],
360         }],
361         [ 'target_arch == "arm" and arm_version >= 7 and arm_neon_optional == 1', {
362           'defines': [
363             '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
364           ],
365         }],
366         [ 'OS == "android" and target_arch == "arm"', {
367           'sources': [
368             '../third_party/skia/src/core/SkUtilsArm.cpp',
369           ],
370           'includes': [
371             '../build/android/cpufeatures.gypi',
372           ],
373         }],
374         [ 'target_arch == "arm" or target_arch == "mipsel"', {
375           'sources!': [
376             '../third_party/skia/src/opts/opts_check_SSE2.cpp'
377           ],
378         }],
379         [ 'use_glib == 1', {
380           'dependencies': [
381             '../build/linux/system.gyp:fontconfig',
382             '../build/linux/system.gyp:freetype2',
383             '../build/linux/system.gyp:pangocairo',
384             '../third_party/icu/icu.gyp:icuuc',
385           ],
386           'cflags': [
387             '-Wno-unused',
388             '-Wno-unused-function',
389           ],
390           'sources': [
391             '../third_party/skia/src/fonts/SkFontMgr_fontconfig.cpp',
392             '../third_party/skia/src/ports/SkFontHost_fontconfig.cpp',
393             '../third_party/skia/src/ports/SkFontConfigInterface_direct.cpp',
394           ],
395           'defines': [
396 #            'SK_USE_COLOR_LUMINANCE',
397           ],
398         }],
399         [ 'use_glib == 0 and OS != "android"', {
400           'sources/': [ ['exclude', '_linux\\.(cc|cpp)$'] ],
401           'sources!': [
402             '../third_party/skia/src/ports/SkFontHost_FreeType.cpp',
403             '../third_party/skia/src/ports/SkFontHost_FreeType_common.cpp',
404           ],
405         }],
406         [ 'toolkit_uses_gtk == 1', {
407           'dependencies': [
408             '../build/linux/system.gyp:gdk',
409           ],
410         }, {  # toolkit_uses_gtk == 0
411           'sources/': [ ['exclude', '_gtk\\.(cc|cpp)$'] ],
412         }],
413         [ 'OS == "android"', {
414           'sources': [
415             '../third_party/skia/src/ports/SkFontHost_fontconfig.cpp',
416           ],
417           'sources/': [
418             ['exclude', '_linux\\.(cc|cpp)$'],
419           ],
420           'conditions': [
421             [ '_toolset == "target"', {
422               'defines': [
423                 'HAVE_PTHREADS',
424                 'OS_ANDROID',
425                 'SK_BUILD_FOR_ANDROID',
426                 # Android devices are typically more memory constrained, so
427                 # use a smaller glyph cache.
428                 'SK_DEFAULT_FONT_CACHE_LIMIT=(8*1024*1024)',
429                 'USE_CHROMIUM_SKIA',
430               ],
431               'dependencies': [
432                 '../third_party/expat/expat.gyp:expat',
433                 '../third_party/freetype/freetype.gyp:ft2',
434                 'skia_opts'
435               ],
436               'dependencies!': [
437                 # Android doesn't use Skia's PDF generation, which is what uses
438                 # sfntly.
439                 '../third_party/sfntly/sfntly.gyp:sfntly',
440               ],
441               # This exports a hard dependency because it needs to run its
442               # symlink action in order to expose the skia header files.
443               'hard_dependency': 1,
444               'include_dirs': [
445                 '../third_party/expat/files/lib',
446               ],
447               'sources/': [
448                 ['include', 'ext/platform_device_linux\\.cc$'],
449                 ['exclude', '../third_party/skia/src/pdf/'],
450               ],
451               'sources!': [
452                 'ext/vector_platform_device_skia.cc',
453               ],
454             }],
455             [ '_toolset == "target" and android_webview_build == 0', {
456               'defines': [
457                 'HAVE_ENDIAN_H',
458               ],
459             }],
460             [ '_toolset=="host" and host_os=="linux"', {
461               'sources': [
462                 'ext/platform_device_linux.cc',
463               ],
464             }],
465           ],
466         }],
467         [ 'OS == "ios"', {
468           'defines': [
469             'SK_BUILD_FOR_IOS',
470             'SK_USE_MAC_CORE_TEXT',
471           ],
472           'include_dirs': [
473             '../third_party/skia/include/utils/ios',
474             '../third_party/skia/include/utils/mac',
475           ],
476           'link_settings': {
477             'libraries': [
478               '$(SDKROOT)/System/Library/Frameworks/ImageIO.framework',
479             ],
480           },
481           'dependencies': [
482             'skia_opts_ios',
483           ],
484           'dependencies!': [
485             'skia_opts',
486             '../third_party/sfntly/sfntly.gyp:sfntly',
487           ],
488           'sources': [
489             # This file is used on both iOS and Mac, so it should be removed
490             #  from the ios and mac conditions and moved into the main sources
491             #  list.
492             '../third_party/skia/src/utils/mac/SkStream_mac.cpp',
493           ],
494           'sources/': [
495             ['exclude', '/pdf/'],
496             ['exclude', '^ext/vector_platform_device_skia\\.'],
497             ['exclude', 'opts_check_SSE2\\.cpp$'],
498           ],
499         }],
500         [ 'OS == "mac"', {
501           'defines': [
502             'SK_BUILD_FOR_MAC',
503             'SK_USE_MAC_CORE_TEXT',
504 #           'SK_USE_COLOR_LUMINANCE',
505           ],
506           'include_dirs': [
507             '../third_party/skia/include/utils/mac',
508           ],
509           'link_settings': {
510             'libraries': [
511               '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
512             ],
513           },
514           'sources': [
515             '../third_party/skia/src/utils/mac/SkStream_mac.cpp',
516           ],
517         }],
518         [ 'OS == "win"', {
519           'defines': [
520             'SK_GDI_ALWAYS_USE_TEXTMETRICS_FOR_FONT_METRICS'
521           ],
522           'sources!': [
523             '../third_party/skia/src/ports/SkOSFile_posix.cpp',
524             '../third_party/skia/src/ports/SkThread_pthread.cpp',
525             '../third_party/skia/src/ports/SkTime_Unix.cpp',
526             'ext/SkThread_chrome.cc',
527           ],
528           'include_dirs': [
529             'config/win',
530           ],
531           'direct_dependent_settings': {
532             'include_dirs': [
533               'config/win',
534             ],
535           },
536         }],
537         ['component=="shared_library"', {
538           'defines': [
539             'GR_DLL=1',
540             'GR_IMPLEMENTATION=1',
541             'SKIA_DLL',
542             'SKIA_IMPLEMENTATION=1',
543           ],
544           'dependencies': [
545             '../base/base.gyp:base',
546           ],
547           'direct_dependent_settings': {
548             'defines': [
549               'GR_DLL',
550               'SKIA_DLL',
551             ],
552           },
553         }],
554         # TODO(scottmg): http://crbug.com/177306
555         ['clang==1', {
556           'xcode_settings': {
557             'WARNING_CFLAGS!': [
558               # Don't warn about string->bool used in asserts.
559               '-Wstring-conversion',
560             ],
561           },
562           'cflags!': [
563             '-Wstring-conversion',
564           ],
565         }],
566       ],
567       'dependencies': [
568         'skia_opts',
569         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
570         '../third_party/sfntly/sfntly.gyp:sfntly',
571         '../third_party/zlib/zlib.gyp:zlib',
572       ],
573       'direct_dependent_settings': {
574         'include_dirs': [
575           'config',
577           #temporary until we can hide SkFontHost
578           '../third_party/skia/src/core',
580           '../third_party/skia/include/config',
581           '../third_party/skia/include/core',
582           '../third_party/skia/include/effects',
583           '../third_party/skia/include/pdf',
584           '../third_party/skia/include/gpu',
585           '../third_party/skia/include/gpu/gl',
586           '../third_party/skia/include/pathops',
587           '../third_party/skia/include/pipe',
588           '../third_party/skia/include/ports',
589           '../third_party/skia/include/utils',
590           'ext',
591         ],
592         'defines': [
593           'SK_BUILD_NO_IMAGE_ENCODE',
594           'SK_DEFERRED_CANVAS_USES_GPIPE=1',
595           'GR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"',
596           'GR_AGGRESSIVE_SHADER_OPTS=1',
597           'SK_ENABLE_INST_COUNT=0',
598         ],
599         'conditions': [
600           ['OS=="android"', {
601             'dependencies!': [
602               'skia_opts',
603               '../third_party/zlib/zlib.gyp:zlib',
604             ],
605             'defines': [
606               # Don't use non-NDK available stuff.
607               'SK_BUILD_FOR_ANDROID',
608             ],
609             'conditions': [
610               [ '_toolset == "target" and android_webview_build == 0', {
611                 'defines': [
612                   'HAVE_ENDIAN_H',
613                 ],
614               }],
615             ],
616           }],
617           ['OS=="mac"', {
618             'include_dirs': [
619               '../third_party/skia/include/utils/mac',
620             ],
621           }],
622         ],
623       },
624       'target_conditions': [
625         # Pull in specific Mac files for iOS (which have been filtered out
626         # by file name rules).
627         [ 'OS == "ios"', {
628           'sources/': [
629             ['include', 'SkFontHost_mac\\.cpp$',],
630             ['include', 'SkStream_mac\\.cpp$',],
631             ['include', 'SkCreateCGImageRef\\.cpp$',],
632           ],
633         }],
634       ],
635     },
637     # Due to an unfortunate intersection of lameness between gcc and gyp,
638     # we have to build the *_SSE2.cpp files in a separate target.  The
639     # gcc lameness is that, in order to compile SSE2 intrinsics code, it
640     # must be passed the -msse2 flag.  However, with this flag, it may
641     # emit SSE2 instructions even for scalar code, such as the CPUID
642     # test used to test for the presence of SSE2.  So that, and all other
643     # code must be compiled *without* -msse2.  The gyp lameness is that it
644     # does not allow file-specific CFLAGS, so we must create this extra
645     # target for those files to be compiled with -msse2.
646     #
647     # This is actually only a problem on 32-bit Linux (all Intel Macs have
648     # SSE2, Linux x86_64 has SSE2 by definition, and MSC will happily emit
649     # SSE2 from instrinsics, which generating plain ol' 386 for everything
650     # else).  However, to keep the .gyp file simple and avoid platform-specific
651     # build breakage, we do this on all platforms.
653     # For about the same reason, we need to compile the ARM opts files
654     # separately as well.
655     {
656       'target_name': 'skia_opts',
657       'type': 'static_library',
658       'variables': {
659         'optimize': 'max',
660       },
661       'include_dirs': [
662         '..',
663         'config',
664         '../third_party/skia/include/config',
665         '../third_party/skia/include/core',
666         '../third_party/skia/include/effects',
667         '../third_party/skia/include/images',
668         '../third_party/skia/include/lazy',
669         '../third_party/skia/include/pathops',
670         '../third_party/skia/include/utils',
671         '../third_party/skia/src/core',
672       ],
673       'conditions': [
674         [ 'os_posix == 1 and OS != "mac" and OS != "android" and \
675            target_arch != "arm" and target_arch != "mipsel"', {
676           'cflags': [
677             '-msse2',
678           ],
679         }],
680         [ 'OS == "android"', {
681           'defines': [
682             'SK_BUILD_FOR_ANDROID',
683           ],
684         }],
685         [ 'target_arch != "arm" and target_arch != "mipsel"', {
686           'sources': [
687             '../third_party/skia/src/opts/SkBitmapProcState_opts_SSE2.cpp',
688             '../third_party/skia/src/opts/SkBlitRect_opts_SSE2.cpp',
689             '../third_party/skia/src/opts/SkBlitRow_opts_SSE2.cpp',
690             '../third_party/skia/src/opts/SkUtils_opts_SSE2.cpp',
691             'ext/convolver_SSE2.cc',
692           ],
693           'conditions': [
694             # x86 Android doesn't support SSSE3 instructions.
695             [ 'OS != "android"', {
696               'dependencies': [
697                 'skia_opts_ssse3',
698               ],
699             }],
700           ],
701         }],
702         [ 'target_arch == "arm"', {
703           'conditions': [
704             [ 'arm_version >= 7 and arm_neon == 1', {
705               'defines': [
706                 '__ARM_HAVE_NEON',
707               ],
708             }],
709             [ 'arm_version >= 7 and arm_neon_optional == 1', {
710               'defines': [
711                 '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
712               ],
713             }],
714             [ 'arm_version >= 7 and (arm_neon == 1 or arm_neon_optional == 1)', {
715               'cflags': [
716                 # The neon assembly contains conditional instructions which
717                 # aren't enclosed in an IT block. The assembler complains
718                 # without this option.
719                 # See #86592.
720                 '-Wa,-mimplicit-it=always',
721               ],
722               'dependencies': [
723                 'skia_opts_neon',
724               ]
725            }],
726           ],
727           # The assembly uses the frame pointer register (r7 in Thumb/r11 in
728           # ARM), the compiler doesn't like that. Explicitly remove the
729           # -fno-omit-frame-pointer flag for Android, as that gets added to all
730           # targets via common.gypi.
731           'cflags!': [
732             '-fno-omit-frame-pointer',
733             '-marm',
734             '-mapcs-frame',
735           ],
736           'cflags': [
737             '-fomit-frame-pointer',
738           ],
739           'sources': [
740             '../third_party/skia/src/opts/SkBitmapProcState_opts_arm.cpp',
741           ],
742         }],
743         [ 'target_arch == "arm" and (arm_version < 7 or (arm_neon == 0 and arm_neon_optional == 1))', {
744           'sources': [
745             '../third_party/skia/src/opts/memset.arm.S',
746           ],
747         }],
748         [ 'target_arch == "arm" and arm_version < 6', {
749           'sources': [
750             '../third_party/skia/src/opts/SkBlitRow_opts_none.cpp',
751             '../third_party/skia/src/opts/SkUtils_opts_none.cpp',
752           ],
753         }],
754         [ 'target_arch == "arm" and arm_version >= 6', {
755           'sources': [
756             '../third_party/skia/src/opts/SkBlitRow_opts_arm.cpp',
757             '../third_party/skia/src/opts/SkBlitRow_opts_arm.h',
758             '../third_party/skia/src/opts/opts_check_arm.cpp',
759           ],
760         }],
761         [ 'target_arch == "mipsel"',{
762           'cflags': [
763             '-fomit-frame-pointer',
764           ],
765           'sources': [
766             '../third_party/skia/src/opts/SkBitmapProcState_opts_none.cpp',
767             '../third_party/skia/src/opts/SkBlitRow_opts_none.cpp',
768             '../third_party/skia/src/opts/SkUtils_opts_none.cpp',
769             'ext/convolver_mips_dspr2.cc',
770           ],
771         }],
772       ],
773     },
774     # For the same lame reasons as what is done for skia_opts, we have to
775     # create another target specifically for SSSE3 code as we would not want
776     # to compile the SSE2 code with -mssse3 which would potentially allow
777     # gcc to generate SSSE3 code.
778     {
779       'target_name': 'skia_opts_ssse3',
780       'type': 'static_library',
781       'variables': {
782         'optimize': 'max',
783       },
784       'include_dirs': [
785         '..',
786         'config',
787         '../third_party/skia/include/config',
788         '../third_party/skia/include/core',
789         '../third_party/skia/include/pathops',
790         '../third_party/skia/src/core',
791       ],
792       'conditions': [
793         [ 'OS in ["linux", "freebsd", "openbsd", "solaris"]', {
794           'cflags': [
795             '-mssse3',
796           ],
797         }],
798         [ 'OS == "mac"', {
799           'xcode_settings': {
800             'GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS': 'YES',
801           },
802         }],
803         [ 'OS == "win"', {
804           'include_dirs': [
805             'config/win',
806           ],
807           'direct_dependent_settings': {
808             'include_dirs': [
809               'config/win',
810             ],
811           },
812         }],
813         [ 'target_arch != "arm" and target_arch != "mipsel"', {
814           'sources': [
815             '../third_party/skia/src/opts/SkBitmapProcState_opts_SSSE3.cpp',
816           ],
817         }],
818       ],
819     },
820     # NEON code must be compiled with -mfpu=neon which also affects scalar
821     # code. To support dynamic NEON code paths, we need to build all
822     # NEON-specific sources in a separate static library. The situation
823     # is very similar to the SSSE3 one.
824     {
825       'target_name': 'skia_opts_neon',
826       'type': 'static_library',
827       'include_dirs': [
828         '..',
829         'config',
830         '../third_party/skia/include/config',
831         '../third_party/skia/include/core',
832         '../third_party/skia/src/core',
833         '../third_party/skia/src/opts',
834       ],
835       'cflags!': [
836         '-fno-omit-frame-pointer',
837         '-mfpu=vfp',  # remove them all, just in case.
838         '-mfpu=vfpv3',
839         '-mfpu=vfpv3-d16',
840       ],
841       'cflags': [
842         '-mfpu=neon',
843         '-fomit-frame-pointer',
844       ],
845       'ldflags': [
846         '-march=armv7-a',
847         '-Wl,--fix-cortex-a8',
848       ],
849       'conditions': [
850         ['arm_neon == 1', {
851           'defines': [
852             '__ARM_HAVE_NEON',
853           ],
854         }],
855         ['arm_neon_optional == 1', {
856           'defines': [
857             '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
858           ],
859         }],
860         ['target_arch == "arm" and (arm_neon == 1 or arm_neon_optional == 1)', {
861           'sources': [
862             '../third_party/skia/src/opts/memset16_neon.S',
863             '../third_party/skia/src/opts/memset32_neon.S',
864             '../third_party/skia/src/opts/SkBitmapProcState_arm_neon.cpp',
865             '../third_party/skia/src/opts/SkBitmapProcState_matrixProcs_neon.cpp',
866             '../third_party/skia/src/opts/SkBitmapProcState_matrix_clamp_neon.h',
867             '../third_party/skia/src/opts/SkBitmapProcState_matrix_repeat_neon.h',
868             '../third_party/skia/src/opts/SkBlitRow_opts_arm_neon.cpp',
869           ],
870         }],
871       ],
872     },
873     {
874       'target_name': 'image_operations_bench',
875       'type': 'executable',
876       'dependencies': [
877         '../base/base.gyp:base',
878         'skia',
879       ],
880       'include_dirs': [
881         '..',
882       ],
883       'sources': [
884         'ext/image_operations_bench.cc',
885       ],
886     },
887   ],
888   'conditions': [
889     ['OS=="ios"', {
890       'targets': [
891         # The main skia_opts target does not currently work on iOS because the
892         # target architecture on iOS is determined at compile time rather than
893         # gyp time (simulator builds are x86, device builds are arm).  As a
894         # temporary measure, this is a separate opts target for iOS-only, using
895         # the _none.cpp files to avoid architecture-dependent implementations.
896         {
897           'target_name': 'skia_opts_ios',
898           'type': 'static_library',
899           'include_dirs': [
900             '..',
901             'config',
902             '../third_party/skia/include/config',
903             '../third_party/skia/include/core',
904             '../third_party/skia/include/effects',
905             '../third_party/skia/include/images',
906             '../third_party/skia/include/lazy',
907             '../third_party/skia/include/pathops',
908             '../third_party/skia/include/utils',
909             '../third_party/skia/src/core',
910           ],
911           'sources': [
912             '../third_party/skia/src/opts/SkBitmapProcState_opts_none.cpp',
913             '../third_party/skia/src/opts/SkBlitRow_opts_none.cpp',
914             '../third_party/skia/src/opts/SkUtils_opts_none.cpp',
915           ],
916         },
917       ],
918     }],
919   ],