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