blob: b2fb0ab951bd0f022a4a444ceaac0c81c2020157 [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
6# This gypi file contains the Skia library.
7# In component mode (shared_lib) it is folded into a single shared library with
8# the Chrome-specific enhancements but in all other cases it is a separate lib.
9{
10 'dependencies': [
11 'skia_library_opts.gyp:skia_opts',
12 '../third_party/zlib/zlib.gyp:zlib',
13 ],
14
15 'variables': {
16 'variables': {
17 'conditions': [
18 ['OS== "ios"', {
19 'skia_support_gpu': 0,
20 }, {
21 'skia_support_gpu': 1,
22 }],
[email protected]b25f0032013-08-19 22:26:2523 ['OS=="ios" or enable_printing == 0', {
[email protected]9d6bc352013-07-23 13:00:1024 'skia_support_pdf': 0,
25 }, {
26 'skia_support_pdf': 1,
27 }],
28 ],
29 },
30 'skia_support_gpu': '<(skia_support_gpu)',
31 'skia_support_pdf': '<(skia_support_pdf)',
32
33 # These two set the paths so we can include skia/gyp/core.gypi
34 'skia_src_path': '../third_party/skia/src',
35 'skia_include_path': '../third_party/skia/include',
36
37 # This list will contain all defines that also need to be exported to
38 # dependent components.
39 'skia_export_defines': [
40 'SK_ENABLE_INST_COUNT=0',
41 'SK_SUPPORT_GPU=<(skia_support_gpu)',
42 'GR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"',
[email protected]77b94fa02013-09-23 11:58:5343 'SK_ENABLE_LEGACY_API_ALIASING=1',
[email protected]8d1e2c12013-11-04 12:26:2744 'SK_ATTR_DEPRECATED=SK_NOTHING_ARG1',
45 'SK_SUPPORT_LEGACY_COLORTYPE=1',
[email protected]49cabed2013-11-13 18:15:1846 'GR_GL_IGNORE_ES3_MSAA=0',
[email protected]9d6bc352013-07-23 13:00:1047 ],
[email protected]8e3f8c82013-08-21 15:09:5548
[email protected]04810d8b2013-10-25 11:04:1349 'default_font_cache_limit%': '(20*1024*1024)',
[email protected]9d6bc352013-07-23 13:00:1050
51 'conditions': [
52 ['OS== "android"', {
53 # Android devices are typically more memory constrained, so
[email protected]8e3f8c82013-08-21 15:09:5554 # default to a smaller glyph cache (it may be overriden at runtime
55 # when the renderer starts up, depending on the actual device memory).
56 'default_font_cache_limit': '(1*1024*1024)',
[email protected]9d6bc352013-07-23 13:00:1057 'skia_export_defines': [
58 'SK_BUILD_FOR_ANDROID',
[email protected]9d6bc352013-07-23 13:00:1059 ],
60 }],
61 ],
62 },
63
64 'includes': [
65 '../third_party/skia/gyp/core.gypi',
66 '../third_party/skia/gyp/effects.gypi',
[email protected]92096c052013-08-27 11:21:0867 '../third_party/skia/gyp/pdf.gypi',
[email protected]9d6bc352013-07-23 13:00:1068 ],
69
70 'sources': [
71 # this should likely be moved into src/utils in skia
72 '../third_party/skia/src/core/SkFlate.cpp',
[email protected]9d6bc352013-07-23 13:00:1073 '../third_party/skia/src/core/SkPaintOptionsAndroid.cpp',
74
75 '../third_party/skia/src/ports/SkImageDecoder_empty.cpp',
76 '../third_party/skia/src/images/SkScaledBitmapSampler.cpp',
77 '../third_party/skia/src/images/SkScaledBitmapSampler.h',
78
79 '../third_party/skia/src/opts/opts_check_SSE2.cpp',
80
[email protected]9d6bc352013-07-23 13:00:1081 '../third_party/skia/src/ports/SkPurgeableMemoryBlock_none.cpp',
82
83 '../third_party/skia/src/ports/SkFontConfigInterface_android.cpp',
84 '../third_party/skia/src/ports/SkFontConfigInterface_direct.cpp',
85
86 '../third_party/skia/src/fonts/SkFontMgr_fontconfig.cpp',
87 '../third_party/skia/src/ports/SkFontHost_fontconfig.cpp',
88
89 '../third_party/skia/src/ports/SkFontHost_FreeType.cpp',
90 '../third_party/skia/src/ports/SkFontHost_FreeType_common.cpp',
91 '../third_party/skia/src/ports/SkFontHost_FreeType_common.h',
92 '../third_party/skia/src/ports/SkFontConfigParser_android.cpp',
93 '../third_party/skia/src/ports/SkFontHost_mac.cpp',
94 '../third_party/skia/src/ports/SkFontHost_win.cpp',
[email protected]1d93409e2013-08-21 17:13:1995 '../third_party/skia/src/ports/SkFontHost_win_dw.cpp',
96 '../third_party/skia/src/ports/SkFontMgr_default_gdi.cpp',
[email protected]9d6bc352013-07-23 13:00:1097 '../third_party/skia/src/ports/SkGlobalInitialization_chromium.cpp',
98 '../third_party/skia/src/ports/SkOSFile_posix.cpp',
99 '../third_party/skia/src/ports/SkOSFile_stdio.cpp',
100 '../third_party/skia/src/ports/SkOSFile_win.cpp',
101 '../third_party/skia/src/ports/SkThread_pthread.cpp',
102 '../third_party/skia/src/ports/SkThread_win.cpp',
103 '../third_party/skia/src/ports/SkTime_Unix.cpp',
104 '../third_party/skia/src/ports/SkTLS_pthread.cpp',
105 '../third_party/skia/src/ports/SkTLS_win.cpp',
106
[email protected]596de2e2013-08-07 14:41:04107 '../third_party/skia/src/sfnt/SkOTTable_name.cpp',
108 '../third_party/skia/src/sfnt/SkOTTable_name.h',
[email protected]9d6bc352013-07-23 13:00:10109 '../third_party/skia/src/sfnt/SkOTUtils.cpp',
110 '../third_party/skia/src/sfnt/SkOTUtils.h',
111
112 '../third_party/skia/include/utils/mac/SkCGUtils.h',
113 '../third_party/skia/include/utils/SkDeferredCanvas.h',
114 '../third_party/skia/include/utils/SkMatrix44.h',
115 '../third_party/skia/src/utils/debugger/SkDebugCanvas.cpp',
116 '../third_party/skia/src/utils/debugger/SkDebugCanvas.h',
117 '../third_party/skia/src/utils/debugger/SkDrawCommand.cpp',
118 '../third_party/skia/src/utils/debugger/SkDrawCommand.h',
119 '../third_party/skia/src/utils/debugger/SkObjectParser.cpp',
120 '../third_party/skia/src/utils/debugger/SkObjectParser.h',
121 '../third_party/skia/src/utils/mac/SkCreateCGImageRef.cpp',
122 '../third_party/skia/src/utils/SkBase64.cpp',
123 '../third_party/skia/src/utils/SkBase64.h',
124 '../third_party/skia/src/utils/SkBitSet.cpp',
125 '../third_party/skia/src/utils/SkBitSet.h',
[email protected]996b11ad2013-09-06 06:01:28126 '../third_party/skia/src/utils/SkCanvasStack.cpp',
127 '../third_party/skia/src/utils/SkCanvasStateUtils.cpp',
[email protected]9d6bc352013-07-23 13:00:10128 '../third_party/skia/src/utils/SkDeferredCanvas.cpp',
129 '../third_party/skia/src/utils/SkMatrix44.cpp',
130 '../third_party/skia/src/utils/SkNullCanvas.cpp',
131 '../third_party/skia/include/utils/SkNWayCanvas.h',
132 '../third_party/skia/src/utils/SkNWayCanvas.cpp',
133 '../third_party/skia/src/utils/SkPictureUtils.cpp',
[email protected]64975672013-07-30 18:47:13134 '../third_party/skia/src/utils/SkProxyCanvas.cpp',
[email protected]9d6bc352013-07-23 13:00:10135 '../third_party/skia/src/utils/SkRTConf.cpp',
136 '../third_party/skia/include/utils/SkRTConf.h',
[email protected]1d93409e2013-08-21 17:13:19137 '../third_party/skia/src/utils/win/SkDWriteFontFileStream.cpp',
138 '../third_party/skia/src/utils/win/SkDWriteFontFileStream.h',
139 '../third_party/skia/src/utils/win/SkDWriteGeometrySink.cpp',
140 '../third_party/skia/src/utils/win/SkDWriteGeometrySink.h',
141 '../third_party/skia/src/utils/win/SkHRESULT.cpp',
[email protected]9d6bc352013-07-23 13:00:10142
143 '../third_party/skia/include/ports/SkTypeface_win.h',
144
145 '../third_party/skia/include/images/SkImageRef.h',
146 '../third_party/skia/include/images/SkImageRef_GlobalPool.h',
147 '../third_party/skia/include/images/SkMovie.h',
148 '../third_party/skia/include/images/SkPageFlipper.h',
149
150 '../third_party/skia/include/utils/SkNullCanvas.h',
151 '../third_party/skia/include/utils/SkPictureUtils.h',
[email protected]64975672013-07-30 18:47:13152 '../third_party/skia/include/utils/SkProxyCanvas.h',
[email protected]9d6bc352013-07-23 13:00:10153 ],
154 'include_dirs': [
[email protected]9d6bc352013-07-23 13:00:10155 '../third_party/skia/include/core',
156 '../third_party/skia/include/effects',
157 '../third_party/skia/include/images',
158 '../third_party/skia/include/lazy',
159 '../third_party/skia/include/pathops',
160 '../third_party/skia/include/pdf',
161 '../third_party/skia/include/pipe',
162 '../third_party/skia/include/ports',
163 '../third_party/skia/include/utils',
164 '../third_party/skia/src/core',
[email protected]36b39bb42013-10-18 13:40:22165 '../third_party/skia/src/opts',
[email protected]9d6bc352013-07-23 13:00:10166 '../third_party/skia/src/image',
[email protected]2b889f882013-08-01 14:19:39167 '../third_party/skia/src/ports',
[email protected]9d6bc352013-07-23 13:00:10168 '../third_party/skia/src/sfnt',
169 '../third_party/skia/src/utils',
170 '../third_party/skia/src/lazy',
171 ],
172 'conditions': [
173 ['skia_support_gpu != 0', {
174 'includes': [
175 '../third_party/skia/gyp/gpu.gypi',
176 ],
177 'sources': [
178 '<@(skgpu_sources)',
179 ],
180 'include_dirs': [
181 '../third_party/skia/include/gpu',
[email protected]9d6bc352013-07-23 13:00:10182 '../third_party/skia/src/gpu',
183 ],
184 }],
185 ['skia_support_pdf == 0', {
186 'sources/': [
187 ['exclude', '../third_party/skia/src/pdf/']
188 ],
189 }],
190 ['skia_support_pdf == 1', {
191 'dependencies': [
192 '../third_party/sfntly/sfntly.gyp:sfntly',
193 ],
194 }],
195
196 #Settings for text blitting, chosen to approximate the system browser.
197 [ 'OS == "linux"', {
198 'defines': [
199 'SK_GAMMA_EXPONENT=1.2',
200 'SK_GAMMA_CONTRAST=0.2',
201 ],
202 }],
203 ['OS == "android"', {
204 'defines': [
205 'SK_GAMMA_APPLY_TO_A8',
206 'SK_GAMMA_EXPONENT=1.4',
207 'SK_GAMMA_CONTRAST=0.0',
208 ],
209 }],
210 ['OS == "win"', {
211 'defines': [
212 'SK_GAMMA_SRGB',
213 'SK_GAMMA_CONTRAST=0.5',
214 ],
215 }],
216 ['OS == "mac"', {
217 'defines': [
218 'SK_GAMMA_SRGB',
219 'SK_GAMMA_CONTRAST=0.0',
220 ],
221 }],
222
223 # For POSIX platforms, prefer the Mutex implementation provided by Skia
224 # since it does not generate static initializers.
[email protected]e593f8b2013-10-21 20:47:39225 [ 'os_posix == 1', {
[email protected]9d6bc352013-07-23 13:00:10226 'defines+': [
227 'SK_USE_POSIX_THREADS',
228 ],
229 'direct_dependent_settings': {
230 'defines': [
231 'SK_USE_POSIX_THREADS',
232 ],
233 },
234 }],
235
[email protected]9d6bc352013-07-23 13:00:10236 [ 'OS != "ios"', {
237 'dependencies': [
[email protected]41eddab2013-08-08 13:23:30238 '../third_party/WebKit/public/blink_skia_config.gyp:blink_skia_config',
[email protected]9d6bc352013-07-23 13:00:10239 ],
[email protected]fe779d32013-08-08 17:22:34240 'export_dependent_settings': [
241 '../third_party/WebKit/public/blink_skia_config.gyp:blink_skia_config',
242 ],
[email protected]9d6bc352013-07-23 13:00:10243 }],
244 [ 'OS != "mac"', {
245 'sources/': [
246 ['exclude', '/mac/']
247 ],
248 }],
249 [ 'target_arch == "arm" and arm_version >= 7 and arm_neon == 1', {
250 'defines': [
251 '__ARM_HAVE_NEON',
252 ],
253 }],
254 [ 'target_arch == "arm" and arm_version >= 7 and arm_neon_optional == 1', {
255 'defines': [
256 '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
257 ],
258 }],
259 [ 'OS == "android" and target_arch == "arm"', {
260 'sources': [
261 '../third_party/skia/src/core/SkUtilsArm.cpp',
262 ],
263 'includes': [
264 '../build/android/cpufeatures.gypi',
265 ],
266 }],
267 [ 'target_arch == "arm" or target_arch == "mipsel"', {
268 'sources!': [
269 '../third_party/skia/src/opts/opts_check_SSE2.cpp'
270 ],
271 }],
[email protected]b098e1d82013-11-08 06:24:58272 [ 'desktop_linux == 1 or chromeos == 1', {
[email protected]9d6bc352013-07-23 13:00:10273 'dependencies': [
274 '../build/linux/system.gyp:fontconfig',
275 '../build/linux/system.gyp:freetype2',
[email protected]9d6bc352013-07-23 13:00:10276 '../third_party/icu/icu.gyp:icuuc',
277 ],
278 'cflags': [
279 '-Wno-unused',
280 '-Wno-unused-function',
281 ],
282 }],
[email protected]928362a2013-11-19 20:17:16283 [ 'use_cairo == 1', {
284 'dependencies': [
285 '../build/linux/system.gyp:pangocairo',
286 ],
287 }],
[email protected]b098e1d82013-11-08 06:24:58288 [ 'OS=="win" or OS=="mac" or OS=="ios" or OS=="android"', {
[email protected]9d6bc352013-07-23 13:00:10289 'sources!': [
290 '../third_party/skia/src/ports/SkFontConfigInterface_direct.cpp',
291 '../third_party/skia/src/fonts/SkFontMgr_fontconfig.cpp',
292 ],
293 }],
[email protected]b098e1d82013-11-08 06:24:58294 [ 'OS=="win" or OS=="mac" or OS=="ios"', {
[email protected]9d6bc352013-07-23 13:00:10295 'sources!': [
296 '../third_party/skia/src/ports/SkFontHost_FreeType.cpp',
297 '../third_party/skia/src/ports/SkFontHost_FreeType_common.cpp',
298 '../third_party/skia/src/ports/SkFontHost_fontconfig.cpp',
299
300 ],
301 }],
302 [ 'OS == "android"', {
303 'dependencies': [
304 '../third_party/expat/expat.gyp:expat',
305 '../third_party/freetype/freetype.gyp:ft2',
306 ],
307 # This exports a hard dependency because it needs to run its
308 # symlink action in order to expose the skia header files.
309 'hard_dependency': 1,
310 'include_dirs': [
311 '../third_party/expat/files/lib',
312 ],
313 }],
314 [ 'OS == "ios"', {
315 'defines': [
316 'SK_BUILD_FOR_IOS',
[email protected]9d6bc352013-07-23 13:00:10317 ],
318 'include_dirs': [
319 '../third_party/skia/include/utils/ios',
320 '../third_party/skia/include/utils/mac',
321 ],
322 'link_settings': {
323 'libraries': [
324 '$(SDKROOT)/System/Library/Frameworks/ImageIO.framework',
325 ],
326 },
327 'sources': [
328 # This file is used on both iOS and Mac, so it should be removed
329 # from the ios and mac conditions and moved into the main sources
330 # list.
331 '../third_party/skia/src/utils/mac/SkStream_mac.cpp',
332 ],
333 'sources/': [
334 ['exclude', 'opts_check_SSE2\\.cpp$'],
335 ],
[email protected]8e3f8c82013-08-21 15:09:55336
[email protected]9d6bc352013-07-23 13:00:10337 # The main skia_opts target does not currently work on iOS because the
338 # target architecture on iOS is determined at compile time rather than
339 # gyp time (simulator builds are x86, device builds are arm). As a
340 # temporary measure, this is a separate opts target for iOS-only, using
341 # the _none.cpp files to avoid architecture-dependent implementations.
342 'dependencies': [
343 'skia_library_opts.gyp:skia_opts_none',
344 ],
345 'dependencies!': [
346 'skia_library_opts.gyp:skia_opts',
347 ],
348 }],
349 [ 'OS == "mac"', {
350 'defines': [
351 'SK_BUILD_FOR_MAC',
[email protected]9d6bc352013-07-23 13:00:10352 ],
353 'direct_dependent_settings': {
354 'include_dirs': [
355 '../third_party/skia/include/utils/mac',
356 ],
357 },
358 'include_dirs': [
359 '../third_party/skia/include/utils/mac',
360 ],
361 'link_settings': {
362 'libraries': [
363 '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
364 ],
365 },
366 'sources': [
367 '../third_party/skia/src/utils/mac/SkStream_mac.cpp',
368 ],
369 }],
370 [ 'OS == "win"', {
371 'sources!': [
372 '../third_party/skia/src/ports/SkOSFile_posix.cpp',
373 '../third_party/skia/src/ports/SkThread_pthread.cpp',
374 '../third_party/skia/src/ports/SkTime_Unix.cpp',
375 '../third_party/skia/src/ports/SkTLS_pthread.cpp',
376 ],
[email protected]1d93409e2013-08-21 17:13:19377 'include_dirs': [
378 '../third_party/skia/include/utils/win',
379 '../third_party/skia/src/utils/win',
380 ],
[email protected]1d93409e2013-08-21 17:13:19381 },{ # not 'OS == "win"'
382 'sources!': [
383 '../third_party/skia/src/ports/SkFontHost_win_dw.cpp',
384 '../third_party/skia/src/ports/SkFontMgr_default_gdi.cpp',
385
386 '../third_party/skia/src/utils/win/SkDWriteFontFileStream.cpp',
387 '../third_party/skia/src/utils/win/SkDWriteFontFileStream.h',
388 '../third_party/skia/src/utils/win/SkDWriteGeometrySink.cpp',
389 '../third_party/skia/src/utils/win/SkDWriteGeometrySink.h',
390 '../third_party/skia/src/utils/win/SkHRESULT.cpp',
391 ],
[email protected]9d6bc352013-07-23 13:00:10392 }],
393 # TODO(scottmg): http://crbug.com/177306
394 ['clang==1', {
395 'xcode_settings': {
396 'WARNING_CFLAGS!': [
397 # Don't warn about string->bool used in asserts.
398 '-Wstring-conversion',
399 ],
400 },
401 'cflags!': [
402 '-Wstring-conversion',
403 ],
404 }],
[email protected]bf5c7262013-11-15 00:56:28405 # On windows, GDI handles are a scarse system-wide resource so we have to keep
406 # the glyph cache, which holds up to 4 GDI handles per entry, to a fairly small
407 # size.
408 # http://crbug.com/314387
409 [ 'OS == "win"', {
410 'defines': [
411 'SK_DEFAULT_FONT_CACHE_COUNT_LIMIT=256',
412 ],
413 }],
[email protected]9d6bc352013-07-23 13:00:10414 ],
415 'target_conditions': [
416 # Pull in specific Mac files for iOS (which have been filtered out
417 # by file name rules).
418 [ 'OS == "ios"', {
419 'sources/': [
420 ['include', 'SkFontHost_mac\\.cpp$',],
421 ['include', 'SkStream_mac\\.cpp$',],
422 ['include', 'SkCreateCGImageRef\\.cpp$',],
423 ],
424 }],
425 ],
426
427 'defines': [
428 '<@(skia_export_defines)',
429
[email protected]9d6bc352013-07-23 13:00:10430 # skia uses static initializers to initialize the serialization logic
431 # of its "pictures" library. This is currently not used in chrome; if
432 # it ever gets used the processes that use it need to call
433 # SkGraphics::Init().
434 'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0',
435
[email protected]c1bb2582013-11-02 02:03:39436 # Forcing the unoptimized path for the offset image filter in skia until
437 # all filters used in Blink support the optimized path properly
438 'SK_DISABLE_OFFSETIMAGEFILTER_OPTIMIZATION',
439
[email protected]9d6bc352013-07-23 13:00:10440 # Disable this check because it is too strict for some Chromium-specific
441 # subclasses of SkPixelRef. See bug: crbug.com/171776.
442 'SK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK',
443
444 'IGNORE_ROT_AA_RECT_OPT',
445
[email protected]5ae98e42013-11-13 01:01:18446 'SK_IGNORE_BLURRED_RRECT_OPT',
447
[email protected]36b39bb42013-10-18 13:40:22448 'SK_IGNORE_QUAD_RR_CORNERS_OPT',
449
[email protected]44fb9dc2013-07-29 21:51:13450 'SKIA_IGNORE_GPU_MIPMAPS',
451
[email protected]1d93409e2013-08-21 17:13:19452 # this flag forces Skia not to use typographic metrics with GDI.
[email protected]44fb9dc2013-07-29 21:51:13453 'SK_GDI_ALWAYS_USE_TEXTMETRICS_FOR_FONT_METRICS',
454
[email protected]9d6bc352013-07-23 13:00:10455 'SK_DEFAULT_FONT_CACHE_LIMIT=<(default_font_cache_limit)',
456 ],
457
458 'direct_dependent_settings': {
459 'include_dirs': [
460 #temporary until we can hide SkFontHost
461 '../third_party/skia/src/core',
462
[email protected]9d6bc352013-07-23 13:00:10463 '../third_party/skia/include/core',
464 '../third_party/skia/include/effects',
465 '../third_party/skia/include/pdf',
466 '../third_party/skia/include/gpu',
[email protected]9d6bc352013-07-23 13:00:10467 '../third_party/skia/include/lazy',
468 '../third_party/skia/include/pathops',
469 '../third_party/skia/include/pipe',
470 '../third_party/skia/include/ports',
471 '../third_party/skia/include/utils',
472 ],
473 'defines': [
474 '<@(skia_export_defines)',
475 ],
476 },
477}