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