OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 { | 5 { |
6 'conditions': [ | 6 'targets': [ |
7 # In component mode (shared_lib), we build all of content as a single DLL. | 7 { |
8 # However, in the static mode, we need to build content as multiple targets | 8 'target_name': 'skia', |
9 # in order to support the use case where a platform (e.g. Android) may | 9 'type': '<(component)', |
10 # already have a copy of skia as a system library. | 10 'variables': { |
11 ['component=="static_library"', { | 11 'conditions': [ |
12 'targets': [ | 12 ['OS== "ios"', { |
13 { | 13 'skia_support_gpu': 0, |
14 'target_name': 'skia', | 14 }, { |
15 'type': 'static_library', | 15 'skia_support_gpu': 1, |
| 16 }], |
| 17 ], |
| 18 |
| 19 'optimize': 'max', |
| 20 |
| 21 # These two set the paths so we can include skia/gyp/core.gypi |
| 22 'skia_src_path': '../third_party/skia/src', |
| 23 'skia_include_path': '../third_party/skia/include', |
| 24 }, |
| 25 |
| 26 'includes': [ |
| 27 '../third_party/skia/gyp/core.gypi', |
| 28 '../third_party/skia/gyp/effects.gypi', |
| 29 ], |
| 30 |
| 31 'sources': [ |
| 32 # this should likely be moved into src/utils in skia |
| 33 '../third_party/skia/src/core/SkFlate.cpp', |
| 34 # We don't want to add this to Skia's core.gypi since it is |
| 35 # Android only. Include it here and remove it for everyone |
| 36 # but Android later. |
| 37 '../third_party/skia/src/core/SkPaintOptionsAndroid.cpp', |
| 38 |
| 39 '../third_party/skia/src/ports/SkImageDecoder_empty.cpp', |
| 40 #'../third_party/skia/src/images/bmpdecoderhelper.cpp', |
| 41 #'../third_party/skia/src/images/bmpdecoderhelper.h', |
| 42 #'../third_party/skia/src/images/SkFDStream.cpp', |
| 43 #'../third_party/skia/src/images/SkImageDecoder.cpp', |
| 44 #'../third_party/skia/src/images/SkImageDecoder_FactoryDefault.cpp', |
| 45 #'../third_party/skia/src/images/SkImageDecoder_FactoryRegistrar.cpp', |
| 46 #'../third_party/skia/src/images/SkImageDecoder_fpdfemb.cpp', |
| 47 #'../third_party/skia/src/images/SkImageDecoder_libbmp.cpp', |
| 48 #'../third_party/skia/src/images/SkImageDecoder_libgif.cpp', |
| 49 #'../third_party/skia/src/images/SkImageDecoder_libico.cpp', |
| 50 #'../third_party/skia/src/images/SkImageDecoder_libjpeg.cpp', |
| 51 #'../third_party/skia/src/images/SkImageDecoder_libpng.cpp', |
| 52 #'../third_party/skia/src/images/SkImageDecoder_libpvjpeg.cpp', |
| 53 #'../third_party/skia/src/images/SkImageDecoder_wbmp.cpp', |
| 54 #'../third_party/skia/src/images/SkImageEncoder.cpp', |
| 55 #'../third_party/skia/src/images/SkImageEncoder_Factory.cpp', |
| 56 #'../third_party/skia/src/images/SkImageRef.cpp', |
| 57 #'../third_party/skia/src/images/SkImageRefPool.cpp', |
| 58 #'../third_party/skia/src/images/SkImageRefPool.h', |
| 59 #'../third_party/skia/src/images/SkImageRef_GlobalPool.cpp', |
| 60 #'../third_party/skia/src/images/SkMovie.cpp', |
| 61 #'../third_party/skia/src/images/SkMovie_gif.cpp', |
| 62 '../third_party/skia/src/images/SkScaledBitmapSampler.cpp', |
| 63 '../third_party/skia/src/images/SkScaledBitmapSampler.h', |
| 64 |
| 65 '../third_party/skia/src/opts/opts_check_SSE2.cpp', |
| 66 |
| 67 '../third_party/skia/src/pdf/SkPDFCatalog.cpp', |
| 68 '../third_party/skia/src/pdf/SkPDFCatalog.h', |
| 69 '../third_party/skia/src/pdf/SkPDFDevice.cpp', |
| 70 '../third_party/skia/src/pdf/SkPDFDocument.cpp', |
| 71 '../third_party/skia/src/pdf/SkPDFFont.cpp', |
| 72 '../third_party/skia/src/pdf/SkPDFFont.h', |
| 73 '../third_party/skia/src/pdf/SkPDFFormXObject.cpp', |
| 74 '../third_party/skia/src/pdf/SkPDFFormXObject.h', |
| 75 '../third_party/skia/src/pdf/SkPDFGraphicState.cpp', |
| 76 '../third_party/skia/src/pdf/SkPDFGraphicState.h', |
| 77 '../third_party/skia/src/pdf/SkPDFImage.cpp', |
| 78 '../third_party/skia/src/pdf/SkPDFImage.h', |
| 79 '../third_party/skia/src/pdf/SkPDFImageStream.cpp', |
| 80 '../third_party/skia/src/pdf/SkPDFImageStream.h', |
| 81 '../third_party/skia/src/pdf/SkPDFPage.cpp', |
| 82 '../third_party/skia/src/pdf/SkPDFPage.h', |
| 83 '../third_party/skia/src/pdf/SkPDFShader.cpp', |
| 84 '../third_party/skia/src/pdf/SkPDFShader.h', |
| 85 '../third_party/skia/src/pdf/SkPDFStream.cpp', |
| 86 '../third_party/skia/src/pdf/SkPDFStream.h', |
| 87 '../third_party/skia/src/pdf/SkPDFTypes.cpp', |
| 88 '../third_party/skia/src/pdf/SkPDFTypes.h', |
| 89 '../third_party/skia/src/pdf/SkPDFUtils.cpp', |
| 90 '../third_party/skia/src/pdf/SkPDFUtils.h', |
| 91 |
| 92 #'../third_party/skia/src/ports/SkPurgeableMemoryBlock_android.cpp', |
| 93 #'../third_party/skia/src/ports/SkPurgeableMemoryBlock_mac.cpp', |
| 94 '../third_party/skia/src/ports/SkPurgeableMemoryBlock_none.cpp', |
| 95 |
| 96 '../third_party/skia/src/ports/SkFontConfigInterface_android.cpp', |
| 97 #'../third_party/skia/src/ports/SkFontHost_FONTPATH.cpp', |
| 98 '../third_party/skia/src/ports/SkFontHost_FreeType.cpp', |
| 99 '../third_party/skia/src/ports/SkFontHost_FreeType_common.cpp', |
| 100 '../third_party/skia/src/ports/SkFontHost_FreeType_common.h', |
| 101 '../third_party/skia/src/ports/SkFontConfigParser_android.cpp', |
| 102 #'../third_party/skia/src/ports/SkFontHost_ascender.cpp', |
| 103 #'../third_party/skia/src/ports/SkFontHost_linux.cpp', |
| 104 '../third_party/skia/src/ports/SkFontHost_mac.cpp', |
| 105 #'../third_party/skia/src/ports/SkFontHost_none.cpp', |
| 106 '../third_party/skia/src/ports/SkFontHost_win.cpp', |
| 107 '../third_party/skia/src/ports/SkGlobalInitialization_chromium.cpp', |
| 108 #'../third_party/skia/src/ports/SkImageDecoder_CG.cpp', |
| 109 #'../third_party/skia/src/ports/SkImageDecoder_empty.cpp', |
| 110 #'../third_party/skia/src/ports/SkImageRef_ashmem.cpp', |
| 111 #'../third_party/skia/src/ports/SkImageRef_ashmem.h', |
| 112 #'../third_party/skia/src/ports/SkOSEvent_android.cpp', |
| 113 #'../third_party/skia/src/ports/SkOSEvent_dummy.cpp', |
| 114 '../third_party/skia/src/ports/SkOSFile_posix.cpp', |
| 115 '../third_party/skia/src/ports/SkOSFile_stdio.cpp', |
| 116 '../third_party/skia/src/ports/SkOSFile_win.cpp', |
| 117 #'../third_party/skia/src/ports/SkThread_none.cpp', |
| 118 '../third_party/skia/src/ports/SkThread_pthread.cpp', |
| 119 '../third_party/skia/src/ports/SkThread_win.cpp', |
| 120 '../third_party/skia/src/ports/SkTime_Unix.cpp', |
| 121 #'../third_party/skia/src/ports/SkXMLParser_empty.cpp', |
| 122 #'../third_party/skia/src/ports/SkXMLParser_expat.cpp', |
| 123 #'../third_party/skia/src/ports/SkXMLParser_tinyxml.cpp', |
| 124 #'../third_party/skia/src/ports/SkXMLPullParser_expat.cpp', |
| 125 |
| 126 '../third_party/skia/src/sfnt/SkOTUtils.cpp', |
| 127 '../third_party/skia/src/sfnt/SkOTUtils.h', |
| 128 |
| 129 '../third_party/skia/include/utils/mac/SkCGUtils.h', |
| 130 '../third_party/skia/include/utils/SkDeferredCanvas.h', |
| 131 '../third_party/skia/include/utils/SkMatrix44.h', |
| 132 '../third_party/skia/src/utils/debugger/SkDebugCanvas.cpp', |
| 133 '../third_party/skia/src/utils/debugger/SkDebugCanvas.h', |
| 134 '../third_party/skia/src/utils/debugger/SkDrawCommand.cpp', |
| 135 '../third_party/skia/src/utils/debugger/SkDrawCommand.h', |
| 136 '../third_party/skia/src/utils/debugger/SkObjectParser.cpp', |
| 137 '../third_party/skia/src/utils/debugger/SkObjectParser.h', |
| 138 '../third_party/skia/src/utils/mac/SkCreateCGImageRef.cpp', |
| 139 '../third_party/skia/src/utils/SkBase64.cpp', |
| 140 '../third_party/skia/src/utils/SkBase64.h', |
| 141 '../third_party/skia/src/utils/SkBitSet.cpp', |
| 142 '../third_party/skia/src/utils/SkBitSet.h', |
| 143 '../third_party/skia/src/utils/SkDeferredCanvas.cpp', |
| 144 '../third_party/skia/src/utils/SkMatrix44.cpp', |
| 145 '../third_party/skia/src/utils/SkNullCanvas.cpp', |
| 146 '../third_party/skia/include/utils/SkNWayCanvas.h', |
| 147 '../third_party/skia/src/utils/SkNWayCanvas.cpp', |
| 148 '../third_party/skia/src/utils/SkPictureUtils.cpp', |
| 149 '../third_party/skia/src/utils/SkRTConf.cpp', |
| 150 '../third_party/skia/include/utils/SkRTConf.h', |
| 151 '../third_party/skia/include/pdf/SkPDFDevice.h', |
| 152 '../third_party/skia/include/pdf/SkPDFDocument.h', |
| 153 |
| 154 '../third_party/skia/include/ports/SkTypeface_win.h', |
| 155 |
| 156 #'../third_party/skia/include/images/SkImageDecoder.h', |
| 157 #'../third_party/skia/include/images/SkImageEncoder.h', |
| 158 '../third_party/skia/include/images/SkImageRef.h', |
| 159 '../third_party/skia/include/images/SkImageRef_GlobalPool.h', |
| 160 '../third_party/skia/include/images/SkMovie.h', |
| 161 '../third_party/skia/include/images/SkPageFlipper.h', |
| 162 |
| 163 '../third_party/skia/include/utils/SkNullCanvas.h', |
| 164 '../third_party/skia/include/utils/SkPictureUtils.h', |
| 165 'ext/analysis_canvas.cc', |
| 166 'ext/analysis_canvas.h', |
| 167 'ext/bitmap_platform_device.h', |
| 168 'ext/bitmap_platform_device_android.cc', |
| 169 'ext/bitmap_platform_device_android.h', |
| 170 'ext/bitmap_platform_device_data.h', |
| 171 'ext/bitmap_platform_device_linux.cc', |
| 172 'ext/bitmap_platform_device_linux.h', |
| 173 'ext/bitmap_platform_device_mac.cc', |
| 174 'ext/bitmap_platform_device_mac.h', |
| 175 'ext/bitmap_platform_device_win.cc', |
| 176 'ext/bitmap_platform_device_win.h', |
| 177 'ext/convolver.cc', |
| 178 'ext/convolver.h', |
| 179 'ext/google_logging.cc', |
| 180 'ext/image_operations.cc', |
| 181 'ext/image_operations.h', |
| 182 'ext/lazy_pixel_ref.cc', |
| 183 'ext/lazy_pixel_ref.h', |
| 184 'ext/lazy_pixel_ref_utils.cc', |
| 185 'ext/lazy_pixel_ref_utils.h', |
| 186 'ext/SkThread_chrome.cc', |
| 187 'ext/paint_simplifier.cc', |
| 188 'ext/paint_simplifier.h', |
| 189 'ext/platform_canvas.cc', |
| 190 'ext/platform_canvas.h', |
| 191 'ext/platform_device.cc', |
| 192 'ext/platform_device.h', |
| 193 'ext/platform_device_linux.cc', |
| 194 'ext/platform_device_mac.cc', |
| 195 'ext/platform_device_win.cc', |
| 196 'ext/recursive_gaussian_convolution.cc', |
| 197 'ext/recursive_gaussian_convolution.h', |
| 198 'ext/refptr.h', |
| 199 'ext/SkMemory_new_handler.cpp', |
| 200 'ext/skia_trace_shim.h', |
| 201 'ext/skia_utils_base.cc', |
| 202 'ext/skia_utils_base.h', |
| 203 'ext/skia_utils_ios.mm', |
| 204 'ext/skia_utils_ios.h', |
| 205 'ext/skia_utils_mac.mm', |
| 206 'ext/skia_utils_mac.h', |
| 207 'ext/skia_utils_win.cc', |
| 208 'ext/skia_utils_win.h', |
| 209 'ext/vector_canvas.cc', |
| 210 'ext/vector_canvas.h', |
| 211 'ext/vector_platform_device_emf_win.cc', |
| 212 'ext/vector_platform_device_emf_win.h', |
| 213 'ext/vector_platform_device_skia.cc', |
| 214 'ext/vector_platform_device_skia.h', |
| 215 ], |
| 216 'include_dirs': [ |
| 217 '..', |
| 218 'config', |
| 219 '../third_party/skia/include/config', |
| 220 '../third_party/skia/include/core', |
| 221 '../third_party/skia/include/effects', |
| 222 '../third_party/skia/include/images', |
| 223 '../third_party/skia/include/lazy', |
| 224 '../third_party/skia/include/pathops', |
| 225 '../third_party/skia/include/pdf', |
| 226 '../third_party/skia/include/pipe', |
| 227 '../third_party/skia/include/ports', |
| 228 '../third_party/skia/include/utils', |
| 229 '../third_party/skia/src/core', |
| 230 '../third_party/skia/src/image', |
| 231 '../third_party/skia/src/sfnt', |
| 232 '../third_party/skia/src/utils', |
| 233 '../third_party/skia/src/lazy', |
| 234 ], |
| 235 'msvs_disabled_warnings': [4244, 4267, 4341, 4345, 4390, 4554, 4748, 4800]
, |
| 236 'defines': [ |
| 237 #'SK_GAMMA_SRGB', |
| 238 #'SK_GAMMA_APPLY_TO_A8', |
| 239 'SK_BUILD_NO_IMAGE_ENCODE', |
| 240 'GR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"', |
| 241 'GR_STATIC_RECT_VB=1', |
| 242 'GR_AGGRESSIVE_SHADER_OPTS=1', |
| 243 'SK_DEFERRED_CANVAS_USES_GPIPE=1', |
| 244 'SK_ENABLE_INST_COUNT=0', |
| 245 |
| 246 # this flag can be removed entirely once this has baked for a while |
| 247 'SK_ALLOW_OVER_32K_BITMAPS', |
| 248 |
| 249 # skia uses static initializers to initialize the serialization logic |
| 250 # of its "pictures" library. This is currently not used in chrome; if |
| 251 # it ever gets used the processes that use it need to call |
| 252 # SkGraphics::Init(). |
| 253 'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0', |
| 254 |
| 255 # Disable this check because it is too strict for some Chromium-specific |
| 256 # subclasses of SkPixelRef. See bug: crbug.com/171776. |
| 257 'SK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK', |
| 258 |
| 259 'IGNORE_ROT_AA_RECT_OPT', |
| 260 ], |
| 261 'sources!': [ |
| 262 '../third_party/skia/include/core/SkTypes.h', |
| 263 ], |
| 264 'conditions': [ |
| 265 ['skia_support_gpu != 0', { |
| 266 'includes': [ |
| 267 '../third_party/skia/gyp/gpu.gypi', |
| 268 ], |
| 269 'sources': [ |
| 270 '<@(skgpu_sources)', |
| 271 ], |
| 272 'include_dirs': [ |
| 273 '../third_party/skia/include/gpu', |
| 274 '../third_party/skia/include/gpu/gl', |
| 275 '../third_party/skia/src/gpu', |
| 276 ], |
| 277 }, { # skia_support_gpu == 0 |
| 278 'defines': [ |
| 279 'SK_SUPPORT_GPU=0', |
| 280 ], |
| 281 }], |
| 282 #Settings for text blitting, chosen to approximate the system browser. |
| 283 [ 'OS == "linux"', { |
| 284 'defines': [ |
| 285 'SK_GAMMA_EXPONENT=1.2', |
| 286 'SK_GAMMA_CONTRAST=0.2', |
| 287 ], |
| 288 }], |
| 289 ['OS == "android"', { |
| 290 'defines': [ |
| 291 'SK_GAMMA_APPLY_TO_A8', |
| 292 'SK_GAMMA_EXPONENT=1.4', |
| 293 'SK_GAMMA_CONTRAST=0.0', |
| 294 ], |
| 295 }], |
| 296 ['OS == "win"', { |
| 297 'defines': [ |
| 298 'SK_GAMMA_SRGB', |
| 299 'SK_GAMMA_CONTRAST=0.5', |
| 300 ], |
| 301 }], |
| 302 ['OS == "mac"', { |
| 303 'defines': [ |
| 304 'SK_GAMMA_SRGB', |
| 305 'SK_GAMMA_CONTRAST=0.0', |
| 306 ], |
| 307 }], |
| 308 |
| 309 # For POSIX platforms, prefer the Mutex implementation provided by Skia |
| 310 # since it does not generate static initializers. |
| 311 [ 'OS == "android" or OS == "linux" or OS == "mac" or OS == "ios"', { |
| 312 'defines+': [ |
| 313 'SK_USE_POSIX_THREADS', |
| 314 ], |
| 315 'direct_dependent_settings': { |
| 316 'defines': [ |
| 317 'SK_USE_POSIX_THREADS', |
| 318 ], |
| 319 }, |
| 320 'sources!': [ |
| 321 'ext/SkThread_chrome.cc', |
| 322 ], |
| 323 }], |
| 324 [ 'OS != "android"', { |
| 325 'sources/': [ |
| 326 ['exclude', '_android\\.(cc|cpp)$'], |
| 327 ], |
| 328 'sources!': [ |
| 329 '../third_party/skia/src/core/SkPaintOptionsAndroid.cpp', |
| 330 ], |
| 331 'defines': [ |
| 332 'SK_DEFAULT_FONT_CACHE_LIMIT=(20*1024*1024)', |
| 333 ], |
| 334 }], |
| 335 [ 'OS != "ios"', { |
| 336 'sources/': [ |
| 337 ['exclude', '_ios\\.(cc|cpp|mm?)$'], |
| 338 ], |
16 'dependencies': [ | 339 'dependencies': [ |
17 'skia_library', | 340 '<(DEPTH)/third_party/WebKit/Source/WebKit/chromium/skia_webkit.gyp:
skia_webkit', |
18 'skia_chrome', | 341 ], |
19 ], | 342 }], |
20 'export_dependent_settings': [ | 343 [ 'OS != "mac"', { |
21 'skia_library', | 344 'sources/': [ |
22 'skia_chrome', | 345 ['exclude', '_mac\\.(cc|cpp|mm?)$'], |
23 ], | 346 ['exclude', '/mac/'] |
24 }, | 347 ], |
25 { | 348 }], |
26 'target_name': 'skia_library', | 349 [ 'OS != "win"', { |
27 'type': 'static_library', | 350 'sources/': [ ['exclude', '_win\\.(cc|cpp)$'] ], |
| 351 }], |
| 352 [ 'target_arch == "arm" and arm_version >= 7 and arm_neon == 1', { |
| 353 'defines': [ |
| 354 '__ARM_HAVE_NEON', |
| 355 ], |
| 356 }], |
| 357 [ 'target_arch == "arm" and arm_version >= 7 and arm_neon_optional == 1'
, { |
| 358 'defines': [ |
| 359 '__ARM_HAVE_OPTIONAL_NEON_SUPPORT', |
| 360 ], |
| 361 }], |
| 362 [ 'OS == "android" and target_arch == "arm"', { |
| 363 'sources': [ |
| 364 '../third_party/skia/src/core/SkUtilsArm.cpp', |
| 365 ], |
28 'includes': [ | 366 'includes': [ |
29 'skia_library.gypi', | 367 '../build/android/cpufeatures.gypi', |
30 'skia_common.gypi', | 368 ], |
31 ], | 369 }], |
32 }, | 370 [ 'target_arch == "arm" or target_arch == "mipsel"', { |
33 { | 371 'sources!': [ |
34 'target_name': 'skia_chrome', | 372 '../third_party/skia/src/opts/opts_check_SSE2.cpp' |
35 'type': 'static_library', | 373 ], |
36 'includes': [ | 374 }], |
37 'skia_chrome.gypi', | 375 [ 'use_glib == 1', { |
38 'skia_common.gypi', | 376 'dependencies': [ |
39 ], | 377 '../build/linux/system.gyp:fontconfig', |
40 | 378 '../build/linux/system.gyp:freetype2', |
41 }, | 379 '../build/linux/system.gyp:pangocairo', |
42 ], | 380 '../third_party/icu/icu.gyp:icuuc', |
43 }, | 381 ], |
44 { # component != static_library | 382 'cflags': [ |
45 'targets': [ | 383 '-Wno-unused', |
46 { | 384 '-Wno-unused-function', |
47 'target_name': 'skia', | 385 ], |
48 'type': 'shared_library', | 386 'sources': [ |
49 'includes': [ | 387 '../third_party/skia/src/fonts/SkFontMgr_fontconfig.cpp', |
50 'skia_library.gypi', | 388 '../third_party/skia/src/ports/SkFontHost_fontconfig.cpp', |
51 'skia_chrome.gypi', | 389 '../third_party/skia/src/ports/SkFontConfigInterface_direct.cpp', |
52 'skia_common.gypi', | 390 ], |
53 ], | 391 'defines': [ |
54 'defines': [ | 392 # 'SK_USE_COLOR_LUMINANCE', |
55 'SKIA_DLL', | 393 ], |
| 394 }], |
| 395 [ 'use_glib == 0 and OS != "android"', { |
| 396 'sources/': [ ['exclude', '_linux\\.(cc|cpp)$'] ], |
| 397 'sources!': [ |
| 398 '../third_party/skia/src/ports/SkFontHost_FreeType.cpp', |
| 399 '../third_party/skia/src/ports/SkFontHost_FreeType_common.cpp', |
| 400 ], |
| 401 }], |
| 402 [ 'toolkit_uses_gtk == 1', { |
| 403 'dependencies': [ |
| 404 '../build/linux/system.gyp:gdk', |
| 405 ], |
| 406 }, { # toolkit_uses_gtk == 0 |
| 407 'sources/': [ ['exclude', '_gtk\\.(cc|cpp)$'] ], |
| 408 }], |
| 409 [ 'OS == "android"', { |
| 410 'sources': [ |
| 411 '../third_party/skia/src/ports/SkFontHost_fontconfig.cpp', |
| 412 ], |
| 413 'sources/': [ |
| 414 ['exclude', '_linux\\.(cc|cpp)$'], |
| 415 ], |
| 416 'conditions': [ |
| 417 [ '_toolset == "target"', { |
| 418 'defines': [ |
| 419 'HAVE_PTHREADS', |
| 420 'OS_ANDROID', |
| 421 'SK_BUILD_FOR_ANDROID', |
| 422 # Android devices are typically more memory constrained, so |
| 423 # use a smaller glyph cache. |
| 424 'SK_DEFAULT_FONT_CACHE_LIMIT=(8*1024*1024)', |
| 425 'USE_CHROMIUM_SKIA', |
| 426 ], |
| 427 'dependencies': [ |
| 428 '../third_party/expat/expat.gyp:expat', |
| 429 '../third_party/freetype/freetype.gyp:ft2', |
| 430 'skia_opts' |
| 431 ], |
| 432 'dependencies!': [ |
| 433 # Android doesn't use Skia's PDF generation, which is what uses |
| 434 # sfntly. |
| 435 '../third_party/sfntly/sfntly.gyp:sfntly', |
| 436 ], |
| 437 # This exports a hard dependency because it needs to run its |
| 438 # symlink action in order to expose the skia header files. |
| 439 'hard_dependency': 1, |
| 440 'include_dirs': [ |
| 441 '../third_party/expat/files/lib', |
| 442 ], |
| 443 'sources/': [ |
| 444 ['include', 'ext/platform_device_linux\\.cc$'], |
| 445 ['exclude', '../third_party/skia/src/pdf/'], |
| 446 ], |
| 447 'sources!': [ |
| 448 'ext/vector_platform_device_skia.cc', |
| 449 ], |
| 450 }], |
| 451 [ '_toolset == "target" and android_webview_build == 0', { |
| 452 'defines': [ |
| 453 'HAVE_ENDIAN_H', |
| 454 ], |
| 455 }], |
| 456 [ '_toolset=="host" and host_os=="linux"', { |
| 457 'sources': [ |
| 458 'ext/platform_device_linux.cc', |
| 459 ], |
| 460 }], |
| 461 ], |
| 462 }], |
| 463 [ 'OS == "ios"', { |
| 464 'defines': [ |
| 465 'SK_BUILD_FOR_IOS', |
| 466 'SK_USE_MAC_CORE_TEXT', |
| 467 ], |
| 468 'include_dirs': [ |
| 469 '../third_party/skia/include/utils/ios', |
| 470 '../third_party/skia/include/utils/mac', |
| 471 ], |
| 472 'link_settings': { |
| 473 'libraries': [ |
| 474 '$(SDKROOT)/System/Library/Frameworks/ImageIO.framework', |
| 475 ], |
| 476 }, |
| 477 'dependencies': [ |
| 478 'skia_opts_ios', |
| 479 ], |
| 480 'dependencies!': [ |
| 481 'skia_opts', |
| 482 '../third_party/sfntly/sfntly.gyp:sfntly', |
| 483 ], |
| 484 'sources': [ |
| 485 # This file is used on both iOS and Mac, so it should be removed |
| 486 # from the ios and mac conditions and moved into the main sources |
| 487 # list. |
| 488 '../third_party/skia/src/utils/mac/SkStream_mac.cpp', |
| 489 ], |
| 490 'sources/': [ |
| 491 ['exclude', '/pdf/'], |
| 492 ['exclude', '^ext/vector_platform_device_skia\\.'], |
| 493 ['exclude', 'opts_check_SSE2\\.cpp$'], |
| 494 ], |
| 495 }], |
| 496 [ 'OS == "mac"', { |
| 497 'defines': [ |
| 498 'SK_BUILD_FOR_MAC', |
| 499 'SK_USE_MAC_CORE_TEXT', |
| 500 # 'SK_USE_COLOR_LUMINANCE', |
| 501 ], |
| 502 'include_dirs': [ |
| 503 '../third_party/skia/include/utils/mac', |
| 504 ], |
| 505 'link_settings': { |
| 506 'libraries': [ |
| 507 '$(SDKROOT)/System/Library/Frameworks/AppKit.framework', |
| 508 ], |
| 509 }, |
| 510 'sources': [ |
| 511 '../third_party/skia/src/utils/mac/SkStream_mac.cpp', |
| 512 ], |
| 513 }], |
| 514 [ 'OS == "win"', { |
| 515 'defines': [ |
| 516 'SK_GDI_ALWAYS_USE_TEXTMETRICS_FOR_FONT_METRICS' |
| 517 ], |
| 518 'sources!': [ |
| 519 '../third_party/skia/src/ports/SkOSFile_posix.cpp', |
| 520 '../third_party/skia/src/ports/SkThread_pthread.cpp', |
| 521 '../third_party/skia/src/ports/SkTime_Unix.cpp', |
| 522 'ext/SkThread_chrome.cc', |
| 523 ], |
| 524 'include_dirs': [ |
| 525 'config/win', |
| 526 ], |
| 527 'direct_dependent_settings': { |
| 528 'include_dirs': [ |
| 529 'config/win', |
| 530 ], |
| 531 }, |
| 532 }], |
| 533 ['component=="shared_library"', { |
| 534 'defines': [ |
56 'GR_DLL=1', | 535 'GR_DLL=1', |
57 'GR_IMPLEMENTATION=1', | 536 'GR_IMPLEMENTATION=1', |
| 537 'SKIA_DLL', |
58 'SKIA_IMPLEMENTATION=1', | 538 'SKIA_IMPLEMENTATION=1', |
59 ], | 539 ], |
| 540 'dependencies': [ |
| 541 '../base/base.gyp:base', |
| 542 ], |
60 'direct_dependent_settings': { | 543 'direct_dependent_settings': { |
61 'defines': [ | 544 'defines': [ |
| 545 'GR_DLL', |
62 'SKIA_DLL', | 546 'SKIA_DLL', |
63 'GR_DLL=1', | |
64 ], | 547 ], |
65 }, | 548 }, |
66 }, | 549 }], |
67 { | 550 # TODO(scottmg): http://crbug.com/177306 |
68 'target_name': 'skia_library', | 551 ['clang==1', { |
69 'type': 'none', | 552 'xcode_settings': { |
70 }, | 553 'WARNING_CFLAGS!': [ |
71 { | 554 # Don't warn about string->bool used in asserts. |
72 'target_name': 'skia_chrome', | 555 '-Wstring-conversion', |
73 'type': 'none', | 556 ], |
74 }, | 557 }, |
75 ], | 558 'cflags!': [ |
76 }], | 559 '-Wstring-conversion', |
77 ], | 560 ], |
78 | 561 }], |
79 # targets that are not dependent upon the component type | 562 ], |
80 'targets': [ | 563 'dependencies': [ |
| 564 'skia_opts', |
| 565 '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic
_annotations', |
| 566 '../third_party/sfntly/sfntly.gyp:sfntly', |
| 567 '../third_party/zlib/zlib.gyp:zlib', |
| 568 ], |
| 569 'direct_dependent_settings': { |
| 570 'include_dirs': [ |
| 571 'config', |
| 572 |
| 573 #temporary until we can hide SkFontHost |
| 574 '../third_party/skia/src/core', |
| 575 |
| 576 '../third_party/skia/include/config', |
| 577 '../third_party/skia/include/core', |
| 578 '../third_party/skia/include/effects', |
| 579 '../third_party/skia/include/pdf', |
| 580 '../third_party/skia/include/gpu', |
| 581 '../third_party/skia/include/gpu/gl', |
| 582 '../third_party/skia/include/lazy', |
| 583 '../third_party/skia/include/pathops', |
| 584 '../third_party/skia/include/pipe', |
| 585 '../third_party/skia/include/ports', |
| 586 '../third_party/skia/include/utils', |
| 587 'ext', |
| 588 ], |
| 589 'defines': [ |
| 590 'SK_BUILD_NO_IMAGE_ENCODE', |
| 591 'SK_DEFERRED_CANVAS_USES_GPIPE=1', |
| 592 'GR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"', |
| 593 'GR_AGGRESSIVE_SHADER_OPTS=1', |
| 594 'SK_ENABLE_INST_COUNT=0', |
| 595 ], |
| 596 'conditions': [ |
| 597 ['OS=="android"', { |
| 598 'dependencies!': [ |
| 599 'skia_opts', |
| 600 '../third_party/zlib/zlib.gyp:zlib', |
| 601 ], |
| 602 'defines': [ |
| 603 # Don't use non-NDK available stuff. |
| 604 'SK_BUILD_FOR_ANDROID', |
| 605 ], |
| 606 'conditions': [ |
| 607 [ '_toolset == "target" and android_webview_build == 0', { |
| 608 'defines': [ |
| 609 'HAVE_ENDIAN_H', |
| 610 ], |
| 611 }], |
| 612 ], |
| 613 }], |
| 614 ['OS=="mac"', { |
| 615 'include_dirs': [ |
| 616 '../third_party/skia/include/utils/mac', |
| 617 ], |
| 618 }], |
| 619 ], |
| 620 }, |
| 621 'target_conditions': [ |
| 622 # Pull in specific Mac files for iOS (which have been filtered out |
| 623 # by file name rules). |
| 624 [ 'OS == "ios"', { |
| 625 'sources/': [ |
| 626 ['include', 'SkFontHost_mac\\.cpp$',], |
| 627 ['include', 'SkStream_mac\\.cpp$',], |
| 628 ['include', 'SkCreateCGImageRef\\.cpp$',], |
| 629 ], |
| 630 }], |
| 631 ], |
| 632 }, |
| 633 |
| 634 # Due to an unfortunate intersection of lameness between gcc and gyp, |
| 635 # we have to build the *_SSE2.cpp files in a separate target. The |
| 636 # gcc lameness is that, in order to compile SSE2 intrinsics code, it |
| 637 # must be passed the -msse2 flag. However, with this flag, it may |
| 638 # emit SSE2 instructions even for scalar code, such as the CPUID |
| 639 # test used to test for the presence of SSE2. So that, and all other |
| 640 # code must be compiled *without* -msse2. The gyp lameness is that it |
| 641 # does not allow file-specific CFLAGS, so we must create this extra |
| 642 # target for those files to be compiled with -msse2. |
| 643 # |
| 644 # This is actually only a problem on 32-bit Linux (all Intel Macs have |
| 645 # SSE2, Linux x86_64 has SSE2 by definition, and MSC will happily emit |
| 646 # SSE2 from instrinsics, which generating plain ol' 386 for everything |
| 647 # else). However, to keep the .gyp file simple and avoid platform-specific |
| 648 # build breakage, we do this on all platforms. |
| 649 |
| 650 # For about the same reason, we need to compile the ARM opts files |
| 651 # separately as well. |
81 { | 652 { |
82 'target_name': 'skia_chrome_opts', | 653 'target_name': 'skia_opts', |
| 654 'type': 'static_library', |
| 655 'variables': { |
| 656 'optimize': 'max', |
| 657 }, |
| 658 'include_dirs': [ |
| 659 '..', |
| 660 'config', |
| 661 '../third_party/skia/include/config', |
| 662 '../third_party/skia/include/core', |
| 663 '../third_party/skia/include/effects', |
| 664 '../third_party/skia/include/images', |
| 665 '../third_party/skia/include/lazy', |
| 666 '../third_party/skia/include/pathops', |
| 667 '../third_party/skia/include/utils', |
| 668 '../third_party/skia/src/core', |
| 669 ], |
| 670 'conditions': [ |
| 671 [ 'os_posix == 1 and OS != "mac" and OS != "android" and \ |
| 672 target_arch != "arm" and target_arch != "mipsel"', { |
| 673 'cflags': [ |
| 674 '-msse2', |
| 675 ], |
| 676 }], |
| 677 [ 'OS == "android"', { |
| 678 'defines': [ |
| 679 'SK_BUILD_FOR_ANDROID', |
| 680 ], |
| 681 }], |
| 682 [ 'target_arch != "arm" and target_arch != "mipsel"', { |
| 683 'sources': [ |
| 684 '../third_party/skia/src/opts/SkBitmapProcState_opts_SSE2.cpp', |
| 685 '../third_party/skia/src/opts/SkBlitRect_opts_SSE2.cpp', |
| 686 '../third_party/skia/src/opts/SkBlitRow_opts_SSE2.cpp', |
| 687 '../third_party/skia/src/opts/SkUtils_opts_SSE2.cpp', |
| 688 '../third_party/skia/src/opts/SkBitmapFilter_opts_SSE2.cpp', |
| 689 'ext/convolver_SSE2.cc', |
| 690 ], |
| 691 'conditions': [ |
| 692 # x86 Android doesn't support SSSE3 instructions. |
| 693 [ 'OS != "android"', { |
| 694 'dependencies': [ |
| 695 'skia_opts_ssse3', |
| 696 ], |
| 697 }], |
| 698 ], |
| 699 }], |
| 700 [ 'target_arch == "arm"', { |
| 701 'conditions': [ |
| 702 [ 'arm_version >= 7 and arm_neon == 1', { |
| 703 'defines': [ |
| 704 '__ARM_HAVE_NEON', |
| 705 ], |
| 706 }], |
| 707 [ 'arm_version >= 7 and arm_neon_optional == 1', { |
| 708 'defines': [ |
| 709 '__ARM_HAVE_OPTIONAL_NEON_SUPPORT', |
| 710 ], |
| 711 }], |
| 712 [ 'arm_version >= 7 and (arm_neon == 1 or arm_neon_optional == 1)',
{ |
| 713 'cflags': [ |
| 714 # The neon assembly contains conditional instructions which |
| 715 # aren't enclosed in an IT block. The assembler complains |
| 716 # without this option. |
| 717 # See #86592. |
| 718 '-Wa,-mimplicit-it=always', |
| 719 ], |
| 720 'dependencies': [ |
| 721 'skia_opts_neon', |
| 722 ] |
| 723 }], |
| 724 ], |
| 725 # The assembly uses the frame pointer register (r7 in Thumb/r11 in |
| 726 # ARM), the compiler doesn't like that. Explicitly remove the |
| 727 # -fno-omit-frame-pointer flag for Android, as that gets added to all |
| 728 # targets via common.gypi. |
| 729 'cflags!': [ |
| 730 '-fno-omit-frame-pointer', |
| 731 '-marm', |
| 732 '-mapcs-frame', |
| 733 ], |
| 734 'cflags': [ |
| 735 '-fomit-frame-pointer', |
| 736 ], |
| 737 'sources': [ |
| 738 '../third_party/skia/src/opts/SkBitmapProcState_opts_arm.cpp', |
| 739 ], |
| 740 }], |
| 741 [ 'target_arch == "arm" and (arm_version < 7 or (arm_neon == 0 and arm_n
eon_optional == 1))', { |
| 742 'sources': [ |
| 743 '../third_party/skia/src/opts/memset.arm.S', |
| 744 ], |
| 745 }], |
| 746 [ 'target_arch == "arm" and arm_version < 6', { |
| 747 'sources': [ |
| 748 '../third_party/skia/src/opts/SkBlitRow_opts_none.cpp', |
| 749 '../third_party/skia/src/opts/SkUtils_opts_none.cpp', |
| 750 ], |
| 751 }], |
| 752 [ 'target_arch == "arm" and arm_version >= 6', { |
| 753 'sources': [ |
| 754 '../third_party/skia/src/opts/SkBlitRow_opts_arm.cpp', |
| 755 '../third_party/skia/src/opts/SkBlitRow_opts_arm.h', |
| 756 '../third_party/skia/src/opts/opts_check_arm.cpp', |
| 757 ], |
| 758 }], |
| 759 [ 'target_arch == "mipsel"',{ |
| 760 'cflags': [ |
| 761 '-fomit-frame-pointer', |
| 762 ], |
| 763 'sources': [ |
| 764 '../third_party/skia/src/opts/SkBitmapProcState_opts_none.cpp', |
| 765 '../third_party/skia/src/opts/SkBlitRow_opts_none.cpp', |
| 766 '../third_party/skia/src/opts/SkUtils_opts_none.cpp', |
| 767 'ext/convolver_mips_dspr2.cc', |
| 768 ], |
| 769 }], |
| 770 ], |
| 771 }, |
| 772 # For the same lame reasons as what is done for skia_opts, we have to |
| 773 # create another target specifically for SSSE3 code as we would not want |
| 774 # to compile the SSE2 code with -mssse3 which would potentially allow |
| 775 # gcc to generate SSSE3 code. |
| 776 { |
| 777 'target_name': 'skia_opts_ssse3', |
| 778 'type': 'static_library', |
| 779 'variables': { |
| 780 'optimize': 'max', |
| 781 }, |
| 782 'include_dirs': [ |
| 783 '..', |
| 784 'config', |
| 785 '../third_party/skia/include/config', |
| 786 '../third_party/skia/include/core', |
| 787 '../third_party/skia/include/pathops', |
| 788 '../third_party/skia/src/core', |
| 789 ], |
| 790 'conditions': [ |
| 791 [ 'OS in ["linux", "freebsd", "openbsd", "solaris"]', { |
| 792 'cflags': [ |
| 793 '-mssse3', |
| 794 ], |
| 795 }], |
| 796 [ 'OS == "mac"', { |
| 797 'xcode_settings': { |
| 798 'GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS': 'YES', |
| 799 }, |
| 800 }], |
| 801 [ 'OS == "win"', { |
| 802 'include_dirs': [ |
| 803 'config/win', |
| 804 ], |
| 805 'direct_dependent_settings': { |
| 806 'include_dirs': [ |
| 807 'config/win', |
| 808 ], |
| 809 }, |
| 810 }], |
| 811 [ 'target_arch != "arm" and target_arch != "mipsel"', { |
| 812 'sources': [ |
| 813 '../third_party/skia/src/opts/SkBitmapProcState_opts_SSSE3.cpp', |
| 814 ], |
| 815 }], |
| 816 ], |
| 817 }, |
| 818 # NEON code must be compiled with -mfpu=neon which also affects scalar |
| 819 # code. To support dynamic NEON code paths, we need to build all |
| 820 # NEON-specific sources in a separate static library. The situation |
| 821 # is very similar to the SSSE3 one. |
| 822 { |
| 823 'target_name': 'skia_opts_neon', |
83 'type': 'static_library', | 824 'type': 'static_library', |
84 'include_dirs': [ | 825 'include_dirs': [ |
85 '..', | 826 '..', |
86 'config', | 827 'config', |
87 '../third_party/skia/include/config', | 828 '../third_party/skia/include/config', |
88 '../third_party/skia/include/core', | 829 '../third_party/skia/include/core', |
| 830 '../third_party/skia/src/core', |
| 831 '../third_party/skia/src/opts', |
| 832 ], |
| 833 'cflags!': [ |
| 834 '-fno-omit-frame-pointer', |
| 835 '-mfpu=vfp', # remove them all, just in case. |
| 836 '-mfpu=vfpv3', |
| 837 '-mfpu=vfpv3-d16', |
| 838 ], |
| 839 'cflags': [ |
| 840 '-mfpu=neon', |
| 841 '-fomit-frame-pointer', |
| 842 ], |
| 843 'ldflags': [ |
| 844 '-march=armv7-a', |
| 845 '-Wl,--fix-cortex-a8', |
89 ], | 846 ], |
90 'conditions': [ | 847 'conditions': [ |
91 [ 'os_posix == 1 and OS != "mac" and OS != "android" and \ | 848 ['arm_neon == 1', { |
92 target_arch != "arm" and target_arch != "mipsel"', { | 849 'defines': [ |
93 'cflags': [ | 850 '__ARM_HAVE_NEON', |
94 '-msse2', | 851 ], |
95 ], | 852 }], |
96 }], | 853 ['arm_neon_optional == 1', { |
97 [ 'target_arch != "arm" and target_arch != "mipsel"', { | 854 'defines': [ |
98 'sources': [ | 855 '__ARM_HAVE_OPTIONAL_NEON_SUPPORT', |
99 'ext/convolver_SSE2.cc', | 856 ], |
100 ], | 857 }], |
101 }], | 858 ['target_arch == "arm" and (arm_neon == 1 or arm_neon_optional == 1)', { |
102 [ 'target_arch == "mipsel"',{ | 859 'sources': [ |
103 'cflags': [ | 860 '../third_party/skia/src/opts/memset16_neon.S', |
104 '-fomit-frame-pointer', | 861 '../third_party/skia/src/opts/memset32_neon.S', |
105 ], | 862 '../third_party/skia/src/opts/SkBitmapProcState_arm_neon.cpp', |
106 'sources': [ | 863 '../third_party/skia/src/opts/SkBitmapProcState_matrixProcs_neon.cpp
', |
107 'ext/convolver_mips_dspr2.cc', | 864 '../third_party/skia/src/opts/SkBitmapProcState_matrix_clamp_neon.h'
, |
| 865 '../third_party/skia/src/opts/SkBitmapProcState_matrix_repeat_neon.h
', |
| 866 '../third_party/skia/src/opts/SkBlitRow_opts_arm_neon.cpp', |
108 ], | 867 ], |
109 }], | 868 }], |
110 ], | 869 ], |
111 }, | 870 }, |
112 { | 871 { |
113 'target_name': 'image_operations_bench', | 872 'target_name': 'image_operations_bench', |
114 'type': 'executable', | 873 'type': 'executable', |
115 'dependencies': [ | 874 'dependencies': [ |
116 '../base/base.gyp:base', | 875 '../base/base.gyp:base', |
117 'skia', | 876 'skia', |
118 ], | 877 ], |
119 'include_dirs': [ | 878 'include_dirs': [ |
120 '..', | 879 '..', |
121 ], | 880 ], |
122 'sources': [ | 881 'sources': [ |
123 'ext/image_operations_bench.cc', | 882 'ext/image_operations_bench.cc', |
124 ], | 883 ], |
125 }, | 884 }, |
126 ], | 885 ], |
| 886 'conditions': [ |
| 887 ['OS=="ios"', { |
| 888 'targets': [ |
| 889 # The main skia_opts target does not currently work on iOS because the |
| 890 # target architecture on iOS is determined at compile time rather than |
| 891 # gyp time (simulator builds are x86, device builds are arm). As a |
| 892 # temporary measure, this is a separate opts target for iOS-only, using |
| 893 # the _none.cpp files to avoid architecture-dependent implementations. |
| 894 { |
| 895 'target_name': 'skia_opts_ios', |
| 896 'type': 'static_library', |
| 897 'include_dirs': [ |
| 898 '..', |
| 899 'config', |
| 900 '../third_party/skia/include/config', |
| 901 '../third_party/skia/include/core', |
| 902 '../third_party/skia/include/effects', |
| 903 '../third_party/skia/include/images', |
| 904 '../third_party/skia/include/lazy', |
| 905 '../third_party/skia/include/pathops', |
| 906 '../third_party/skia/include/utils', |
| 907 '../third_party/skia/src/core', |
| 908 ], |
| 909 'sources': [ |
| 910 '../third_party/skia/src/opts/SkBitmapProcState_opts_none.cpp', |
| 911 '../third_party/skia/src/opts/SkBlitRow_opts_none.cpp', |
| 912 '../third_party/skia/src/opts/SkUtils_opts_none.cpp', |
| 913 ], |
| 914 }, |
| 915 ], |
| 916 }], |
| 917 ], |
127 } | 918 } |
OLD | NEW |