Dan Sinclair | a03c343 | 2016-03-16 15:35:20 -0400 | [diff] [blame] | 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 | 'include_dirs': [ |
| 9 | '..', |
| 10 | 'config', |
| 11 | ], |
| 12 | |
| 13 | 'conditions': [ |
| 14 | [ 'OS != "android"', { |
| 15 | 'sources/': [ |
| 16 | ['exclude', '_android\\.(cc|cpp)$'], |
| 17 | ], |
| 18 | }], |
| 19 | [ 'OS != "ios"', { |
| 20 | 'sources/': [ |
| 21 | ['exclude', '_ios\\.(cc|cpp|mm?)$'], |
| 22 | ], |
| 23 | }], |
| 24 | [ 'OS == "ios"', { |
| 25 | 'defines': [ |
| 26 | 'SK_BUILD_FOR_IOS', |
| 27 | ], |
| 28 | }], |
Dan Sinclair | 4fdbf0b | 2016-03-17 13:24:56 -0400 | [diff] [blame] | 29 | [ 'OS == "win"', { |
| 30 | 'defines': [ |
| 31 | 'SK_BUILD_FOR_WIN32', |
| 32 | ], |
| 33 | }], |
Dan Sinclair | a03c343 | 2016-03-16 15:35:20 -0400 | [diff] [blame] | 34 | [ 'OS != "mac"', { |
| 35 | 'sources/': [ |
| 36 | ['exclude', '_mac\\.(cc|cpp|mm?)$'], |
| 37 | ], |
| 38 | }], |
| 39 | [ 'OS == "mac"', { |
| 40 | 'defines': [ |
| 41 | 'SK_BUILD_FOR_MAC', |
| 42 | ], |
| 43 | }], |
| 44 | [ 'OS != "win"', { |
| 45 | 'sources/': [ ['exclude', '_win\\.(cc|cpp)$'] ], |
| 46 | }], |
| 47 | [ '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 | 'GR_GL_FUNCTION_TYPE=__stdcall', |
| 55 | ], |
| 56 | }], |
| 57 | [ 'OS!="linux"', { |
| 58 | 'sources/': [ ['exclude', '_linux\\.(cc|cpp)$'] ], |
| 59 | }], |
| 60 | |
| 61 | #Settings for text blitting, chosen to approximate the system browser. |
| 62 | [ 'OS == "linux"', { |
| 63 | 'defines': [ |
| 64 | 'SK_GAMMA_EXPONENT=1.2', |
| 65 | 'SK_GAMMA_CONTRAST=0.2', |
| 66 | ], |
| 67 | }], |
| 68 | ['OS == "android"', { |
| 69 | 'defines': [ |
| 70 | 'SK_GAMMA_APPLY_TO_A8', |
| 71 | 'SK_GAMMA_EXPONENT=1.4', |
| 72 | 'SK_GAMMA_CONTRAST=0.0', |
| 73 | ], |
| 74 | }], |
| 75 | ['OS == "win"', { |
| 76 | 'defines': [ |
| 77 | 'SK_GAMMA_SRGB', |
| 78 | 'SK_GAMMA_CONTRAST=0.5', |
| 79 | ], |
| 80 | }], |
| 81 | ['OS == "mac"', { |
| 82 | 'defines': [ |
| 83 | 'SK_GAMMA_SRGB', |
| 84 | 'SK_GAMMA_CONTRAST=0.0', |
| 85 | ], |
| 86 | }], |
| 87 | |
| 88 | # Neon support. |
| 89 | [ 'target_arch == "arm" and arm_version >= 7 and arm_neon == 1', { |
| 90 | 'defines': [ |
| 91 | 'SK_ARM_HAS_NEON', |
| 92 | ], |
| 93 | }], |
| 94 | [ 'target_arch == "arm" and arm_version >= 7 and arm_neon == 0 and arm_neon_optional == 1', { |
| 95 | 'defines': [ |
| 96 | 'SK_ARM_HAS_OPTIONAL_NEON', |
| 97 | ], |
| 98 | }], |
| 99 | ], |
| 100 | |
| 101 | 'variables': { |
| 102 | 'variables': { |
| 103 | 'conditions': [ |
| 104 | ['OS== "ios"', { |
| 105 | 'skia_support_gpu': 0, |
| 106 | }, { |
| 107 | 'skia_support_gpu': 1, |
| 108 | }], |
| 109 | ], |
| 110 | }, |
| 111 | 'skia_support_gpu': '<(skia_support_gpu)', |
| 112 | 'skia_support_pdf': '<(skia_support_pdf)', |
| 113 | |
| 114 | # These two set the paths so we can include skia/gyp/core.gypi |
| 115 | 'skia_src_path': '../third_party/skia/src', |
| 116 | 'skia_include_path': '../third_party/skia/include', |
| 117 | |
| 118 | # This list will contain all defines that also need to be exported to |
| 119 | # dependent components. |
| 120 | 'skia_export_defines': [ |
| 121 | 'SK_SUPPORT_GPU=<(skia_support_gpu)', |
| 122 | ], |
| 123 | |
| 124 | 'default_font_cache_limit%': '(20*1024*1024)', |
| 125 | |
| 126 | 'conditions': [ |
| 127 | ['OS== "android"', { |
| 128 | # Android devices are typically more memory constrained, so |
| 129 | # default to a smaller glyph cache (it may be overriden at runtime |
| 130 | # when the renderer starts up, depending on the actual device memory). |
| 131 | 'default_font_cache_limit': '(1*1024*1024)', |
| 132 | 'skia_export_defines': [ |
| 133 | 'SK_BUILD_FOR_ANDROID', |
| 134 | ], |
| 135 | }], |
| 136 | ], |
| 137 | }, |
| 138 | |
| 139 | 'defines': [ |
| 140 | '<@(skia_export_defines)', |
| 141 | |
| 142 | 'SK_DEFAULT_FONT_CACHE_LIMIT=<(default_font_cache_limit)', |
| 143 | ], |
| 144 | |
| 145 | 'direct_dependent_settings': { |
| 146 | 'defines': [ |
| 147 | '<@(skia_export_defines)', |
| 148 | ], |
| 149 | }, |
| 150 | |
| 151 | # We would prefer this to be direct_dependent_settings, |
| 152 | # however we currently have no means to enforce that direct dependents |
| 153 | # re-export if they include Skia headers in their public headers. |
| 154 | 'all_dependent_settings': { |
| 155 | 'include_dirs': [ |
| 156 | '..', |
| 157 | 'config', |
| 158 | ], |
| 159 | }, |
| 160 | |
| 161 | 'msvs_disabled_warnings': [4244, 4267, 4341, 4345, 4390, 4554, 4748, 4800], |
| 162 | } |