Center distiller results on desktop
[chromium-blink-merge.git] / skia / skia_common.gypi
blobc0c0f7303aec24143d63088e899e9a4368841130
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.
5 # This gypi file handles the removal of platform-specific files from the
6 # Skia build.
8   'includes': [
9     # blink_skia_config.gypi defines blink_skia_defines
10     '../third_party/WebKit/public/blink_skia_config.gypi',
12     # skia_for_chromium_defines.gypi defines skia_for_chromium_defines
13     '../third_party/skia/gyp/skia_for_chromium_defines.gypi',
14   ],
16   'include_dirs': [
17     '..',
18     'config',
19   ],
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     }],
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     }],
96     # Neon support.
97     [ 'target_arch == "arm" and arm_version >= 7 and arm_neon == 1', {
98       'defines': [
99         'SK_ARM_HAS_NEON',
100       ],
101     }],
102     [ 'target_arch == "arm" and arm_version >= 7 and arm_neon_optional == 1', {
103       'defines': [
104         'SK_ARM_HAS_OPTIONAL_NEON',
105       ],
106     }],
107   ],
109   'variables': {
110     'variables': {
111       'conditions': [
112         ['OS== "ios"', {
113           'skia_support_gpu': 0,
114         }, {
115           'skia_support_gpu': 1,
116         }],
117         ['OS=="ios" or (enable_basic_printing==0 and enable_print_preview==0)', {
118           'skia_support_pdf': 0,
119         }, {
120           'skia_support_pdf': 1,
121         }],
122       ],
123     },
124     'skia_support_gpu': '<(skia_support_gpu)',
125     'skia_support_pdf': '<(skia_support_pdf)',
127     # These two set the paths so we can include skia/gyp/core.gypi
128     'skia_src_path': '../third_party/skia/src',
129     'skia_include_path': '../third_party/skia/include',
131     # This list will contain all defines that also need to be exported to
132     # dependent components.
133     'skia_export_defines': [
134       'SK_SUPPORT_GPU=<(skia_support_gpu)',
136       # This variable contains additional defines, specified in blink's
137       # blink_skia_config.gypi file.
138       '<@(blink_skia_defines)',
140       # This variable contains additional defines, specified in skia's
141       # skia_for_chromium_defines.gypi file.
142       '<@(skia_for_chromium_defines)',
143     ],
145     'default_font_cache_limit%': '(20*1024*1024)',
147     'conditions': [
148       ['OS== "android"', {
149         # Android devices are typically more memory constrained, so
150         # default to a smaller glyph cache (it may be overriden at runtime
151         # when the renderer starts up, depending on the actual device memory).
152         'default_font_cache_limit': '(1*1024*1024)',
153         'skia_export_defines': [
154           'SK_BUILD_FOR_ANDROID',
155         ],
156       }],
157     ],
158   },
160   'defines': [
161     '<@(skia_export_defines)',
163     'SK_DEFAULT_FONT_CACHE_LIMIT=<(default_font_cache_limit)',
164   ],
166   'direct_dependent_settings': {
167     'defines': [
168       '<@(skia_export_defines)',
169     ],
170   },
172   # We would prefer this to be direct_dependent_settings,
173   # however we currently have no means to enforce that direct dependents
174   # re-export if they include Skia headers in their public headers.
175   'all_dependent_settings': {
176     'include_dirs': [
177       '..',
178       'config',
179     ],
180   },
182   'msvs_disabled_warnings': [4244, 4267, 4341, 4345, 4390, 4554, 4748, 4800],