declare_args() {
skia_use_angle = false
+ skia_use_cpufeatures = is_android
skia_use_expat = true
skia_use_fontconfig = is_linux
skia_use_freetype = is_android || is_fuchsia || is_linux
"include/private",
"src/c",
"src/codec",
- "src/config",
"src/core",
"src/effects",
"src/effects/gradients",
}
if (is_android) {
- deps += [
- "//third_party/cpu-features",
- "//third_party/expat",
- ]
+ if (skia_use_cpufeatures) {
+ deps += [ "//third_party/cpu-features" ]
+ }
+ deps += [ "//third_party/expat" ]
sources += [ "src/ports/SkDebug_android.cpp" ]
libs += [
"EGL",
"libz",
],
static_libs: [
- "cpufeatures", // TODO: use this for CRC32 detection
+ //"cpufeatures", // TODO: use this for CRC32 detection
"libsfntly",
"libwebp-decode",
"libwebp-encode",
# We'll run GN to get the main source lists and include directories for Skia.
gn_args = {
'skia_enable_vulkan_debug_layers': 'false',
+ 'skia_use_cpufeatures': 'false',
+ 'skia_use_system_expat': 'true',
'skia_use_vulkan': 'true',
'target_cpu': '"none"',
'target_os': '"android"',
for dep in js['targets']['//:skia']['deps']:
if 'third_party' in dep:
continue # We've handled all third-party DEPS as static or shared_libs.
+ if 'none' in dep:
+ continue # We'll handle all cpu-specific sources manually later.
srcs.extend(strip_slashes(js['targets'][dep].get('sources', [])))
# No need to list headers.
# Start with the defines :skia uses, minus a couple. We'll add more in a bit.
defines = [str(d) for d in js['targets']['//:skia']['defines']]
defines.remove('SKIA_IMPLEMENTATION=1') # Only libskia should have this define.
-defines.remove('XML_STATIC') # On Android, libexpat is dynamically linked.
# For architecture specific files, it's easier to just read the same source
# that GN does (opts.gni) rather than re-run GN once for each architecture.
})
#... and all the #defines we want to put in SkUserConfig.h.
-with open('SkUserConfig.h', 'w') as f:
+with open('include/config/SkUserConfig.h', 'w') as f:
print >>f, '// This file is autogenerated by gn_to_bp.py.'
print >>f, '#ifndef SkUserConfig_DEFINED'
print >>f, '#define SkUserConfig_DEFINED'
for define in sorted(defines):
- print >>f, ' #define', define
+ print >>f, ' #define', define.replace('=', ' ')
print >>f, '#endif//SkUserConfig_DEFINED'