Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / skia / skia_common.gypi
1 # Copyright 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.
4
5 # This gypi file handles the removal of platform-specific files from the
6 # Skia build.
7 {
8   'includes': [
9     # skia_for_chromium_defines.gypi defines skia_for_chromium_defines
10     '../third_party/skia/gyp/skia_for_chromium_defines.gypi',
11   ],
12
13   'include_dirs': [
14     '..',
15     'config',
16   ],
17
18   'conditions': [
19     [ 'OS != "android"', {
20       'sources/': [
21          ['exclude', '_android\\.(cc|cpp)$'],
22       ],
23     }],
24     [ 'OS != "ios"', {
25       'sources/': [
26          ['exclude', '_ios\\.(cc|cpp|mm?)$'],
27       ],
28     }],
29     [ 'OS == "ios"', {
30       'defines': [
31         'SK_BUILD_FOR_IOS',
32       ],
33     }],
34     [ 'OS != "mac"', {
35       'sources/': [
36         ['exclude', '_mac\\.(cc|cpp|mm?)$'],
37       ],
38     }],
39     [ 'OS == "mac"', {
40       'defines': [
41         'SK_BUILD_FOR_MAC',
42       ],
43     }],
44     [ 'OS != "win"', {
45       'sources/': [ ['exclude', '_win\\.(cc|cpp)$'] ],
46     }],
47     [ 'OS == "win"', {
48       'defines': [
49         # On windows, GDI handles are a scarse system-wide resource so we have to keep
50         # the glyph cache, which holds up to 4 GDI handles per entry, to a fairly small
51         # size.
52         # http://crbug.com/314387
53         'SK_DEFAULT_FONT_CACHE_COUNT_LIMIT=256',
54       ],
55     }],
56     [ 'desktop_linux == 0 and chromeos == 0', {
57       'sources/': [ ['exclude', '_linux\\.(cc|cpp)$'] ],
58     }],
59     [ 'use_cairo == 0', {
60       'sources/': [ ['exclude', '_cairo\\.(cc|cpp)$'] ],
61     }],
62
63     #Settings for text blitting, chosen to approximate the system browser.
64     [ 'OS == "linux"', {
65       'defines': [
66         'SK_GAMMA_EXPONENT=1.2',
67         'SK_GAMMA_CONTRAST=0.2',
68         'SK_HIGH_QUALITY_IS_LANCZOS',
69       ],
70     }],
71     ['OS == "android"', {
72       'defines': [
73         'SK_GAMMA_APPLY_TO_A8',
74         'SK_GAMMA_EXPONENT=1.4',
75         'SK_GAMMA_CONTRAST=0.0',
76       ],
77     }],
78     ['OS == "win"', {
79       'defines': [
80         'SK_GAMMA_SRGB',
81         'SK_GAMMA_CONTRAST=0.5',
82         'SK_HIGH_QUALITY_IS_LANCZOS',
83       ],
84     }],
85     ['OS == "mac"', {
86       'defines': [
87         'SK_GAMMA_SRGB',
88         'SK_GAMMA_CONTRAST=0.0',
89         'SK_HIGH_QUALITY_IS_LANCZOS',
90       ],
91     }],
92
93     # For POSIX platforms, prefer the Mutex implementation provided by Skia
94     # since it does not generate static initializers.
95     [ 'os_posix == 1', {
96       'defines+': [
97         'SK_USE_POSIX_THREADS',
98       ],
99       'direct_dependent_settings': {
100         'defines': [
101           'SK_USE_POSIX_THREADS',
102         ],
103       },
104     }],
105
106     # Neon support.
107     [ 'target_arch == "arm" and arm_version >= 7 and arm_neon == 1', {
108       'defines': [
109         'SK_ARM_HAS_NEON',
110       ],
111     }],
112     [ 'target_arch == "arm" and arm_version >= 7 and arm_neon_optional == 1', {
113       'defines': [
114         'SK_ARM_HAS_OPTIONAL_NEON',
115       ],
116     }],
117   ],
118
119   'variables': {
120     'variables': {
121       'conditions': [
122         ['OS== "ios"', {
123           'skia_support_gpu': 0,
124         }, {
125           'skia_support_gpu': 1,
126         }],
127         ['OS=="ios" or enable_printing == 0', {
128           'skia_support_pdf': 0,
129         }, {
130           'skia_support_pdf': 1,
131         }],
132       ],
133       # TODO(scottmg): http://crbug.com/177306
134       'clang_warning_flags': [
135         # Don't warn about string->bool used in asserts.
136         '-Wstring-conversion',
137       ]
138     },
139     'skia_support_gpu': '<(skia_support_gpu)',
140     'skia_support_pdf': '<(skia_support_pdf)',
141
142     # These two set the paths so we can include skia/gyp/core.gypi
143     'skia_src_path': '../third_party/skia/src',
144     'skia_include_path': '../third_party/skia/include',
145
146     # This list will contain all defines that also need to be exported to
147     # dependent components.
148     'skia_export_defines': [
149       'SK_ENABLE_INST_COUNT=0',
150       'SK_SUPPORT_GPU=<(skia_support_gpu)',
151       'GR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"',
152       'SK_ENABLE_LEGACY_API_ALIASING=1',
153       'SK_ATTR_DEPRECATED=SK_NOTHING_ARG1',
154       'GR_GL_IGNORE_ES3_MSAA=0',
155       'SK_WILL_NEVER_DRAW_PERSPECTIVE_TEXT',
156
157       # This variable contains additional defines, specified in skia's
158       # skia_for_chromium_defines.gypi file.
159       '<@(skia_for_chromium_defines)',
160     ],
161
162     'default_font_cache_limit%': '(20*1024*1024)',
163
164     'conditions': [
165       ['OS== "android"', {
166         # Android devices are typically more memory constrained, so
167         # default to a smaller glyph cache (it may be overriden at runtime
168         # when the renderer starts up, depending on the actual device memory).
169         'default_font_cache_limit': '(1*1024*1024)',
170         'skia_export_defines': [
171           'SK_BUILD_FOR_ANDROID',
172         ],
173       }],
174     ],
175   },
176
177   'defines': [
178     '<@(skia_export_defines)',
179
180     # skia uses static initializers to initialize the serialization logic
181     # of its "pictures" library. This is currently not used in chrome; if
182     # it ever gets used the processes that use it need to call
183     # SkGraphics::Init().
184     'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0',
185
186     # Forcing the unoptimized path for the offset image filter in skia until
187     # all filters used in Blink support the optimized path properly
188     'SK_DISABLE_OFFSETIMAGEFILTER_OPTIMIZATION',
189
190     'IGNORE_ROT_AA_RECT_OPT',
191
192     'SK_IGNORE_BLURRED_RRECT_OPT',
193
194     # this flag forces Skia not to use typographic metrics with GDI.
195     'SK_GDI_ALWAYS_USE_TEXTMETRICS_FOR_FONT_METRICS',
196
197     'SK_DEFAULT_FONT_CACHE_LIMIT=<(default_font_cache_limit)',
198
199     'SK_USE_DISCARDABLE_SCALEDIMAGECACHE',
200   ],
201
202   'direct_dependent_settings': {
203     'defines': [
204       '<@(skia_export_defines)',
205     ],
206   },
207
208   # We would prefer this to be direct_dependent_settings,
209   # however we currently have no means to enforce that direct dependents
210   # re-export if they include Skia headers in their public headers.
211   'all_dependent_settings': {
212     'include_dirs': [
213       '..',
214       'config',
215     ],
216   },
217
218   'msvs_disabled_warnings': [4244, 4267, 4341, 4345, 4390, 4554, 4748, 4800],
219 }