Simple Cache: a few tests for rare corner cases with CRC check missing.
[chromium-blink-merge.git] / skia / skia.gyp
blobcc80423cb8559fad8a3b67a63fc539b07811d8bb
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             '<@(gr_sources)',
265             '<@(skgr_sources)',
266           ],
267           'include_dirs': [
268             '../third_party/skia/include/gpu',
269             '../third_party/skia/include/gpu/gl',
270             '../third_party/skia/src/gpu',
271           ],
272         }, {  # skia_support_gpu == 0
273           'defines': [
274             'SK_SUPPORT_GPU=0',
275           ],
276         }],
277         ['release_valgrind_build == 1', {
278           'defines': [
279             'SK_DEBUG_PATH_REF=1',
280           ],
281           'direct_dependent_settings': {
282             'defines': [
283               'SK_DEBUG_PATH_REF=1',
284             ],
285           },
286         }],
287         #Settings for text blitting, chosen to approximate the system browser.
288         [ 'OS == "linux"', {
289           'defines': [
290             'SK_GAMMA_EXPONENT=1.2',
291             'SK_GAMMA_CONTRAST=0.2',
292           ],
293         }],
294         ['OS == "android"', {
295           'defines': [
296             'SK_GAMMA_APPLY_TO_A8',
297             'SK_GAMMA_EXPONENT=1.4',
298             'SK_GAMMA_CONTRAST=0.0',
299           ],
300         }],
301         ['OS == "win"', {
302           'defines': [
303             'SK_GAMMA_SRGB',
304             'SK_GAMMA_CONTRAST=0.5',
305           ],
306         }],
307         ['OS == "mac"', {
308           'defines': [
309             'SK_GAMMA_SRGB',
310             'SK_GAMMA_CONTRAST=0.0',
311           ],
312         }],
314         # For POSIX platforms, prefer the Mutex implementation provided by Skia
315         # since it does not generate static initializers.
316         [ 'OS == "android" or OS == "linux" or OS == "mac" or OS == "ios"', {
317           'defines+': [
318             'SK_USE_POSIX_THREADS',
319           ],
320           'direct_dependent_settings': {
321             'defines': [
322               'SK_USE_POSIX_THREADS',
323             ],
324           },
325           'sources!': [
326             'ext/SkThread_chrome.cc',
327           ],
328         }],
329         [ 'OS != "android"', {
330           'sources/': [
331             ['exclude', '_android\\.(cc|cpp)$'],
332           ],
333           'sources!': [
334             '../third_party/skia/src/core/SkPaintOptionsAndroid.cpp',
335           ],
336           'defines': [
337             'SK_DEFAULT_FONT_CACHE_LIMIT=(20*1024*1024)',
338           ],
339         }],
340         [ 'OS != "ios"', {
341           'sources/': [
342             ['exclude', '_ios\\.(cc|cpp|mm?)$'],
343           ],
344           'dependencies': [
345             '<(DEPTH)/third_party/WebKit/Source/WebKit/chromium/skia_webkit.gyp:skia_webkit',
346           ],
347         }],
348         [ 'OS != "mac"', {
349           'sources/': [
350             ['exclude', '_mac\\.(cc|cpp|mm?)$'],
351             ['exclude', '/mac/']
352           ],
353         }],
354         [ 'OS != "win"', {
355           'sources/': [ ['exclude', '_win\\.(cc|cpp)$'] ],
356         }],
357         [ 'target_arch == "arm" and arm_version >= 7 and arm_neon == 1', {
358           'defines': [
359             '__ARM_HAVE_NEON',
360           ],
361         }],
362         [ 'target_arch == "arm" or target_arch == "mipsel"', {
363           'sources!': [
364             '../third_party/skia/src/opts/opts_check_SSE2.cpp'
365           ],
366         }],
367         [ 'use_glib == 1', {
368           'dependencies': [
369             '../build/linux/system.gyp:fontconfig',
370             '../build/linux/system.gyp:freetype2',
371             '../build/linux/system.gyp:pangocairo',
372             '../third_party/icu/icu.gyp:icuuc',
373           ],
374           'cflags': [
375             '-Wno-unused',
376             '-Wno-unused-function',
377           ],
378           'sources': [
379             '../third_party/skia/src/fonts/SkFontMgr_fontconfig.cpp',
380             '../third_party/skia/src/ports/SkFontHost_fontconfig.cpp',
381             '../third_party/skia/src/ports/SkFontConfigInterface_direct.cpp',
382           ],
383           'defines': [
384 #            'SK_USE_COLOR_LUMINANCE',
385           ],
386         }],
387         [ 'use_glib == 0 and OS != "android"', {
388           'sources/': [ ['exclude', '_linux\\.(cc|cpp)$'] ],
389           'sources!': [
390             '../third_party/skia/src/ports/SkFontHost_FreeType.cpp',
391             '../third_party/skia/src/ports/SkFontHost_FreeType_common.cpp',
392           ],
393         }],
394         [ 'toolkit_uses_gtk == 1', {
395           'dependencies': [
396             '../build/linux/system.gyp:gdk',
397           ],
398         }, {  # toolkit_uses_gtk == 0
399           'sources/': [ ['exclude', '_gtk\\.(cc|cpp)$'] ],
400         }],
401         [ 'OS == "android"', {
402           'sources': [
403             '../third_party/skia/src/ports/SkFontHost_fontconfig.cpp',
404           ],
405           'sources/': [
406             ['exclude', '_linux\\.(cc|cpp)$'],
407           ],
408           'conditions': [
409             [ '_toolset == "target"', {
410               'defines': [
411                 'HAVE_PTHREADS',
412                 'OS_ANDROID',
413                 'SK_BUILD_FOR_ANDROID',
414                 # Android devices are typically more memory constrained, so
415                 # use a smaller glyph cache.
416                 'SK_DEFAULT_FONT_CACHE_LIMIT=(8*1024*1024)',
417                 'USE_CHROMIUM_SKIA',
418               ],
419               'dependencies': [
420                 '../third_party/expat/expat.gyp:expat',
421                 '../third_party/freetype/freetype.gyp:ft2',
422                 'skia_opts'
423               ],
424               'dependencies!': [
425                 # Android doesn't use Skia's PDF generation, which is what uses
426                 # sfntly.
427                 '../third_party/sfntly/sfntly.gyp:sfntly',
428               ],
429               # This exports a hard dependency because it needs to run its
430               # symlink action in order to expose the skia header files.
431               'hard_dependency': 1,
432               'include_dirs': [
433                 '../third_party/expat/files/lib',
434               ],
435               'sources/': [
436                 ['include', 'ext/platform_device_linux\\.cc$'],
437                 ['exclude', '../third_party/skia/src/pdf/'],
438               ],
439               'sources!': [
440                 'ext/vector_platform_device_skia.cc',
441               ],
442             }],
443             [ '_toolset == "target" and android_webview_build == 0', {
444               'defines': [
445                 'HAVE_ENDIAN_H',
446               ],
447             }],
448             [ '_toolset=="host" and host_os=="linux"', {
449               'sources': [
450                 'ext/platform_device_linux.cc',
451               ],
452             }],
453           ],
454         }],
455         [ 'OS == "ios"', {
456           'defines': [
457             'SK_BUILD_FOR_IOS',
458             'SK_USE_MAC_CORE_TEXT',
459           ],
460           'include_dirs': [
461             '../third_party/skia/include/utils/ios',
462             '../third_party/skia/include/utils/mac',
463           ],
464           'link_settings': {
465             'libraries': [
466               '$(SDKROOT)/System/Library/Frameworks/ImageIO.framework',
467             ],
468           },
469           'dependencies': [
470             'skia_opts_ios',
471           ],
472           'dependencies!': [
473             'skia_opts',
474             '../third_party/sfntly/sfntly.gyp:sfntly',
475           ],
476           'sources': [
477             # This file is used on both iOS and Mac, so it should be removed
478             #  from the ios and mac conditions and moved into the main sources
479             #  list.
480             '../third_party/skia/src/utils/mac/SkStream_mac.cpp',
481           ],
482           'sources/': [
483             ['exclude', '/pdf/'],
484             ['exclude', '^ext/vector_platform_device_skia\\.'],
485             ['exclude', 'opts_check_SSE2\\.cpp$'],
486           ],
487         }],
488         [ 'OS == "mac"', {
489           'defines': [
490             'SK_BUILD_FOR_MAC',
491             'SK_USE_MAC_CORE_TEXT',
492 #           'SK_USE_COLOR_LUMINANCE',
493           ],
494           'include_dirs': [
495             '../third_party/skia/include/utils/mac',
496           ],
497           'link_settings': {
498             'libraries': [
499               '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
500             ],
501           },
502           'sources': [
503             '../third_party/skia/src/utils/mac/SkStream_mac.cpp',
504           ],
505         }],
506         [ 'OS == "win"', {
507           'sources!': [
508             '../third_party/skia/src/ports/SkOSFile_posix.cpp',
509             '../third_party/skia/src/ports/SkThread_pthread.cpp',
510             '../third_party/skia/src/ports/SkTime_Unix.cpp',
511             'ext/SkThread_chrome.cc',
512           ],
513           'include_dirs': [
514             'config/win',
515           ],
516           'direct_dependent_settings': {
517             'include_dirs': [
518               'config/win',
519             ],
520           },
521         }],
522         ['component=="shared_library"', {
523           'defines': [
524             'GR_DLL=1',
525             'GR_IMPLEMENTATION=1',
526             'SKIA_DLL',
527             'SKIA_IMPLEMENTATION=1',
528           ],
529           'dependencies': [
530             '../base/base.gyp:base',
531           ],
532           'direct_dependent_settings': {
533             'defines': [
534               'GR_DLL',
535               'SKIA_DLL',
536             ],
537           },
538         }],
539         # TODO(scottmg): http://crbug.com/177306
540         ['clang==1', {
541           'xcode_settings': {
542             'WARNING_CFLAGS!': [
543               # Don't warn about string->bool used in asserts.
544               '-Wstring-conversion',
545             ],
546           },
547           'cflags!': [
548             '-Wstring-conversion',
549           ],
550         }],
551       ],
552       'dependencies': [
553         'skia_opts',
554         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
555         '../third_party/sfntly/sfntly.gyp:sfntly',
556         '../third_party/zlib/zlib.gyp:zlib',
557       ],
558       'direct_dependent_settings': {
559         'include_dirs': [
560           'config',
562           #temporary until we can hide SkFontHost
563           '../third_party/skia/src/core',
565           '../third_party/skia/include/config',
566           '../third_party/skia/include/core',
567           '../third_party/skia/include/effects',
568           '../third_party/skia/include/pdf',
569           '../third_party/skia/include/gpu',
570           '../third_party/skia/include/gpu/gl',
571           '../third_party/skia/include/pathops',
572           '../third_party/skia/include/pipe',
573           '../third_party/skia/include/ports',
574           '../third_party/skia/include/utils',
575           'ext',
576         ],
577         'defines': [
578           'SK_BUILD_NO_IMAGE_ENCODE',
579           'SK_DEFERRED_CANVAS_USES_GPIPE=1',
580           'GR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"',
581           'GR_AGGRESSIVE_SHADER_OPTS=1',
582           'SK_ENABLE_INST_COUNT=0',
583         ],
584         'conditions': [
585           ['OS=="android"', {
586             'dependencies!': [
587               'skia_opts',
588               '../third_party/zlib/zlib.gyp:zlib',
589             ],
590             'defines': [
591               # Don't use non-NDK available stuff.
592               'SK_BUILD_FOR_ANDROID',
593             ],
594             'conditions': [
595               [ '_toolset == "target" and android_webview_build == 0', {
596                 'defines': [
597                   'HAVE_ENDIAN_H',
598                 ],
599               }],
600             ],
601           }],
602           ['OS=="mac"', {
603             'include_dirs': [
604               '../third_party/skia/include/utils/mac',
605             ],
606           }],
607         ],
608       },
609       'target_conditions': [
610         # Pull in specific Mac files for iOS (which have been filtered out
611         # by file name rules).
612         [ 'OS == "ios"', {
613           'sources/': [
614             ['include', 'SkFontHost_mac\\.cpp$',],
615             ['include', 'SkStream_mac\\.cpp$',],
616             ['include', 'SkCreateCGImageRef\\.cpp$',],
617           ],
618         }],
619       ],
620     },
622     # Due to an unfortunate intersection of lameness between gcc and gyp,
623     # we have to build the *_SSE2.cpp files in a separate target.  The
624     # gcc lameness is that, in order to compile SSE2 intrinsics code, it
625     # must be passed the -msse2 flag.  However, with this flag, it may
626     # emit SSE2 instructions even for scalar code, such as the CPUID
627     # test used to test for the presence of SSE2.  So that, and all other
628     # code must be compiled *without* -msse2.  The gyp lameness is that it
629     # does not allow file-specific CFLAGS, so we must create this extra
630     # target for those files to be compiled with -msse2.
631     #
632     # This is actually only a problem on 32-bit Linux (all Intel Macs have
633     # SSE2, Linux x86_64 has SSE2 by definition, and MSC will happily emit
634     # SSE2 from instrinsics, which generating plain ol' 386 for everything
635     # else).  However, to keep the .gyp file simple and avoid platform-specific
636     # build breakage, we do this on all platforms.
638     # For about the same reason, we need to compile the ARM opts files
639     # separately as well.
640     {
641       'target_name': 'skia_opts',
642       'type': 'static_library',
643       'variables': {
644         'optimize': 'max',
645       },
646       'include_dirs': [
647         '..',
648         'config',
649         '../third_party/skia/include/config',
650         '../third_party/skia/include/core',
651         '../third_party/skia/include/effects',
652         '../third_party/skia/include/images',
653         '../third_party/skia/include/lazy',
654         '../third_party/skia/include/pathops',
655         '../third_party/skia/include/utils',
656         '../third_party/skia/src/core',
657       ],
658       'conditions': [
659         [ 'os_posix == 1 and OS != "mac" and OS != "android" and \
660            target_arch != "arm" and target_arch != "mipsel"', {
661           'cflags': [
662             '-msse2',
663           ],
664         }],
665         [ 'OS == "android"', {
666           'defines': [
667             'SK_BUILD_FOR_ANDROID',
668           ],
669         }],
670         [ 'target_arch != "arm" and target_arch != "mipsel"', {
671           'sources': [
672             '../third_party/skia/src/opts/SkBitmapProcState_opts_SSE2.cpp',
673             '../third_party/skia/src/opts/SkBlitRect_opts_SSE2.cpp',
674             '../third_party/skia/src/opts/SkBlitRow_opts_SSE2.cpp',
675             '../third_party/skia/src/opts/SkUtils_opts_SSE2.cpp',
676             'ext/convolver_SSE2.cc',
677           ],
678           'conditions': [
679             # x86 Android doesn't support SSSE3 instructions.
680             [ 'OS != "android"', {
681               'dependencies': [
682                 'skia_opts_ssse3',
683               ],
684             }],
685           ],
686         }],
687         [ 'target_arch == "arm"', {
688           'conditions': [
689             [ 'arm_version >= 7 and arm_neon == 1', {
690               'defines': [
691                 '__ARM_HAVE_NEON',
692               ],
693               'cflags': [
694                 # The neon assembly contains conditional instructions which
695                 # aren't enclosed in an IT block. The assembler complains
696                 # without this option.
697                 # See #86592.
698                 '-Wa,-mimplicit-it=always',
699               ],
700            }],
701           ],
702           # The assembly uses the frame pointer register (r7 in Thumb/r11 in
703           # ARM), the compiler doesn't like that. Explicitly remove the
704           # -fno-omit-frame-pointer flag for Android, as that gets added to all
705           # targets via common.gypi.
706           'cflags!': [
707             '-fno-omit-frame-pointer',
708             '-marm',
709             '-mapcs-frame',
710           ],
711           'cflags': [
712             '-fomit-frame-pointer',
713           ],
714           'sources': [
715             '../third_party/skia/src/opts/SkBitmapProcState_opts_arm.cpp',
716           ],
717         }],
718         [ 'target_arch == "arm" and (arm_version < 7 or arm_neon == 0)', {
719           'sources': [
720             '../third_party/skia/src/opts/memset.arm.S',
721         ],
722         }],
723         [ 'target_arch == "arm" and arm_version >= 7 and arm_neon == 1', {
724           'sources': [
725             '../third_party/skia/src/opts/memset16_neon.S',
726             '../third_party/skia/src/opts/memset32_neon.S',
727             '../third_party/skia/src/opts/SkBitmapProcState_arm_neon.cpp',
728             '../third_party/skia/src/opts/SkBitmapProcState_matrixProcs_neon.cpp',
729             '../third_party/skia/src/opts/SkBitmapProcState_matrix_clamp_neon.h',
730             '../third_party/skia/src/opts/SkBitmapProcState_matrix_repeat_neon.h',
731             '../third_party/skia/src/opts/SkBlitRow_opts_arm_neon.cpp',
732           ],
733         }],
734         [ 'target_arch == "arm" and arm_version < 6', {
735           'sources': [
736             '../third_party/skia/src/opts/SkBlitRow_opts_none.cpp',
737             '../third_party/skia/src/opts/SkUtils_opts_none.cpp',
738           ],
739         }],
740         [ 'target_arch == "arm" and arm_version >= 6', {
741           'sources': [
742             '../third_party/skia/src/opts/SkBlitRow_opts_arm.cpp',
743             '../third_party/skia/src/opts/SkBlitRow_opts_arm.h',
744             '../third_party/skia/src/opts/opts_check_arm.cpp',
745           ],
746         }],
747         [ 'target_arch == "mipsel"',{
748           'cflags': [
749             '-fomit-frame-pointer',
750           ],
751           'sources': [
752             '../third_party/skia/src/opts/SkBitmapProcState_opts_none.cpp',
753             '../third_party/skia/src/opts/SkBlitRow_opts_none.cpp',
754             '../third_party/skia/src/opts/SkUtils_opts_none.cpp',
755             'ext/convolver_mips_dspr2.cc',
756           ],
757         }],
758       ],
759     },
760     # For the same lame reasons as what is done for skia_opts, we have to
761     # create another target specifically for SSSE3 code as we would not want
762     # to compile the SSE2 code with -mssse3 which would potentially allow
763     # gcc to generate SSSE3 code.
764     {
765       'target_name': 'skia_opts_ssse3',
766       'type': 'static_library',
767       'variables': {
768         'optimize': 'max',
769       },
770       'include_dirs': [
771         '..',
772         'config',
773         '../third_party/skia/include/config',
774         '../third_party/skia/include/core',
775         '../third_party/skia/include/pathops',
776         '../third_party/skia/src/core',
777       ],
778       'conditions': [
779         [ 'OS in ["linux", "freebsd", "openbsd", "solaris"]', {
780           'cflags': [
781             '-mssse3',
782           ],
783         }],
784         [ 'OS == "mac"', {
785           'xcode_settings': {
786             'GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS': 'YES',
787           },
788         }],
789         [ 'OS == "win"', {
790           'include_dirs': [
791             'config/win',
792           ],
793           'direct_dependent_settings': {
794             'include_dirs': [
795               'config/win',
796             ],
797           },
798         }],
799         [ 'target_arch != "arm" and target_arch != "mipsel"', {
800           'sources': [
801             '../third_party/skia/src/opts/SkBitmapProcState_opts_SSSE3.cpp',
802           ],
803         }],
804       ],
805     },
806     {
807       'target_name': 'image_operations_bench',
808       'type': 'executable',
809       'dependencies': [
810         '../base/base.gyp:base',
811         'skia',
812       ],
813       'include_dirs': [
814         '..',
815       ],
816       'sources': [
817         'ext/image_operations_bench.cc',
818       ],
819     },
820   ],
821   'conditions': [
822     ['OS=="ios"', {
823       'targets': [
824         # The main skia_opts target does not currently work on iOS because the
825         # target architecture on iOS is determined at compile time rather than
826         # gyp time (simulator builds are x86, device builds are arm).  As a
827         # temporary measure, this is a separate opts target for iOS-only, using
828         # the _none.cpp files to avoid architecture-dependent implementations.
829         {
830           'target_name': 'skia_opts_ios',
831           'type': 'static_library',
832           'include_dirs': [
833             '..',
834             'config',
835             '../third_party/skia/include/config',
836             '../third_party/skia/include/core',
837             '../third_party/skia/include/effects',
838             '../third_party/skia/include/images',
839             '../third_party/skia/include/lazy',
840             '../third_party/skia/include/pathops',
841             '../third_party/skia/include/utils',
842             '../third_party/skia/src/core',
843           ],
844           'sources': [
845             '../third_party/skia/src/opts/SkBitmapProcState_opts_none.cpp',
846             '../third_party/skia/src/opts/SkBlitRow_opts_none.cpp',
847             '../third_party/skia/src/opts/SkUtils_opts_none.cpp',
848           ],
849         },
850       ],
851     }],
852   ],