blob: 28f58ceb1d13aac4d675036e4f5c2fac96e8d1e6 [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"',
43 ],
[email protected]8e3f8c82013-08-21 15:09:5544
[email protected]9d6bc352013-07-23 13:00:1045 'default_font_cache_limit': '(20*1024*1024)',
46
47 'conditions': [
48 ['OS== "android"', {
49 # Android devices are typically more memory constrained, so
[email protected]8e3f8c82013-08-21 15:09:5550 # default to a smaller glyph cache (it may be overriden at runtime
51 # when the renderer starts up, depending on the actual device memory).
52 'default_font_cache_limit': '(1*1024*1024)',
[email protected]9d6bc352013-07-23 13:00:1053 'skia_export_defines': [
54 'SK_BUILD_FOR_ANDROID',
55 'USE_CHROMIUM_SKIA',
56 ],
57 }],
58 ],
59 },
60
61 'includes': [
62 '../third_party/skia/gyp/core.gypi',
63 '../third_party/skia/gyp/effects.gypi',
64 ],
65
66 'sources': [
67 # this should likely be moved into src/utils in skia
68 '../third_party/skia/src/core/SkFlate.cpp',
69 # We don't want to add this to Skia's core.gypi since it is
70 # Android only. Include it here and remove it for everyone
71 # but Android later.
72 '../third_party/skia/src/core/SkPaintOptionsAndroid.cpp',
73
74 '../third_party/skia/src/ports/SkImageDecoder_empty.cpp',
75 '../third_party/skia/src/images/SkScaledBitmapSampler.cpp',
76 '../third_party/skia/src/images/SkScaledBitmapSampler.h',
77
78 '../third_party/skia/src/opts/opts_check_SSE2.cpp',
79
80 '../third_party/skia/src/pdf/SkPDFCatalog.cpp',
81 '../third_party/skia/src/pdf/SkPDFCatalog.h',
82 '../third_party/skia/src/pdf/SkPDFDevice.cpp',
83 '../third_party/skia/src/pdf/SkPDFDocument.cpp',
84 '../third_party/skia/src/pdf/SkPDFFont.cpp',
85 '../third_party/skia/src/pdf/SkPDFFont.h',
86 '../third_party/skia/src/pdf/SkPDFFormXObject.cpp',
87 '../third_party/skia/src/pdf/SkPDFFormXObject.h',
88 '../third_party/skia/src/pdf/SkPDFGraphicState.cpp',
89 '../third_party/skia/src/pdf/SkPDFGraphicState.h',
90 '../third_party/skia/src/pdf/SkPDFImage.cpp',
91 '../third_party/skia/src/pdf/SkPDFImage.h',
92 '../third_party/skia/src/pdf/SkPDFImageStream.cpp',
93 '../third_party/skia/src/pdf/SkPDFImageStream.h',
94 '../third_party/skia/src/pdf/SkPDFPage.cpp',
95 '../third_party/skia/src/pdf/SkPDFPage.h',
[email protected]5d950902013-07-24 14:24:1596 '../third_party/skia/src/pdf/SkPDFResourceDict.cpp',
97 '../third_party/skia/src/pdf/SkPDFResourceDict.h',
[email protected]9d6bc352013-07-23 13:00:1098 '../third_party/skia/src/pdf/SkPDFShader.cpp',
99 '../third_party/skia/src/pdf/SkPDFShader.h',
100 '../third_party/skia/src/pdf/SkPDFStream.cpp',
101 '../third_party/skia/src/pdf/SkPDFStream.h',
102 '../third_party/skia/src/pdf/SkPDFTypes.cpp',
103 '../third_party/skia/src/pdf/SkPDFTypes.h',
104 '../third_party/skia/src/pdf/SkPDFUtils.cpp',
105 '../third_party/skia/src/pdf/SkPDFUtils.h',
106
107 '../third_party/skia/src/ports/SkPurgeableMemoryBlock_none.cpp',
108
109 '../third_party/skia/src/ports/SkFontConfigInterface_android.cpp',
110 '../third_party/skia/src/ports/SkFontConfigInterface_direct.cpp',
111
112 '../third_party/skia/src/fonts/SkFontMgr_fontconfig.cpp',
113 '../third_party/skia/src/ports/SkFontHost_fontconfig.cpp',
114
115 '../third_party/skia/src/ports/SkFontHost_FreeType.cpp',
116 '../third_party/skia/src/ports/SkFontHost_FreeType_common.cpp',
117 '../third_party/skia/src/ports/SkFontHost_FreeType_common.h',
118 '../third_party/skia/src/ports/SkFontConfigParser_android.cpp',
119 '../third_party/skia/src/ports/SkFontHost_mac.cpp',
120 '../third_party/skia/src/ports/SkFontHost_win.cpp',
121 '../third_party/skia/src/ports/SkGlobalInitialization_chromium.cpp',
122 '../third_party/skia/src/ports/SkOSFile_posix.cpp',
123 '../third_party/skia/src/ports/SkOSFile_stdio.cpp',
124 '../third_party/skia/src/ports/SkOSFile_win.cpp',
125 '../third_party/skia/src/ports/SkThread_pthread.cpp',
126 '../third_party/skia/src/ports/SkThread_win.cpp',
127 '../third_party/skia/src/ports/SkTime_Unix.cpp',
128 '../third_party/skia/src/ports/SkTLS_pthread.cpp',
129 '../third_party/skia/src/ports/SkTLS_win.cpp',
130
[email protected]596de2e2013-08-07 14:41:04131 '../third_party/skia/src/sfnt/SkOTTable_name.cpp',
132 '../third_party/skia/src/sfnt/SkOTTable_name.h',
[email protected]9d6bc352013-07-23 13:00:10133 '../third_party/skia/src/sfnt/SkOTUtils.cpp',
134 '../third_party/skia/src/sfnt/SkOTUtils.h',
135
136 '../third_party/skia/include/utils/mac/SkCGUtils.h',
137 '../third_party/skia/include/utils/SkDeferredCanvas.h',
138 '../third_party/skia/include/utils/SkMatrix44.h',
139 '../third_party/skia/src/utils/debugger/SkDebugCanvas.cpp',
140 '../third_party/skia/src/utils/debugger/SkDebugCanvas.h',
141 '../third_party/skia/src/utils/debugger/SkDrawCommand.cpp',
142 '../third_party/skia/src/utils/debugger/SkDrawCommand.h',
143 '../third_party/skia/src/utils/debugger/SkObjectParser.cpp',
144 '../third_party/skia/src/utils/debugger/SkObjectParser.h',
145 '../third_party/skia/src/utils/mac/SkCreateCGImageRef.cpp',
146 '../third_party/skia/src/utils/SkBase64.cpp',
147 '../third_party/skia/src/utils/SkBase64.h',
148 '../third_party/skia/src/utils/SkBitSet.cpp',
149 '../third_party/skia/src/utils/SkBitSet.h',
150 '../third_party/skia/src/utils/SkDeferredCanvas.cpp',
151 '../third_party/skia/src/utils/SkMatrix44.cpp',
152 '../third_party/skia/src/utils/SkNullCanvas.cpp',
153 '../third_party/skia/include/utils/SkNWayCanvas.h',
154 '../third_party/skia/src/utils/SkNWayCanvas.cpp',
155 '../third_party/skia/src/utils/SkPictureUtils.cpp',
[email protected]64975672013-07-30 18:47:13156 '../third_party/skia/src/utils/SkProxyCanvas.cpp',
[email protected]9d6bc352013-07-23 13:00:10157 '../third_party/skia/src/utils/SkRTConf.cpp',
158 '../third_party/skia/include/utils/SkRTConf.h',
159 '../third_party/skia/include/pdf/SkPDFDevice.h',
160 '../third_party/skia/include/pdf/SkPDFDocument.h',
161
162 '../third_party/skia/include/ports/SkTypeface_win.h',
163
164 '../third_party/skia/include/images/SkImageRef.h',
165 '../third_party/skia/include/images/SkImageRef_GlobalPool.h',
166 '../third_party/skia/include/images/SkMovie.h',
167 '../third_party/skia/include/images/SkPageFlipper.h',
168
169 '../third_party/skia/include/utils/SkNullCanvas.h',
170 '../third_party/skia/include/utils/SkPictureUtils.h',
[email protected]64975672013-07-30 18:47:13171 '../third_party/skia/include/utils/SkProxyCanvas.h',
[email protected]9d6bc352013-07-23 13:00:10172 ],
173 'include_dirs': [
174 '..',
175 'config',
176 '../third_party/skia/include/config',
177 '../third_party/skia/include/core',
178 '../third_party/skia/include/effects',
179 '../third_party/skia/include/images',
180 '../third_party/skia/include/lazy',
181 '../third_party/skia/include/pathops',
182 '../third_party/skia/include/pdf',
183 '../third_party/skia/include/pipe',
184 '../third_party/skia/include/ports',
185 '../third_party/skia/include/utils',
186 '../third_party/skia/src/core',
187 '../third_party/skia/src/image',
[email protected]2b889f882013-08-01 14:19:39188 '../third_party/skia/src/ports',
[email protected]9d6bc352013-07-23 13:00:10189 '../third_party/skia/src/sfnt',
190 '../third_party/skia/src/utils',
191 '../third_party/skia/src/lazy',
192 ],
193 'conditions': [
194 ['skia_support_gpu != 0', {
195 'includes': [
196 '../third_party/skia/gyp/gpu.gypi',
197 ],
198 'sources': [
199 '<@(skgpu_sources)',
200 ],
201 'include_dirs': [
202 '../third_party/skia/include/gpu',
[email protected]9d6bc352013-07-23 13:00:10203 '../third_party/skia/src/gpu',
204 ],
205 }],
206 ['skia_support_pdf == 0', {
207 'sources/': [
208 ['exclude', '../third_party/skia/src/pdf/']
209 ],
210 }],
211 ['skia_support_pdf == 1', {
212 'dependencies': [
213 '../third_party/sfntly/sfntly.gyp:sfntly',
214 ],
215 }],
216
217 #Settings for text blitting, chosen to approximate the system browser.
218 [ 'OS == "linux"', {
219 'defines': [
220 'SK_GAMMA_EXPONENT=1.2',
221 'SK_GAMMA_CONTRAST=0.2',
222 ],
223 }],
224 ['OS == "android"', {
225 'defines': [
226 'SK_GAMMA_APPLY_TO_A8',
227 'SK_GAMMA_EXPONENT=1.4',
228 'SK_GAMMA_CONTRAST=0.0',
229 ],
230 }],
231 ['OS == "win"', {
232 'defines': [
233 'SK_GAMMA_SRGB',
234 'SK_GAMMA_CONTRAST=0.5',
235 ],
236 }],
237 ['OS == "mac"', {
238 'defines': [
239 'SK_GAMMA_SRGB',
240 'SK_GAMMA_CONTRAST=0.0',
241 ],
242 }],
243
244 # For POSIX platforms, prefer the Mutex implementation provided by Skia
245 # since it does not generate static initializers.
246 [ 'OS == "android" or OS == "linux" or OS == "mac" or OS == "ios"', {
247 'defines+': [
248 'SK_USE_POSIX_THREADS',
249 ],
250 'direct_dependent_settings': {
251 'defines': [
252 'SK_USE_POSIX_THREADS',
253 ],
254 },
255 }],
256
257 [ 'OS != "android"', {
258 'sources!': [
259 '../third_party/skia/src/core/SkPaintOptionsAndroid.cpp',
260 ],
261 }],
262 [ 'OS != "ios"', {
263 'dependencies': [
[email protected]41eddab2013-08-08 13:23:30264 '../third_party/WebKit/public/blink_skia_config.gyp:blink_skia_config',
[email protected]9d6bc352013-07-23 13:00:10265 ],
[email protected]fe779d32013-08-08 17:22:34266 'export_dependent_settings': [
267 '../third_party/WebKit/public/blink_skia_config.gyp:blink_skia_config',
268 ],
[email protected]9d6bc352013-07-23 13:00:10269 }],
270 [ 'OS != "mac"', {
271 'sources/': [
272 ['exclude', '/mac/']
273 ],
274 }],
275 [ 'target_arch == "arm" and arm_version >= 7 and arm_neon == 1', {
276 'defines': [
277 '__ARM_HAVE_NEON',
278 ],
279 }],
280 [ 'target_arch == "arm" and arm_version >= 7 and arm_neon_optional == 1', {
281 'defines': [
282 '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
283 ],
284 }],
285 [ 'OS == "android" and target_arch == "arm"', {
286 'sources': [
287 '../third_party/skia/src/core/SkUtilsArm.cpp',
288 ],
289 'includes': [
290 '../build/android/cpufeatures.gypi',
291 ],
292 }],
293 [ 'target_arch == "arm" or target_arch == "mipsel"', {
294 'sources!': [
295 '../third_party/skia/src/opts/opts_check_SSE2.cpp'
296 ],
297 }],
298 [ 'use_glib == 1', {
299 'dependencies': [
300 '../build/linux/system.gyp:fontconfig',
301 '../build/linux/system.gyp:freetype2',
302 '../build/linux/system.gyp:pangocairo',
303 '../third_party/icu/icu.gyp:icuuc',
304 ],
305 'cflags': [
306 '-Wno-unused',
307 '-Wno-unused-function',
308 ],
309 }],
310 [ 'use_glib == 0', {
311 'sources!': [
312 '../third_party/skia/src/ports/SkFontConfigInterface_direct.cpp',
313 '../third_party/skia/src/fonts/SkFontMgr_fontconfig.cpp',
314 ],
315 }],
316 [ 'use_glib == 0 and OS != "android"', {
317 'sources!': [
318 '../third_party/skia/src/ports/SkFontHost_FreeType.cpp',
319 '../third_party/skia/src/ports/SkFontHost_FreeType_common.cpp',
320 '../third_party/skia/src/ports/SkFontHost_fontconfig.cpp',
321
322 ],
323 }],
324 [ 'OS == "android"', {
325 'dependencies': [
326 '../third_party/expat/expat.gyp:expat',
327 '../third_party/freetype/freetype.gyp:ft2',
328 ],
329 # This exports a hard dependency because it needs to run its
330 # symlink action in order to expose the skia header files.
331 'hard_dependency': 1,
332 'include_dirs': [
333 '../third_party/expat/files/lib',
334 ],
335 }],
336 [ 'OS == "ios"', {
337 'defines': [
338 'SK_BUILD_FOR_IOS',
339 'SK_USE_MAC_CORE_TEXT',
340 ],
341 'include_dirs': [
342 '../third_party/skia/include/utils/ios',
343 '../third_party/skia/include/utils/mac',
344 ],
345 'link_settings': {
346 'libraries': [
347 '$(SDKROOT)/System/Library/Frameworks/ImageIO.framework',
348 ],
349 },
350 'sources': [
351 # This file is used on both iOS and Mac, so it should be removed
352 # from the ios and mac conditions and moved into the main sources
353 # list.
354 '../third_party/skia/src/utils/mac/SkStream_mac.cpp',
355 ],
356 'sources/': [
357 ['exclude', 'opts_check_SSE2\\.cpp$'],
358 ],
[email protected]8e3f8c82013-08-21 15:09:55359
[email protected]9d6bc352013-07-23 13:00:10360 # The main skia_opts target does not currently work on iOS because the
361 # target architecture on iOS is determined at compile time rather than
362 # gyp time (simulator builds are x86, device builds are arm). As a
363 # temporary measure, this is a separate opts target for iOS-only, using
364 # the _none.cpp files to avoid architecture-dependent implementations.
365 'dependencies': [
366 'skia_library_opts.gyp:skia_opts_none',
367 ],
368 'dependencies!': [
369 'skia_library_opts.gyp:skia_opts',
370 ],
371 }],
372 [ 'OS == "mac"', {
373 'defines': [
374 'SK_BUILD_FOR_MAC',
375 'SK_USE_MAC_CORE_TEXT',
376 ],
377 'direct_dependent_settings': {
378 'include_dirs': [
379 '../third_party/skia/include/utils/mac',
380 ],
381 },
382 'include_dirs': [
383 '../third_party/skia/include/utils/mac',
384 ],
385 'link_settings': {
386 'libraries': [
387 '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
388 ],
389 },
390 'sources': [
391 '../third_party/skia/src/utils/mac/SkStream_mac.cpp',
392 ],
393 }],
394 [ 'OS == "win"', {
395 'sources!': [
396 '../third_party/skia/src/ports/SkOSFile_posix.cpp',
397 '../third_party/skia/src/ports/SkThread_pthread.cpp',
398 '../third_party/skia/src/ports/SkTime_Unix.cpp',
399 '../third_party/skia/src/ports/SkTLS_pthread.cpp',
400 ],
401 }],
402 # TODO(scottmg): http://crbug.com/177306
403 ['clang==1', {
404 'xcode_settings': {
405 'WARNING_CFLAGS!': [
406 # Don't warn about string->bool used in asserts.
407 '-Wstring-conversion',
408 ],
409 },
410 'cflags!': [
411 '-Wstring-conversion',
412 ],
413 }],
414 ],
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
430 # this flag can be removed entirely once this has baked for a while
431 'SK_ALLOW_OVER_32K_BITMAPS',
432
433 # skia uses static initializers to initialize the serialization logic
434 # of its "pictures" library. This is currently not used in chrome; if
435 # it ever gets used the processes that use it need to call
436 # SkGraphics::Init().
437 'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0',
438
439 # Disable this check because it is too strict for some Chromium-specific
440 # subclasses of SkPixelRef. See bug: crbug.com/171776.
441 'SK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK',
442
443 'IGNORE_ROT_AA_RECT_OPT',
444
[email protected]44fb9dc2013-07-29 21:51:13445 'SKIA_IGNORE_GPU_MIPMAPS',
446
447 'SK_GDI_ALWAYS_USE_TEXTMETRICS_FOR_FONT_METRICS',
448
[email protected]9d6bc352013-07-23 13:00:10449 'SK_DEFAULT_FONT_CACHE_LIMIT=<(default_font_cache_limit)',
450 ],
451
452 'direct_dependent_settings': {
453 'include_dirs': [
454 #temporary until we can hide SkFontHost
455 '../third_party/skia/src/core',
456
457 'config',
458 '../third_party/skia/include/config',
459 '../third_party/skia/include/core',
460 '../third_party/skia/include/effects',
461 '../third_party/skia/include/pdf',
462 '../third_party/skia/include/gpu',
[email protected]9d6bc352013-07-23 13:00:10463 '../third_party/skia/include/lazy',
464 '../third_party/skia/include/pathops',
465 '../third_party/skia/include/pipe',
466 '../third_party/skia/include/ports',
467 '../third_party/skia/include/utils',
468 ],
469 'defines': [
470 '<@(skia_export_defines)',
471 ],
472 },
473}