2016-01-13 18:45:19 +00:00
|
|
|
################################################################################
|
|
|
|
# Skylark macros
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
is_bazel = not hasattr(native, "genmpm")
|
|
|
|
|
|
|
|
def portable_select(select_dict, bazel_condition, default_condition):
|
|
|
|
"""Replaces select() with a Bazel-friendly wrapper.
|
|
|
|
|
|
|
|
Args:
|
|
|
|
select_dict: Dictionary in the same format as select().
|
|
|
|
Returns:
|
|
|
|
If Blaze platform, returns select() using select_dict.
|
|
|
|
If Bazel platform, returns dependencies for condition
|
|
|
|
bazel_condition, or empty list if none specified.
|
|
|
|
"""
|
|
|
|
if is_bazel:
|
|
|
|
return select_dict.get(bazel_condition, select_dict[default_condition])
|
|
|
|
else:
|
|
|
|
return select(select_dict)
|
|
|
|
|
|
|
|
def skia_select(conditions, results):
|
|
|
|
"""Replaces select() for conditions [UNIX, ANDROID, IOS]
|
|
|
|
|
|
|
|
Args:
|
|
|
|
conditions: [CONDITION_UNIX, CONDITION_ANDROID, CONDITION_IOS]
|
|
|
|
results: [RESULT_UNIX, RESULT_ANDROID, RESULT_IOS]
|
|
|
|
Returns:
|
|
|
|
The result matching the platform condition.
|
|
|
|
"""
|
|
|
|
if len(conditions) != 3 or len(results) != 3:
|
|
|
|
fail("Must provide exactly 3 conditions and 3 results")
|
|
|
|
|
|
|
|
selector = {}
|
|
|
|
for i in range(3):
|
|
|
|
selector[conditions[i]] = results[i]
|
|
|
|
return portable_select(selector, conditions[2], conditions[0])
|
|
|
|
|
|
|
|
def skia_glob(srcs):
|
|
|
|
"""Replaces glob() with a version that accepts a struct.
|
|
|
|
|
|
|
|
Args:
|
|
|
|
srcs: struct(include=[], exclude=[])
|
|
|
|
Returns:
|
|
|
|
Equivalent of glob(srcs.include, exclude=srcs.exclude)
|
|
|
|
"""
|
|
|
|
if hasattr(srcs, 'include'):
|
|
|
|
if hasattr(srcs, 'exclude'):
|
|
|
|
return native.glob(srcs.include, exclude=srcs.exclude)
|
|
|
|
else:
|
|
|
|
return native.glob(srcs.include)
|
|
|
|
return []
|
|
|
|
|
2016-04-11 20:45:51 +00:00
|
|
|
################################################################################
|
|
|
|
## PRIVATE_HDRS
|
|
|
|
################################################################################
|
|
|
|
|
2016-07-28 22:12:21 +00:00
|
|
|
PRIVATE_HDRS_INCLUDE_LIST = [
|
|
|
|
"include/private/**/*.h",
|
|
|
|
"src/**/*.inc",
|
2016-04-11 20:45:51 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
PRIVATE_HDRS = struct(
|
2016-07-28 22:12:21 +00:00
|
|
|
include = PRIVATE_HDRS_INCLUDE_LIST,
|
|
|
|
)
|
|
|
|
|
|
|
|
ALL_HDRS = struct(
|
|
|
|
include = [
|
|
|
|
"src/**/*.h",
|
|
|
|
"include/**/*.h",
|
|
|
|
],
|
2016-04-11 20:45:51 +00:00
|
|
|
)
|
|
|
|
|
2016-01-13 18:45:19 +00:00
|
|
|
################################################################################
|
|
|
|
## BASE_SRCS
|
|
|
|
################################################################################
|
2015-08-17 19:58:10 +00:00
|
|
|
|
2015-11-18 21:26:10 +00:00
|
|
|
# All platform-independent SRCS.
|
2016-01-13 18:45:19 +00:00
|
|
|
BASE_SRCS_ALL = struct(
|
|
|
|
include = [
|
2015-10-15 15:09:44 +00:00
|
|
|
"src/**/*.h",
|
|
|
|
"src/**/*.cpp",
|
2015-08-17 19:58:10 +00:00
|
|
|
|
2015-08-18 15:51:49 +00:00
|
|
|
# Third Party
|
2015-08-17 19:58:10 +00:00
|
|
|
"third_party/etc1/*.cpp",
|
2015-10-15 15:09:44 +00:00
|
|
|
"third_party/etc1/*.h",
|
2015-08-17 19:58:10 +00:00
|
|
|
"third_party/ktx/*.cpp",
|
2015-10-15 15:09:44 +00:00
|
|
|
"third_party/ktx/*.h",
|
2015-08-17 19:58:10 +00:00
|
|
|
],
|
2016-07-28 22:12:21 +00:00
|
|
|
# Note: PRIVATE_HDRS_INCLUDE_LIST is excluded from BASE_SRCS_ALL here
|
|
|
|
# because they are required to appear in srcs for some rules but hdrs for
|
|
|
|
# other rules. See internal cl/119566959.
|
|
|
|
exclude = PRIVATE_HDRS_INCLUDE_LIST + [
|
2015-10-15 15:09:44 +00:00
|
|
|
# Exclude platform-dependent files.
|
2016-01-25 19:24:57 +00:00
|
|
|
"src/android/*",
|
2016-01-07 15:11:39 +00:00
|
|
|
"src/codec/*",
|
2015-10-15 15:09:44 +00:00
|
|
|
"src/device/xps/*", # Windows-only. Move to ports?
|
|
|
|
"src/doc/*_XPS.cpp", # Windows-only. Move to ports?
|
|
|
|
"src/gpu/gl/android/*",
|
2015-10-26 17:46:25 +00:00
|
|
|
"src/gpu/gl/egl/*",
|
2016-03-28 20:27:28 +00:00
|
|
|
"src/gpu/gl/glfw/*",
|
2015-10-26 17:46:25 +00:00
|
|
|
"src/gpu/gl/glx/*",
|
2015-10-15 15:09:44 +00:00
|
|
|
"src/gpu/gl/iOS/*",
|
|
|
|
"src/gpu/gl/mac/*",
|
|
|
|
"src/gpu/gl/win/*",
|
2016-01-07 15:11:39 +00:00
|
|
|
"src/images/*",
|
2015-10-15 15:09:44 +00:00
|
|
|
"src/opts/**/*",
|
|
|
|
"src/ports/**/*",
|
|
|
|
"src/utils/android/**/*",
|
|
|
|
"src/utils/mac/**/*",
|
|
|
|
"src/utils/SkThreadUtils_win.cpp", # Windows-only. Move to ports?
|
|
|
|
"src/utils/win/**/*",
|
|
|
|
"src/views/sdl/*",
|
|
|
|
"src/views/win/*",
|
|
|
|
"src/views/unix/*",
|
|
|
|
|
|
|
|
# Exclude multiple definitions.
|
|
|
|
# TODO(mtklein): Move to opts?
|
2016-03-14 22:21:12 +00:00
|
|
|
"src/pdf/SkDocument_PDF_None.cpp", # We use src/pdf/SkPDFDocument.cpp.
|
2015-10-26 17:46:25 +00:00
|
|
|
"src/gpu/gl/GrGLCreateNativeInterface_none.cpp",
|
|
|
|
"src/gpu/gl/GrGLDefaultInterface_native.cpp",
|
2016-02-17 20:47:27 +00:00
|
|
|
"src/gpu/gl/GrGLDefaultInterface_none.cpp",
|
2015-10-15 15:09:44 +00:00
|
|
|
|
|
|
|
# Exclude files that don't compile with the current DEFINES.
|
|
|
|
"src/gpu/gl/mesa/*", # Requires SK_MESA define.
|
2016-07-15 18:27:27 +00:00
|
|
|
"src/svg/**/*", # Depends on XML.
|
|
|
|
"src/xml/**/*",
|
2015-10-15 15:09:44 +00:00
|
|
|
|
2015-11-18 21:26:10 +00:00
|
|
|
# Conflicting dependencies among Lua versions. See cl/107087297.
|
|
|
|
"src/utils/SkLua*",
|
|
|
|
|
2015-10-15 15:09:44 +00:00
|
|
|
# Not used.
|
|
|
|
"src/views/**/*",
|
2016-02-22 18:07:54 +00:00
|
|
|
|
|
|
|
# Currently exclude all vulkan specific files
|
|
|
|
"src/gpu/vk/*",
|
2016-07-02 12:12:46 +00:00
|
|
|
"src/sksl/**/*",
|
2015-10-15 15:09:44 +00:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
# Platform-dependent SRCS for google3-default platform.
|
2016-01-13 18:45:19 +00:00
|
|
|
BASE_SRCS_UNIX = struct(
|
|
|
|
include = [
|
2016-01-25 19:24:57 +00:00
|
|
|
"src/android/*",
|
2016-01-07 15:11:39 +00:00
|
|
|
"src/codec/*",
|
2016-02-17 20:47:27 +00:00
|
|
|
"src/gpu/gl/GrGLDefaultInterface_none.cpp",
|
2016-01-07 15:11:39 +00:00
|
|
|
"src/images/*",
|
2015-10-15 15:09:44 +00:00
|
|
|
"src/opts/**/*.cpp",
|
|
|
|
"src/opts/**/*.h",
|
|
|
|
"src/ports/**/*.cpp",
|
|
|
|
"src/ports/**/*.h",
|
|
|
|
],
|
|
|
|
exclude = [
|
|
|
|
"src/opts/*arm*",
|
|
|
|
"src/opts/*mips*",
|
|
|
|
"src/opts/*NEON*",
|
|
|
|
"src/opts/*neon*",
|
2015-10-26 17:46:25 +00:00
|
|
|
# Included in :opts_ssse3 library.
|
2015-10-15 15:09:44 +00:00
|
|
|
"src/opts/*SSSE3*",
|
|
|
|
"src/opts/*ssse3*",
|
2015-10-26 17:46:25 +00:00
|
|
|
# Included in :opts_sse4 library.
|
2015-10-15 15:09:44 +00:00
|
|
|
"src/opts/*SSE4*",
|
|
|
|
"src/opts/*sse4*",
|
2015-12-17 18:18:04 +00:00
|
|
|
# Included in :opts_avx or :opts_avx2
|
|
|
|
"src/opts/*avx*",
|
2015-10-15 15:09:44 +00:00
|
|
|
"src/opts/SkBitmapProcState_opts_none.cpp",
|
2015-10-26 17:46:25 +00:00
|
|
|
"src/opts/SkBlitMask_opts_none.cpp",
|
2015-10-15 15:09:44 +00:00
|
|
|
"src/opts/SkBlitRow_opts_none.cpp",
|
2016-03-10 15:15:59 +00:00
|
|
|
"src/ports/*CG*",
|
2016-03-17 20:50:17 +00:00
|
|
|
"src/ports/*WIC*",
|
2016-03-10 16:52:05 +00:00
|
|
|
"src/ports/*android*",
|
2015-10-15 15:09:44 +00:00
|
|
|
"src/ports/*chromium*",
|
|
|
|
"src/ports/*mac*",
|
|
|
|
"src/ports/*mozalloc*",
|
|
|
|
"src/ports/*nacl*",
|
|
|
|
"src/ports/*win*",
|
2015-12-01 19:12:05 +00:00
|
|
|
"src/ports/SkFontConfigInterface_direct_factory.cpp",
|
|
|
|
"src/ports/SkFontMgr_custom_directory_factory.cpp",
|
2015-10-15 15:09:44 +00:00
|
|
|
"src/ports/SkFontMgr_custom_embedded_factory.cpp",
|
2016-03-21 17:45:01 +00:00
|
|
|
"src/ports/SkFontMgr_custom_empty_factory.cpp",
|
2015-10-15 15:09:44 +00:00
|
|
|
"src/ports/SkFontMgr_empty_factory.cpp",
|
2015-12-03 13:04:03 +00:00
|
|
|
"src/ports/SkFontMgr_fontconfig.cpp",
|
2015-12-01 19:12:05 +00:00
|
|
|
"src/ports/SkFontMgr_fontconfig_factory.cpp",
|
2016-03-25 15:58:55 +00:00
|
|
|
"src/ports/SkImageEncoder_none.cpp",
|
2015-10-15 15:09:44 +00:00
|
|
|
"src/ports/SkImageGenerator_none.cpp",
|
|
|
|
"src/ports/SkTLS_none.cpp",
|
2015-08-18 15:51:49 +00:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2015-10-26 17:46:25 +00:00
|
|
|
# Platform-dependent SRCS for google3-default Android.
|
2016-01-13 18:45:19 +00:00
|
|
|
BASE_SRCS_ANDROID = struct(
|
|
|
|
include = [
|
2016-01-25 19:24:57 +00:00
|
|
|
"src/android/*",
|
2016-01-07 15:11:39 +00:00
|
|
|
"src/codec/*",
|
2016-02-17 20:47:27 +00:00
|
|
|
"src/gpu/gl/GrGLDefaultInterface_none.cpp",
|
2016-01-07 15:11:39 +00:00
|
|
|
"src/images/*",
|
2015-10-26 17:46:25 +00:00
|
|
|
# TODO(benjaminwagner): Figure out how to compile with EGL.
|
|
|
|
"src/opts/**/*.cpp",
|
|
|
|
"src/opts/**/*.h",
|
|
|
|
"src/ports/**/*.cpp",
|
|
|
|
"src/ports/**/*.h",
|
|
|
|
],
|
|
|
|
exclude = [
|
|
|
|
"src/opts/*mips*",
|
|
|
|
"src/opts/*SSE2*",
|
|
|
|
"src/opts/*SSSE3*",
|
|
|
|
"src/opts/*ssse3*",
|
|
|
|
"src/opts/*SSE4*",
|
|
|
|
"src/opts/*sse4*",
|
2015-12-17 18:18:04 +00:00
|
|
|
"src/opts/*avx*",
|
2015-10-26 17:46:25 +00:00
|
|
|
"src/opts/*x86*",
|
|
|
|
"src/opts/SkBitmapProcState_opts_none.cpp",
|
|
|
|
"src/opts/SkBlitMask_opts_none.cpp",
|
|
|
|
"src/opts/SkBlitRow_opts_none.cpp",
|
2016-03-10 15:15:59 +00:00
|
|
|
"src/ports/*CG*",
|
2016-03-10 16:52:05 +00:00
|
|
|
"src/ports/*FontConfig*",
|
2016-03-17 20:50:17 +00:00
|
|
|
"src/ports/*WIC*",
|
2015-10-26 17:46:25 +00:00
|
|
|
"src/ports/*chromium*",
|
|
|
|
"src/ports/*fontconfig*",
|
|
|
|
"src/ports/*mac*",
|
|
|
|
"src/ports/*mozalloc*",
|
|
|
|
"src/ports/*nacl*",
|
|
|
|
"src/ports/*win*",
|
|
|
|
"src/ports/SkDebug_stdio.cpp",
|
|
|
|
"src/ports/SkFontMgr_custom_directory_factory.cpp",
|
|
|
|
"src/ports/SkFontMgr_custom_embedded_factory.cpp",
|
2016-03-21 17:45:01 +00:00
|
|
|
"src/ports/SkFontMgr_custom_empty_factory.cpp",
|
2015-10-26 17:46:25 +00:00
|
|
|
"src/ports/SkFontMgr_empty_factory.cpp",
|
2016-03-25 15:58:55 +00:00
|
|
|
"src/ports/SkImageEncoder_none.cpp",
|
2015-10-26 17:46:25 +00:00
|
|
|
"src/ports/SkImageGenerator_none.cpp",
|
|
|
|
"src/ports/SkTLS_none.cpp",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2015-11-02 19:11:21 +00:00
|
|
|
# Platform-dependent SRCS for google3-default iOS.
|
2016-01-13 18:45:19 +00:00
|
|
|
BASE_SRCS_IOS = struct(
|
|
|
|
include = [
|
2016-02-17 22:14:25 +00:00
|
|
|
"src/android/*",
|
|
|
|
"src/codec/*",
|
2016-02-17 20:47:27 +00:00
|
|
|
"src/gpu/gl/GrGLDefaultInterface_native.cpp",
|
|
|
|
"src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp",
|
2015-11-02 19:11:21 +00:00
|
|
|
"src/opts/**/*.cpp",
|
|
|
|
"src/opts/**/*.h",
|
|
|
|
"src/ports/**/*.cpp",
|
|
|
|
"src/ports/**/*.h",
|
2016-02-17 03:17:01 +00:00
|
|
|
"src/utils/mac/*.cpp",
|
2015-11-02 19:11:21 +00:00
|
|
|
],
|
|
|
|
exclude = [
|
2016-02-17 22:14:25 +00:00
|
|
|
"src/codec/*Gif*.cpp",
|
|
|
|
"src/codec/*Ico*.cpp",
|
|
|
|
"src/codec/*Jpeg*.cpp",
|
|
|
|
"src/codec/*Webp*.cpp",
|
|
|
|
"src/codec/*Png*",
|
|
|
|
"src/codec/*Raw*.cpp",
|
2015-11-02 19:11:21 +00:00
|
|
|
"src/opts/*mips*",
|
|
|
|
"src/opts/*NEON*",
|
|
|
|
"src/opts/*neon*",
|
|
|
|
"src/opts/*SSE2*",
|
|
|
|
"src/opts/*SSSE3*",
|
|
|
|
"src/opts/*ssse3*",
|
|
|
|
"src/opts/*SSE4*",
|
|
|
|
"src/opts/*sse4*",
|
2015-12-17 18:18:04 +00:00
|
|
|
"src/opts/*avx*",
|
2015-11-02 19:11:21 +00:00
|
|
|
"src/opts/*x86*",
|
|
|
|
"src/opts/SkBitmapProcState_opts_none.cpp",
|
2016-01-25 19:24:57 +00:00
|
|
|
"src/opts/SkBlitMask_opts_arm*.cpp",
|
|
|
|
"src/opts/SkBlitRow_opts_arm*.cpp",
|
2016-03-10 16:52:05 +00:00
|
|
|
"src/ports/*CG*",
|
|
|
|
"src/ports/*FontConfig*",
|
|
|
|
"src/ports/*FreeType*",
|
2016-03-17 20:50:17 +00:00
|
|
|
"src/ports/*WIC*",
|
2015-11-02 19:11:21 +00:00
|
|
|
"src/ports/*android*",
|
|
|
|
"src/ports/*chromium*",
|
|
|
|
"src/ports/*fontconfig*",
|
|
|
|
"src/ports/*mozalloc*",
|
|
|
|
"src/ports/*nacl*",
|
|
|
|
"src/ports/*win*",
|
|
|
|
"src/ports/SkFontMgr_custom.cpp",
|
|
|
|
"src/ports/SkFontMgr_custom_directory_factory.cpp",
|
|
|
|
"src/ports/SkFontMgr_custom_embedded_factory.cpp",
|
2016-03-21 17:45:01 +00:00
|
|
|
"src/ports/SkFontMgr_custom_empty_factory.cpp",
|
2015-11-02 19:11:21 +00:00
|
|
|
"src/ports/SkFontMgr_empty_factory.cpp",
|
|
|
|
"src/ports/SkImageGenerator_none.cpp",
|
|
|
|
"src/ports/SkTLS_none.cpp",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2016-01-13 18:45:19 +00:00
|
|
|
################################################################################
|
|
|
|
## SSSE3/SSE4/AVX/AVX2 SRCS
|
|
|
|
################################################################################
|
2015-10-26 17:46:25 +00:00
|
|
|
|
2016-01-13 18:45:19 +00:00
|
|
|
SSSE3_SRCS = struct(
|
|
|
|
include = [
|
2015-08-18 15:51:49 +00:00
|
|
|
"src/opts/*SSSE3*.cpp",
|
|
|
|
"src/opts/*ssse3*.cpp",
|
2016-01-25 17:29:08 +00:00
|
|
|
],
|
|
|
|
)
|
2015-08-18 15:51:49 +00:00
|
|
|
|
2016-01-13 18:45:19 +00:00
|
|
|
SSE4_SRCS = struct(
|
|
|
|
include = [
|
2015-08-18 15:51:49 +00:00
|
|
|
"src/opts/*SSE4*.cpp",
|
|
|
|
"src/opts/*sse4*.cpp",
|
2016-01-25 17:29:08 +00:00
|
|
|
],
|
|
|
|
)
|
2015-08-17 19:58:10 +00:00
|
|
|
|
2016-01-13 18:45:19 +00:00
|
|
|
AVX_SRCS = struct(
|
|
|
|
include = [
|
2015-12-17 18:18:04 +00:00
|
|
|
"src/opts/*_avx.cpp",
|
2016-01-25 17:29:08 +00:00
|
|
|
],
|
|
|
|
)
|
2015-12-17 18:18:04 +00:00
|
|
|
|
2016-01-13 18:45:19 +00:00
|
|
|
AVX2_SRCS = struct(
|
|
|
|
include = [
|
2015-12-17 18:18:04 +00:00
|
|
|
"src/opts/*_avx2.cpp",
|
2016-01-25 17:29:08 +00:00
|
|
|
],
|
|
|
|
)
|
2016-01-13 18:45:19 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
## BASE_HDRS
|
|
|
|
################################################################################
|
2015-12-17 18:18:04 +00:00
|
|
|
|
2016-01-13 18:45:19 +00:00
|
|
|
BASE_HDRS = struct(
|
|
|
|
include = [
|
2015-08-17 19:58:10 +00:00
|
|
|
"include/**/*.h",
|
|
|
|
],
|
2016-07-28 22:12:21 +00:00
|
|
|
exclude = PRIVATE_HDRS_INCLUDE_LIST + [
|
2015-10-15 15:09:44 +00:00
|
|
|
# Not used.
|
|
|
|
"include/animator/**/*",
|
|
|
|
"include/views/**/*",
|
2016-01-25 17:29:08 +00:00
|
|
|
],
|
|
|
|
)
|
2016-01-13 18:45:19 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
## BASE_DEPS
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
BASE_DEPS_ALL = []
|
2015-08-17 19:58:10 +00:00
|
|
|
|
2015-11-18 21:26:10 +00:00
|
|
|
BASE_DEPS_UNIX = [
|
2016-01-12 22:22:24 +00:00
|
|
|
":opts_ssse3",
|
2016-01-13 18:45:19 +00:00
|
|
|
":opts_sse4",
|
|
|
|
":opts_avx",
|
|
|
|
":opts_avx2",
|
2015-11-18 21:26:10 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
BASE_DEPS_ANDROID = []
|
|
|
|
|
|
|
|
BASE_DEPS_IOS = []
|
|
|
|
|
2016-01-13 18:45:19 +00:00
|
|
|
################################################################################
|
|
|
|
## INCLUDES
|
|
|
|
################################################################################
|
2015-11-18 21:26:10 +00:00
|
|
|
|
2015-08-17 19:58:10 +00:00
|
|
|
# Includes needed by Skia implementation. Not public includes.
|
|
|
|
INCLUDES = [
|
2015-11-13 20:27:08 +00:00
|
|
|
"include/android",
|
2015-08-17 19:58:10 +00:00
|
|
|
"include/c",
|
2016-02-01 12:54:14 +00:00
|
|
|
"include/client/android",
|
2015-08-17 19:58:10 +00:00
|
|
|
"include/codec",
|
|
|
|
"include/config",
|
|
|
|
"include/core",
|
|
|
|
"include/effects",
|
|
|
|
"include/gpu",
|
|
|
|
"include/images",
|
|
|
|
"include/pathops",
|
|
|
|
"include/pipe",
|
|
|
|
"include/ports",
|
|
|
|
"include/private",
|
|
|
|
"include/utils",
|
2015-11-02 19:11:21 +00:00
|
|
|
"include/utils/mac",
|
|
|
|
"include/utils/win",
|
2015-10-15 15:09:44 +00:00
|
|
|
"include/svg",
|
2015-08-17 19:58:10 +00:00
|
|
|
"include/xml",
|
2015-11-13 20:27:08 +00:00
|
|
|
"src/codec",
|
2015-08-17 19:58:10 +00:00
|
|
|
"src/core",
|
|
|
|
"src/gpu",
|
|
|
|
"src/image",
|
|
|
|
"src/lazy",
|
|
|
|
"src/opts",
|
2015-12-01 19:12:05 +00:00
|
|
|
"src/ports",
|
2015-08-17 19:58:10 +00:00
|
|
|
"src/pdf",
|
|
|
|
"src/sfnt",
|
|
|
|
"src/utils",
|
|
|
|
"third_party/etc1",
|
|
|
|
"third_party/ktx",
|
2016-01-13 18:45:19 +00:00
|
|
|
]
|
2015-08-17 19:58:10 +00:00
|
|
|
|
2016-01-13 18:45:19 +00:00
|
|
|
################################################################################
|
|
|
|
## DM_SRCS
|
|
|
|
################################################################################
|
2015-10-26 17:46:25 +00:00
|
|
|
|
2016-01-13 18:45:19 +00:00
|
|
|
DM_SRCS_ALL = struct(
|
|
|
|
include = [
|
2015-10-15 15:09:44 +00:00
|
|
|
"dm/*.cpp",
|
|
|
|
"dm/*.h",
|
|
|
|
"gm/*.c",
|
|
|
|
"gm/*.cpp",
|
|
|
|
"gm/*.h",
|
|
|
|
"tests/*.cpp",
|
|
|
|
"tests/*.h",
|
2016-07-28 22:12:21 +00:00
|
|
|
"tools/BigPathBench.inc",
|
2015-10-15 15:09:44 +00:00
|
|
|
"tools/CrashHandler.cpp",
|
|
|
|
"tools/CrashHandler.h",
|
|
|
|
"tools/ProcStats.cpp",
|
|
|
|
"tools/ProcStats.h",
|
|
|
|
"tools/Resources.cpp",
|
|
|
|
"tools/Resources.h",
|
2016-07-28 22:12:21 +00:00
|
|
|
"tools/SkJSONCPP.h",
|
|
|
|
"tools/UrlDataManager.cpp",
|
|
|
|
"tools/UrlDataManager.h",
|
|
|
|
"tools/debugger/*.cpp",
|
|
|
|
"tools/debugger/*.h",
|
2015-10-15 15:09:44 +00:00
|
|
|
"tools/flags/*.cpp",
|
|
|
|
"tools/flags/*.h",
|
2016-04-01 12:00:51 +00:00
|
|
|
"tools/gpu/**/*.cpp",
|
|
|
|
"tools/gpu/**/*.h",
|
2016-04-20 02:41:54 +00:00
|
|
|
"tools/picture_utils.cpp",
|
2016-07-28 22:12:21 +00:00
|
|
|
"tools/picture_utils.h",
|
2016-02-09 20:32:52 +00:00
|
|
|
"tools/random_parse_path.cpp",
|
|
|
|
"tools/random_parse_path.h",
|
2015-10-15 15:09:44 +00:00
|
|
|
"tools/sk_tool_utils.cpp",
|
|
|
|
"tools/sk_tool_utils.h",
|
2016-07-28 22:12:21 +00:00
|
|
|
"tools/sk_tool_utils_flags.h",
|
2015-10-24 14:55:31 +00:00
|
|
|
"tools/sk_tool_utils_font.cpp",
|
2016-07-28 22:12:21 +00:00
|
|
|
"tools/test_font_monospace.inc",
|
|
|
|
"tools/test_font_sans_serif.inc",
|
|
|
|
"tools/test_font_serif.inc",
|
|
|
|
"tools/test_font_index.inc",
|
2015-10-24 14:55:31 +00:00
|
|
|
"tools/timer/*.cpp",
|
|
|
|
"tools/timer/*.h",
|
2015-10-15 15:09:44 +00:00
|
|
|
],
|
|
|
|
exclude = [
|
2015-10-26 17:46:25 +00:00
|
|
|
"dm/DMSrcSinkAndroid.cpp", # Android-only.
|
|
|
|
"tests/FontMgrAndroidParserTest.cpp", # Android-only.
|
|
|
|
"tests/PathOpsSkpClipTest.cpp", # Alternate main.
|
2015-10-15 15:09:44 +00:00
|
|
|
"tests/skia_test.cpp", # Old main.
|
|
|
|
"tests/SkpSkGrTest.cpp", # Alternate main.
|
2016-08-03 19:43:36 +00:00
|
|
|
"tests/SkSL*.cpp", # Excluded along with Vulkan.
|
2016-07-15 18:27:27 +00:00
|
|
|
"tests/SVGDeviceTest.cpp",
|
2016-04-01 12:00:51 +00:00
|
|
|
"tools/gpu/gl/angle/*",
|
|
|
|
"tools/gpu/gl/command_buffer/*",
|
|
|
|
"tools/gpu/gl/egl/*",
|
|
|
|
"tools/gpu/gl/glx/*",
|
|
|
|
"tools/gpu/gl/iOS/*",
|
|
|
|
"tools/gpu/gl/mac/*",
|
|
|
|
"tools/gpu/gl/mesa/*",
|
|
|
|
"tools/gpu/gl/win/*",
|
2015-10-15 15:09:44 +00:00
|
|
|
"tools/timer/SysTimer_mach.cpp",
|
2015-10-26 17:46:25 +00:00
|
|
|
"tools/timer/SysTimer_windows.cpp",
|
2015-10-15 15:09:44 +00:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2016-04-01 12:00:51 +00:00
|
|
|
DM_SRCS_UNIX = struct(
|
|
|
|
include = [
|
|
|
|
"tools/gpu/gl/CreatePlatformGLContext_none.cpp",
|
|
|
|
],
|
|
|
|
)
|
2015-10-26 17:46:25 +00:00
|
|
|
|
2016-01-13 18:45:19 +00:00
|
|
|
DM_SRCS_ANDROID = struct(
|
|
|
|
include = [
|
2015-10-26 17:46:25 +00:00
|
|
|
# Depends on Android HWUI library that is not available in google3.
|
|
|
|
#"dm/DMSrcSinkAndroid.cpp",
|
|
|
|
"tests/FontMgrAndroidParserTest.cpp",
|
2016-04-01 12:00:51 +00:00
|
|
|
# TODO(benjaminwagner): Figure out how to compile with EGL.
|
|
|
|
"tools/gpu/gl/CreatePlatformGLContext_none.cpp",
|
2015-10-26 17:46:25 +00:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2016-04-01 12:00:51 +00:00
|
|
|
DM_SRCS_IOS = struct(
|
|
|
|
include = [
|
|
|
|
"tools/gpu/iOS/CreatePlatformGLContext_iOS.cpp",
|
|
|
|
],
|
|
|
|
)
|
2016-01-13 18:45:19 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
## DM_INCLUDES
|
|
|
|
################################################################################
|
2015-10-26 17:46:25 +00:00
|
|
|
|
2015-10-15 15:09:44 +00:00
|
|
|
DM_INCLUDES = [
|
2016-02-01 17:05:08 +00:00
|
|
|
"dm",
|
2015-10-15 15:09:44 +00:00
|
|
|
"gm",
|
|
|
|
"src/codec",
|
|
|
|
"src/effects",
|
2016-02-22 21:30:39 +00:00
|
|
|
"src/effects/gradients",
|
2015-10-15 15:09:44 +00:00
|
|
|
"src/fonts",
|
|
|
|
"src/pathops",
|
|
|
|
"src/pipe/utils",
|
2015-10-26 17:46:25 +00:00
|
|
|
"src/ports",
|
2015-10-15 15:09:44 +00:00
|
|
|
"tests",
|
|
|
|
"tools",
|
2016-07-28 22:12:21 +00:00
|
|
|
"tools/debugger",
|
2015-10-15 15:09:44 +00:00
|
|
|
"tools/flags",
|
2016-04-01 12:00:51 +00:00
|
|
|
"tools/gpu",
|
2015-10-15 15:09:44 +00:00
|
|
|
"tools/timer",
|
|
|
|
]
|
|
|
|
|
2016-01-13 18:45:19 +00:00
|
|
|
################################################################################
|
|
|
|
## DM_ARGS
|
|
|
|
################################################################################
|
2016-01-12 20:00:49 +00:00
|
|
|
|
2016-05-01 22:02:25 +00:00
|
|
|
def DM_ARGS(base_dir, asan):
|
|
|
|
source = ["tests", "gm", "image"]
|
|
|
|
# TODO(benjaminwagner): f16 and serialize-8888 fail.
|
|
|
|
config = ["565", "8888", "pdf", "srgb", "tiles_rt", "pic"]
|
|
|
|
# TODO(mtklein): maybe investigate why these fail?
|
|
|
|
match = [
|
|
|
|
"~Canvas",
|
|
|
|
"~Codec",
|
|
|
|
"~Codec_Dimensions",
|
|
|
|
"~Codec_stripes",
|
|
|
|
"~FontMgr",
|
|
|
|
"~PaintBreakText",
|
|
|
|
"~RecordDraw_TextBounds",
|
|
|
|
"~Scalar",
|
|
|
|
"~skps",
|
|
|
|
"~Stream",
|
|
|
|
]
|
|
|
|
if asan:
|
|
|
|
# Running all sources and configs under ASAN causes the test to exceed
|
|
|
|
# "large" size and time out.
|
|
|
|
source = ["tests", "gm"]
|
|
|
|
config = ["8888"]
|
|
|
|
match += [
|
|
|
|
"~clippedcubic2",
|
|
|
|
"~conicpaths",
|
|
|
|
"~gradients_2pt_conical",
|
|
|
|
"~Math",
|
|
|
|
"~Matrix",
|
|
|
|
"~PathOpsCubic",
|
2016-06-29 17:26:44 +00:00
|
|
|
"~PathOpsFailOp",
|
2016-07-19 19:27:32 +00:00
|
|
|
"~PathOpsOpCubicsThreaded",
|
2016-05-01 22:02:25 +00:00
|
|
|
"~PathOpsOpLoopsThreaded",
|
|
|
|
"~PathOpsSimplify",
|
|
|
|
"~PathOpsTightBoundsQuads",
|
|
|
|
"~Point",
|
2016-07-25 13:32:13 +00:00
|
|
|
"~sk_linear_to_srgb",
|
2016-01-13 18:45:19 +00:00
|
|
|
]
|
2016-05-01 22:02:25 +00:00
|
|
|
return [
|
|
|
|
"--src %s" % " ".join(source),
|
|
|
|
"--config %s" % " ".join(config),
|
|
|
|
"--verbose",
|
|
|
|
"--match %s" % " ".join(match),
|
|
|
|
"--resourcePath %s/resources" % base_dir,
|
|
|
|
"--images %s/resources" % base_dir,
|
|
|
|
]
|
2016-01-13 18:45:19 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
## COPTS
|
|
|
|
################################################################################
|
2015-11-02 19:11:21 +00:00
|
|
|
|
2015-10-26 17:46:25 +00:00
|
|
|
COPTS_UNIX = [
|
2015-08-17 19:58:10 +00:00
|
|
|
"-Wno-implicit-fallthrough", # Some intentional fallthrough.
|
2015-10-19 20:55:55 +00:00
|
|
|
"-Wno-deprecated-declarations", # Internal use of deprecated methods. :(
|
2015-08-17 19:58:10 +00:00
|
|
|
]
|
|
|
|
|
2016-01-13 18:45:19 +00:00
|
|
|
COPTS_ANDROID = ["-mfpu=neon"]
|
|
|
|
|
|
|
|
COPTS_IOS = []
|
|
|
|
|
|
|
|
COPTS_ALL = []
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
## DEFINES
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
DEFINES_UNIX = [
|
2016-06-22 14:25:16 +00:00
|
|
|
"PNG_SKIP_SETJMP_CHECK",
|
2016-01-13 18:45:19 +00:00
|
|
|
"SK_BUILD_FOR_UNIX",
|
|
|
|
"SK_SAMPLES_FOR_X",
|
|
|
|
"SK_SFNTLY_SUBSETTER",
|
2016-02-12 00:00:24 +00:00
|
|
|
"SK_CODEC_DECODES_RAW",
|
2016-05-06 14:21:26 +00:00
|
|
|
"SK_HAS_GIF_LIBRARY",
|
|
|
|
"SK_HAS_JPEG_LIBRARY",
|
2016-06-21 21:13:40 +00:00
|
|
|
"SK_HAS_PNG_LIBRARY",
|
2016-06-22 14:25:16 +00:00
|
|
|
"SK_HAS_WEBP_LIBRARY",
|
2016-07-19 17:48:58 +00:00
|
|
|
"TURBO_HAS_CROP",
|
|
|
|
"TURBO_HAS_SKIP",
|
|
|
|
"TURBO_HAS_565",
|
2016-01-13 18:45:19 +00:00
|
|
|
]
|
2015-10-26 17:46:25 +00:00
|
|
|
|
|
|
|
DEFINES_ANDROID = [
|
|
|
|
"SK_BUILD_FOR_ANDROID",
|
2016-02-12 00:00:24 +00:00
|
|
|
"SK_CODEC_DECODES_RAW",
|
2016-05-06 14:21:26 +00:00
|
|
|
"SK_HAS_GIF_LIBRARY",
|
|
|
|
"SK_HAS_JPEG_LIBRARY",
|
2016-06-21 21:13:40 +00:00
|
|
|
"SK_HAS_PNG_LIBRARY",
|
2016-06-22 14:25:16 +00:00
|
|
|
"SK_HAS_WEBP_LIBRARY",
|
2016-07-19 17:48:58 +00:00
|
|
|
"TURBO_HAS_CROP",
|
|
|
|
"TURBO_HAS_SKIP",
|
|
|
|
"TURBO_HAS_565",
|
2015-10-26 17:46:25 +00:00
|
|
|
]
|
|
|
|
|
2015-11-02 19:11:21 +00:00
|
|
|
DEFINES_IOS = [
|
|
|
|
"SK_BUILD_FOR_IOS",
|
2016-06-01 14:08:56 +00:00
|
|
|
"SK_BUILD_NO_OPTS",
|
2015-11-02 19:11:21 +00:00
|
|
|
"SK_IGNORE_ETC1_SUPPORT",
|
2016-01-25 19:24:57 +00:00
|
|
|
"SKNX_NO_SIMD",
|
2015-11-02 19:11:21 +00:00
|
|
|
]
|
|
|
|
|
2015-10-26 17:46:25 +00:00
|
|
|
DEFINES_ALL = [
|
2015-08-17 19:58:10 +00:00
|
|
|
# Chrome DEFINES.
|
|
|
|
"SK_USE_FLOATBITS",
|
|
|
|
"SK_USE_FREETYPE_EMBOLDEN",
|
|
|
|
# Turn on a few Google3-specific build fixes.
|
|
|
|
"GOOGLE3",
|
2016-03-22 17:17:23 +00:00
|
|
|
# Staging flags for API changes
|
2016-07-22 13:19:21 +00:00
|
|
|
"SK_SUPPORT_LEGACY_ACCESSBITMAP",
|
2016-07-25 16:41:58 +00:00
|
|
|
"SK_SUPPORT_LEGACY_BITMAP_GETTEXTURE",
|
2016-03-22 17:17:23 +00:00
|
|
|
"SK_SUPPORT_LEGACY_COLORFILTER_PTR",
|
|
|
|
"SK_SUPPORT_LEGACY_CREATESHADER_PTR",
|
2016-07-22 13:19:21 +00:00
|
|
|
"SK_SUPPORT_LEGACY_IMAGEFACTORY",
|
2016-04-01 13:54:34 +00:00
|
|
|
"SK_SUPPORT_LEGACY_IMAGEFILTER_PTR",
|
2016-07-22 13:19:21 +00:00
|
|
|
"SK_SUPPORT_LEGACY_MASKFILTER_PTR",
|
2016-04-01 13:54:34 +00:00
|
|
|
"SK_SUPPORT_LEGACY_MINOR_EFFECT_PTR",
|
2016-08-08 16:17:20 +00:00
|
|
|
"SK_SUPPORT_LEGACY_NEW_SURFACE_API",
|
2016-04-01 13:54:34 +00:00
|
|
|
"SK_SUPPORT_LEGACY_PATHEFFECT_PTR",
|
2016-03-24 18:05:28 +00:00
|
|
|
"SK_SUPPORT_LEGACY_PICTURE_PTR",
|
2016-05-12 17:09:30 +00:00
|
|
|
"SK_SUPPORT_LEGACY_TYPEFACE_PTR",
|
2016-07-22 13:19:21 +00:00
|
|
|
"SK_SUPPORT_LEGACY_XFERMODE_PTR",
|
2015-08-17 19:58:10 +00:00
|
|
|
]
|
|
|
|
|
2016-01-13 18:45:19 +00:00
|
|
|
################################################################################
|
|
|
|
## LINKOPTS
|
|
|
|
################################################################################
|
2015-10-26 17:46:25 +00:00
|
|
|
|
2016-01-13 18:45:19 +00:00
|
|
|
LINKOPTS_UNIX = []
|
2015-12-17 18:18:04 +00:00
|
|
|
|
2016-01-13 18:45:19 +00:00
|
|
|
LINKOPTS_ANDROID = [
|
|
|
|
"-lEGL",
|
|
|
|
]
|
2015-10-15 15:09:44 +00:00
|
|
|
|
2016-01-13 18:45:19 +00:00
|
|
|
LINKOPTS_IOS = []
|
2015-10-15 15:09:44 +00:00
|
|
|
|
2016-01-13 18:45:19 +00:00
|
|
|
LINKOPTS_ALL = [
|
|
|
|
"-ldl",
|
|
|
|
]
|