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
9 # skia_for_chromium_defines.gypi defines skia_for_chromium_defines
10 '../third_party/skia/gyp/skia_for_chromium_defines.gypi',
19 [ 'OS != "android"', {
21 ['exclude', '_android\\.(cc|cpp)$'],
26 ['exclude', '_ios\\.(cc|cpp|mm?)$'],
36 ['exclude', '_mac\\.(cc|cpp|mm?)$'],
45 'sources/': [ ['exclude', '_win\\.(cc|cpp)$'] ],
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
52 # http://crbug.com/314387
53 'SK_DEFAULT_FONT_CACHE_COUNT_LIMIT=256',
56 [ 'desktop_linux == 0 and chromeos == 0', {
57 'sources/': [ ['exclude', '_linux\\.(cc|cpp)$'] ],
60 'sources/': [ ['exclude', '_cairo\\.(cc|cpp)$'] ],
63 #Settings for text blitting, chosen to approximate the system browser.
66 'SK_GAMMA_EXPONENT=1.2',
67 'SK_GAMMA_CONTRAST=0.2',
68 'SK_HIGH_QUALITY_IS_LANCZOS',
73 'SK_GAMMA_APPLY_TO_A8',
74 'SK_GAMMA_EXPONENT=1.4',
75 'SK_GAMMA_CONTRAST=0.0',
81 'SK_GAMMA_CONTRAST=0.5',
82 'SK_HIGH_QUALITY_IS_LANCZOS',
88 'SK_GAMMA_CONTRAST=0.0',
89 'SK_HIGH_QUALITY_IS_LANCZOS',
93 # For POSIX platforms, prefer the Mutex implementation provided by Skia
94 # since it does not generate static initializers.
97 'SK_USE_POSIX_THREADS',
99 'direct_dependent_settings': {
101 'SK_USE_POSIX_THREADS',
107 [ 'target_arch == "arm" and arm_version >= 7 and arm_neon == 1', {
112 [ 'target_arch == "arm" and arm_version >= 7 and arm_neon_optional == 1', {
114 'SK_ARM_HAS_OPTIONAL_NEON',
118 # Enable feedback-directed optimisation for skia when building in android.
119 [ 'android_webview_build == 1', {
120 'aosp_build_settings': {
121 'LOCAL_FDO_SUPPORT': 'true',
130 'skia_support_gpu': 0,
132 'skia_support_gpu': 1,
134 ['OS=="ios" or enable_printing == 0', {
135 'skia_support_pdf': 0,
137 'skia_support_pdf': 1,
141 'skia_support_gpu': '<(skia_support_gpu)',
142 'skia_support_pdf': '<(skia_support_pdf)',
144 # These two set the paths so we can include skia/gyp/core.gypi
145 'skia_src_path': '../third_party/skia/src',
146 'skia_include_path': '../third_party/skia/include',
148 # This list will contain all defines that also need to be exported to
149 # dependent components.
150 'skia_export_defines': [
151 'SK_ENABLE_INST_COUNT=0',
152 'SK_SUPPORT_GPU=<(skia_support_gpu)',
153 'GR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"',
154 'SK_ENABLE_LEGACY_API_ALIASING=1',
155 'SK_ATTR_DEPRECATED=SK_NOTHING_ARG1',
156 'GR_GL_IGNORE_ES3_MSAA=0',
157 'SK_WILL_NEVER_DRAW_PERSPECTIVE_TEXT',
159 # This variable contains additional defines, specified in skia's
160 # skia_for_chromium_defines.gypi file.
161 '<@(skia_for_chromium_defines)',
164 'default_font_cache_limit%': '(20*1024*1024)',
168 # Android devices are typically more memory constrained, so
169 # default to a smaller glyph cache (it may be overriden at runtime
170 # when the renderer starts up, depending on the actual device memory).
171 'default_font_cache_limit': '(1*1024*1024)',
172 'skia_export_defines': [
173 'SK_BUILD_FOR_ANDROID',
180 '<@(skia_export_defines)',
182 # skia uses static initializers to initialize the serialization logic
183 # of its "pictures" library. This is currently not used in chrome; if
184 # it ever gets used the processes that use it need to call
185 # SkGraphics::Init().
186 'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0',
188 # Forcing the unoptimized path for the offset image filter in skia until
189 # all filters used in Blink support the optimized path properly
190 'SK_DISABLE_OFFSETIMAGEFILTER_OPTIMIZATION',
192 'IGNORE_ROT_AA_RECT_OPT',
194 'SK_IGNORE_BLURRED_RRECT_OPT',
196 # this flag forces Skia not to use typographic metrics with GDI.
197 'SK_GDI_ALWAYS_USE_TEXTMETRICS_FOR_FONT_METRICS',
199 'SK_DEFAULT_FONT_CACHE_LIMIT=<(default_font_cache_limit)',
201 'SK_USE_DISCARDABLE_SCALEDIMAGECACHE',
204 'direct_dependent_settings': {
206 '<@(skia_export_defines)',
210 # We would prefer this to be direct_dependent_settings,
211 # however we currently have no means to enforce that direct dependents
212 # re-export if they include Skia headers in their public headers.
213 'all_dependent_settings': {
220 'msvs_disabled_warnings': [4244, 4267, 4341, 4345, 4390, 4554, 4748, 4800],