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