blob: 81b4592add2c19bd3b7ce32632c9aa12b96ea4f2 [file] [log] [blame]
[email protected]9d6bc352013-07-23 13:00:101# 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{
[email protected]ab622f0e2014-02-27 14:29:528 'includes': [
9 # skia_for_chromium_defines.gypi defines skia_for_chromium_defines
10 '../third_party/skia/gyp/skia_for_chromium_defines.gypi',
11 ],
12
[email protected]e593f8b2013-10-21 20:47:3913 'include_dirs': [
14 '..',
15 'config',
16 ],
17
[email protected]9d6bc352013-07-23 13:00:1018 '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 }],
[email protected]6f2b1c92013-12-17 22:42:4829 [ 'OS == "ios"', {
30 'defines': [
31 'SK_BUILD_FOR_IOS',
32 ],
33 }],
[email protected]9d6bc352013-07-23 13:00:1034 [ 'OS != "mac"', {
35 'sources/': [
36 ['exclude', '_mac\\.(cc|cpp|mm?)$'],
37 ],
38 }],
[email protected]6f2b1c92013-12-17 22:42:4839 [ 'OS == "mac"', {
40 'defines': [
41 'SK_BUILD_FOR_MAC',
42 ],
43 }],
[email protected]9d6bc352013-07-23 13:00:1044 [ 'OS != "win"', {
45 'sources/': [ ['exclude', '_win\\.(cc|cpp)$'] ],
46 }],
[email protected]6f2b1c92013-12-17 22:42:4847 [ '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 }],
[email protected]b098e1d82013-11-08 06:24:5856 [ 'desktop_linux == 0 and chromeos == 0', {
[email protected]9d6bc352013-07-23 13:00:1057 'sources/': [ ['exclude', '_linux\\.(cc|cpp)$'] ],
58 }],
[email protected]928362a2013-11-19 20:17:1659 [ 'use_cairo == 0', {
60 'sources/': [ ['exclude', '_cairo\\.(cc|cpp)$'] ],
61 }],
[email protected]6f2b1c92013-12-17 22:42:4862
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',
[email protected]a645ee252014-02-14 13:51:4968 'SK_HIGH_QUALITY_IS_LANCZOS',
[email protected]6f2b1c92013-12-17 22:42:4869 ],
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',
[email protected]a645ee252014-02-14 13:51:4982 'SK_HIGH_QUALITY_IS_LANCZOS',
[email protected]6f2b1c92013-12-17 22:42:4883 ],
84 }],
85 ['OS == "mac"', {
86 'defines': [
87 'SK_GAMMA_SRGB',
88 'SK_GAMMA_CONTRAST=0.0',
[email protected]a645ee252014-02-14 13:51:4989 'SK_HIGH_QUALITY_IS_LANCZOS',
[email protected]6f2b1c92013-12-17 22:42:4890 ],
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': [
[email protected]00e1d2772014-07-31 22:05:35109 'SK_ARM_HAS_NEON',
[email protected]6f2b1c92013-12-17 22:42:48110 ],
111 }],
112 [ 'target_arch == "arm" and arm_version >= 7 and arm_neon_optional == 1', {
113 'defines': [
[email protected]00e1d2772014-07-31 22:05:35114 'SK_ARM_HAS_OPTIONAL_NEON',
[email protected]6f2b1c92013-12-17 22:42:48115 ],
116 }],
[email protected]9d6bc352013-07-23 13:00:10117 ],
118
[email protected]6f2b1c92013-12-17 22:42:48119 '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 },
134 'skia_support_gpu': '<(skia_support_gpu)',
135 'skia_support_pdf': '<(skia_support_pdf)',
136
137 # These two set the paths so we can include skia/gyp/core.gypi
138 'skia_src_path': '../third_party/skia/src',
139 'skia_include_path': '../third_party/skia/include',
140
141 # This list will contain all defines that also need to be exported to
142 # dependent components.
143 'skia_export_defines': [
144 'SK_ENABLE_INST_COUNT=0',
145 'SK_SUPPORT_GPU=<(skia_support_gpu)',
146 'GR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"',
147 'SK_ENABLE_LEGACY_API_ALIASING=1',
148 'SK_ATTR_DEPRECATED=SK_NOTHING_ARG1',
[email protected]6f2b1c92013-12-17 22:42:48149 'GR_GL_IGNORE_ES3_MSAA=0',
[email protected]453f8ec2014-02-20 15:38:10150 'SK_WILL_NEVER_DRAW_PERSPECTIVE_TEXT',
[email protected]ab622f0e2014-02-27 14:29:52151
152 # This variable contains additional defines, specified in skia's
153 # skia_for_chromium_defines.gypi file.
154 '<@(skia_for_chromium_defines)',
[email protected]6f2b1c92013-12-17 22:42:48155 ],
156
157 'default_font_cache_limit%': '(20*1024*1024)',
158
159 'conditions': [
160 ['OS== "android"', {
161 # Android devices are typically more memory constrained, so
162 # default to a smaller glyph cache (it may be overriden at runtime
163 # when the renderer starts up, depending on the actual device memory).
164 'default_font_cache_limit': '(1*1024*1024)',
165 'skia_export_defines': [
166 'SK_BUILD_FOR_ANDROID',
167 ],
168 }],
169 ],
170 },
171
172 'defines': [
173 '<@(skia_export_defines)',
174
175 # skia uses static initializers to initialize the serialization logic
176 # of its "pictures" library. This is currently not used in chrome; if
177 # it ever gets used the processes that use it need to call
178 # SkGraphics::Init().
179 'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0',
180
181 # Forcing the unoptimized path for the offset image filter in skia until
182 # all filters used in Blink support the optimized path properly
183 'SK_DISABLE_OFFSETIMAGEFILTER_OPTIMIZATION',
184
[email protected]6f2b1c92013-12-17 22:42:48185 'IGNORE_ROT_AA_RECT_OPT',
186
187 'SK_IGNORE_BLURRED_RRECT_OPT',
188
[email protected]6f2b1c92013-12-17 22:42:48189 # this flag forces Skia not to use typographic metrics with GDI.
190 'SK_GDI_ALWAYS_USE_TEXTMETRICS_FOR_FONT_METRICS',
191
192 'SK_DEFAULT_FONT_CACHE_LIMIT=<(default_font_cache_limit)',
[email protected]d72493152014-01-08 17:37:45193
194 'SK_USE_DISCARDABLE_SCALEDIMAGECACHE',
[email protected]6f2b1c92013-12-17 22:42:48195 ],
196
197 'direct_dependent_settings': {
198 'defines': [
199 '<@(skia_export_defines)',
200 ],
201 },
202
[email protected]48ad0112013-11-13 20:30:34203 # We would prefer this to be direct_dependent_settings,
204 # however we currently have no means to enforce that direct dependents
205 # re-export if they include Skia headers in their public headers.
206 'all_dependent_settings': {
[email protected]e593f8b2013-10-21 20:47:39207 'include_dirs': [
208 '..',
209 'config',
210 ],
211 },
212
[email protected]9d6bc352013-07-23 13:00:10213 'msvs_disabled_warnings': [4244, 4267, 4341, 4345, 4390, 4554, 4748, 4800],
214}