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):
|
2018-07-31 14:31:06 +00:00
|
|
|
"""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)
|
2016-01-13 18:45:19 +00:00
|
|
|
|
|
|
|
def skia_select(conditions, results):
|
2018-07-31 14:31:06 +00:00
|
|
|
"""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])
|
2016-01-13 18:45:19 +00:00
|
|
|
|
|
|
|
def skia_glob(srcs):
|
2018-07-31 14:31:06 +00:00
|
|
|
"""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-01-13 18:45:19 +00:00
|
|
|
|
2017-10-17 14:57:34 +00:00
|
|
|
################################################################################
|
|
|
|
## skia_{all,public}_hdrs()
|
|
|
|
################################################################################
|
|
|
|
def skia_all_hdrs():
|
2018-07-31 14:31:06 +00:00
|
|
|
return native.glob([
|
|
|
|
"src/**/*.h",
|
|
|
|
"include/**/*.h",
|
|
|
|
"third_party/**/*.h",
|
|
|
|
])
|
2017-10-17 14:57:34 +00:00
|
|
|
|
|
|
|
def skia_public_hdrs():
|
2018-07-31 14:31:06 +00:00
|
|
|
return native.glob(
|
|
|
|
["include/**/*.h"],
|
|
|
|
exclude = [
|
|
|
|
"include/private/**/*",
|
|
|
|
],
|
|
|
|
)
|
2017-10-17 14:57:34 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
## skia_opts_srcs()
|
|
|
|
################################################################################
|
|
|
|
# Intel
|
|
|
|
SKIA_OPTS_SSE2 = "SSE2"
|
|
|
|
|
|
|
|
SKIA_OPTS_SSSE3 = "SSSE3"
|
|
|
|
|
|
|
|
SKIA_OPTS_SSE41 = "SSE41"
|
|
|
|
|
|
|
|
SKIA_OPTS_SSE42 = "SSE42"
|
|
|
|
|
|
|
|
SKIA_OPTS_AVX = "AVX"
|
|
|
|
|
2018-02-27 18:43:53 +00:00
|
|
|
SKIA_OPTS_HSW = "HSW"
|
|
|
|
|
2017-10-17 14:57:34 +00:00
|
|
|
# Arm
|
|
|
|
SKIA_OPTS_NEON = "NEON"
|
|
|
|
|
|
|
|
SKIA_OPTS_CRC32 = "CRC32" # arm64
|
|
|
|
|
|
|
|
def opts_srcs(opts):
|
2018-07-31 14:31:06 +00:00
|
|
|
if opts == SKIA_OPTS_SSE2:
|
|
|
|
return native.glob([
|
|
|
|
"src/opts/*_SSE2.cpp",
|
|
|
|
"src/opts/*_sse2.cpp", # No matches currently.
|
|
|
|
])
|
|
|
|
elif opts == SKIA_OPTS_SSSE3:
|
|
|
|
return native.glob([
|
|
|
|
"src/opts/*_SSSE3.cpp",
|
|
|
|
"src/opts/*_ssse3.cpp",
|
|
|
|
])
|
|
|
|
elif opts == SKIA_OPTS_SSE41:
|
|
|
|
return native.glob([
|
|
|
|
"src/opts/*_sse41.cpp",
|
|
|
|
])
|
|
|
|
elif opts == SKIA_OPTS_SSE42:
|
|
|
|
return native.glob([
|
|
|
|
"src/opts/*_sse42.cpp",
|
|
|
|
])
|
|
|
|
elif opts == SKIA_OPTS_AVX:
|
|
|
|
return native.glob([
|
|
|
|
"src/opts/*_avx.cpp",
|
|
|
|
])
|
|
|
|
elif opts == SKIA_OPTS_HSW:
|
|
|
|
return native.glob([
|
|
|
|
"src/opts/*_hsw.cpp",
|
|
|
|
])
|
|
|
|
elif opts == SKIA_OPTS_NEON:
|
|
|
|
return native.glob([
|
|
|
|
"src/opts/*_neon.cpp",
|
|
|
|
])
|
|
|
|
elif opts == SKIA_OPTS_CRC32:
|
|
|
|
return native.glob([
|
|
|
|
"src/opts/*_crc32.cpp",
|
|
|
|
])
|
|
|
|
else:
|
|
|
|
fail("skia_opts_srcs parameter 'opts' must be one of SKIA_OPTS_*.")
|
2017-10-17 14:57:34 +00:00
|
|
|
|
|
|
|
def opts_cflags(opts):
|
2018-07-31 14:31:06 +00:00
|
|
|
if opts == SKIA_OPTS_SSE2:
|
|
|
|
return ["-msse2"]
|
|
|
|
elif opts == SKIA_OPTS_SSSE3:
|
|
|
|
return ["-mssse3"]
|
|
|
|
elif opts == SKIA_OPTS_SSE41:
|
|
|
|
return ["-msse4.1"]
|
|
|
|
elif opts == SKIA_OPTS_SSE42:
|
|
|
|
return ["-msse4.2"]
|
|
|
|
elif opts == SKIA_OPTS_AVX:
|
|
|
|
return ["-mavx"]
|
|
|
|
elif opts == SKIA_OPTS_HSW:
|
|
|
|
return ["-mavx2", "-mf16c", "-mfma"]
|
|
|
|
elif opts == SKIA_OPTS_NEON:
|
|
|
|
return ["-mfpu=neon"]
|
|
|
|
elif opts == SKIA_OPTS_CRC32:
|
|
|
|
# NDK r11's Clang (3.8) doesn't pass along this -march setting correctly to an external
|
|
|
|
# assembler, so we do it manually with -Wa. This is just a bug, fixed in later Clangs.
|
|
|
|
return ["-march=armv8-a+crc", "-Wa,-march=armv8-a+crc"]
|
|
|
|
else:
|
|
|
|
return []
|
2017-10-17 14:57:34 +00:00
|
|
|
|
|
|
|
SKIA_CPU_ARM = "ARM"
|
|
|
|
|
|
|
|
SKIA_CPU_ARM64 = "ARM64"
|
|
|
|
|
|
|
|
SKIA_CPU_X86 = "X86"
|
|
|
|
|
|
|
|
SKIA_CPU_OTHER = "OTHER"
|
|
|
|
|
|
|
|
def opts_rest_srcs(cpu):
|
2018-07-31 14:31:06 +00:00
|
|
|
srcs = []
|
|
|
|
if cpu == SKIA_CPU_ARM or cpu == SKIA_CPU_ARM64:
|
|
|
|
srcs += native.glob([
|
|
|
|
"src/opts/*_arm.cpp",
|
|
|
|
"src/opts/SkBitmapProcState_opts_none.cpp",
|
|
|
|
])
|
|
|
|
if cpu == SKIA_CPU_ARM64:
|
|
|
|
# NEON doesn't need special flags to compile on ARM64.
|
|
|
|
srcs += native.glob([
|
|
|
|
"src/opts/*_neon.cpp",
|
|
|
|
])
|
|
|
|
elif cpu == SKIA_CPU_X86:
|
|
|
|
srcs += native.glob([
|
|
|
|
"src/opts/*_x86.cpp",
|
|
|
|
])
|
|
|
|
elif cpu == SKIA_CPU_OTHER:
|
|
|
|
srcs += native.glob([
|
|
|
|
"src/opts/*_none.cpp",
|
|
|
|
])
|
|
|
|
else:
|
|
|
|
fail("opts_rest_srcs parameter 'cpu' must be one of " +
|
|
|
|
"SKIA_CPU_{ARM,ARM64,X86,OTHER}.")
|
|
|
|
return srcs
|
2017-10-17 14:57:34 +00:00
|
|
|
|
|
|
|
def skia_opts_deps(cpu):
|
2018-07-31 14:31:06 +00:00
|
|
|
res = [":opts_rest"]
|
2017-10-17 14:57:34 +00:00
|
|
|
|
2018-07-31 14:31:06 +00:00
|
|
|
if cpu == SKIA_CPU_ARM:
|
|
|
|
res += [":opts_neon"]
|
2017-10-17 14:57:34 +00:00
|
|
|
|
2018-07-31 14:31:06 +00:00
|
|
|
if cpu == SKIA_CPU_ARM64:
|
|
|
|
res += [":opts_crc32"]
|
2017-10-24 15:40:41 +00:00
|
|
|
|
2018-07-31 14:31:06 +00:00
|
|
|
if cpu == SKIA_CPU_X86:
|
|
|
|
res += [
|
|
|
|
":opts_sse2",
|
|
|
|
":opts_ssse3",
|
|
|
|
":opts_sse41",
|
|
|
|
":opts_sse42",
|
|
|
|
":opts_avx",
|
|
|
|
":opts_hsw",
|
|
|
|
]
|
2017-10-17 14:57:34 +00:00
|
|
|
|
2018-07-31 14:31:06 +00:00
|
|
|
return res
|
2017-10-17 14:57:34 +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 = [
|
2017-03-16 23:15:09 +00:00
|
|
|
"include/private/**/*.h",
|
2015-10-15 15:09:44 +00:00
|
|
|
"src/**/*.h",
|
|
|
|
"src/**/*.cpp",
|
2017-03-16 23:15:09 +00:00
|
|
|
"src/**/*.inc",
|
2015-08-17 19:58:10 +00:00
|
|
|
],
|
2017-03-16 23:15:09 +00:00
|
|
|
exclude = [
|
2015-10-15 15:09:44 +00:00
|
|
|
# Exclude platform-dependent files.
|
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/*",
|
|
|
|
"src/opts/**/*",
|
|
|
|
"src/ports/**/*",
|
|
|
|
"src/utils/android/**/*",
|
|
|
|
"src/utils/mac/**/*",
|
|
|
|
"src/utils/win/**/*",
|
|
|
|
|
|
|
|
# Exclude multiple definitions.
|
2018-10-18 15:05:21 +00:00
|
|
|
"src/core/SkPicture_none.cpp",
|
2018-10-15 15:36:55 +00:00
|
|
|
"src/gpu/GrPathRendering_none.cpp",
|
2018-10-10 19:54:53 +00:00
|
|
|
"src/gpu/ccpr/GrCoverageCountingPathRenderer_none.cpp",
|
2018-10-15 15:36:55 +00:00
|
|
|
"src/gpu/gl/GrGLMakeNativeInterface_none.cpp",
|
|
|
|
"src/pdf/SkDocument_PDF_None.cpp", # We use src/pdf/SkPDFDocument.cpp.
|
2015-10-15 15:09:44 +00:00
|
|
|
|
2018-03-26 19:46:40 +00:00
|
|
|
# Exclude files that don't compile everywhere.
|
|
|
|
"src/svg/**/*", # Depends on xml, SkJpegCodec, and SkPngCodec.
|
|
|
|
"src/xml/**/*", # Avoid dragging in expat when not needed.
|
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*",
|
|
|
|
|
2016-02-22 18:07:54 +00:00
|
|
|
# Currently exclude all vulkan specific files
|
|
|
|
"src/gpu/vk/*",
|
2016-09-30 19:06:27 +00:00
|
|
|
|
|
|
|
# Defines main.
|
|
|
|
"src/sksl/SkSLMain.cpp",
|
2017-09-07 15:07:42 +00:00
|
|
|
|
|
|
|
# Only used to regenerate the lexer
|
|
|
|
"src/sksl/lex/*",
|
2017-11-19 18:20:13 +00:00
|
|
|
|
|
|
|
# Atlas text
|
|
|
|
"src/atlastext/*",
|
2018-03-27 17:22:50 +00:00
|
|
|
|
2018-06-20 13:44:59 +00:00
|
|
|
# Compute backend not yet even hooked into Skia.
|
2018-07-31 14:31:06 +00:00
|
|
|
"src/compute/**/*",
|
2015-10-15 15:09:44 +00:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2017-10-17 14:57:34 +00:00
|
|
|
def codec_srcs(limited):
|
2018-11-08 14:11:43 +00:00
|
|
|
"""Sources for the codecs. Excludes Raw, and Ico, Webp, and Png if limited."""
|
2018-10-26 16:31:36 +00:00
|
|
|
|
2018-10-26 13:25:51 +00:00
|
|
|
# TODO: Enable wuffs in Google3
|
2018-11-08 14:11:43 +00:00
|
|
|
exclude = ["src/codec/SkWuffsCodec.cpp", "src/codec/*Raw*.cpp"]
|
2018-07-31 14:31:06 +00:00
|
|
|
if limited:
|
|
|
|
exclude += [
|
|
|
|
"src/codec/*Ico*.cpp",
|
|
|
|
"src/codec/*Webp*.cpp",
|
|
|
|
"src/codec/*Png*",
|
|
|
|
]
|
2019-01-15 18:24:45 +00:00
|
|
|
return native.glob(["src/codec/*.cpp", "third_party/etc1/*.cpp", "third_party/gif/*.cpp"], exclude = exclude)
|
2017-10-17 14:57:34 +00:00
|
|
|
|
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 = [
|
2017-12-11 20:21:39 +00:00
|
|
|
"src/gpu/gl/GrGLMakeNativeInterface_none.cpp",
|
2015-10-15 15:09:44 +00:00
|
|
|
"src/ports/**/*.cpp",
|
|
|
|
"src/ports/**/*.h",
|
|
|
|
],
|
|
|
|
exclude = [
|
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/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",
|
2018-12-01 01:42:00 +00:00
|
|
|
"src/ports/SkFontMgr_fuchsia.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 = [
|
2018-08-17 13:28:53 +00:00
|
|
|
"src/gpu/gl/android/*.cpp",
|
2015-10-26 17:46:25 +00:00
|
|
|
"src/ports/**/*.cpp",
|
|
|
|
"src/ports/**/*.h",
|
|
|
|
],
|
|
|
|
exclude = [
|
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",
|
2018-12-01 01:42:00 +00:00
|
|
|
"src/ports/SkFontMgr_fuchsia.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 = [
|
2017-12-11 15:06:31 +00:00
|
|
|
"src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp",
|
2015-11-02 19:11:21 +00:00
|
|
|
"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-03-10 16:52:05 +00:00
|
|
|
"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",
|
2017-02-08 22:29:33 +00:00
|
|
|
"src/ports/SkFontMgr_custom_directory.cpp",
|
|
|
|
"src/ports/SkFontMgr_custom_embedded.cpp",
|
|
|
|
"src/ports/SkFontMgr_custom_empty.cpp",
|
2015-11-02 19:11:21 +00:00
|
|
|
"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",
|
2018-12-01 01:42:00 +00:00
|
|
|
"src/ports/SkFontMgr_fuchsia.cpp",
|
2015-11-02 19:11:21 +00:00
|
|
|
"src/ports/SkImageGenerator_none.cpp",
|
|
|
|
"src/ports/SkTLS_none.cpp",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2017-03-16 23:15:09 +00:00
|
|
|
################################################################################
|
|
|
|
## skia_srcs()
|
|
|
|
################################################################################
|
2017-10-17 14:57:34 +00:00
|
|
|
def skia_srcs(os_conditions):
|
2018-07-31 14:31:06 +00:00
|
|
|
"""Sources to be compiled into the skia library."""
|
|
|
|
return skia_glob(BASE_SRCS_ALL) + skia_select(
|
|
|
|
os_conditions,
|
|
|
|
[
|
|
|
|
skia_glob(BASE_SRCS_UNIX),
|
|
|
|
skia_glob(BASE_SRCS_ANDROID),
|
|
|
|
skia_glob(BASE_SRCS_IOS),
|
|
|
|
],
|
|
|
|
)
|
2015-11-18 21:26:10 +00:00
|
|
|
|
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",
|
|
|
|
"include/codec",
|
|
|
|
"include/config",
|
|
|
|
"include/core",
|
2018-09-20 20:26:31 +00:00
|
|
|
"include/docs",
|
2015-08-17 19:58:10 +00:00
|
|
|
"include/effects",
|
2017-05-09 19:28:32 +00:00
|
|
|
"include/encode",
|
2015-08-17 19:58:10 +00:00
|
|
|
"include/gpu",
|
|
|
|
"include/pathops",
|
|
|
|
"include/ports",
|
|
|
|
"include/private",
|
|
|
|
"include/utils",
|
2015-11-02 19:11:21 +00:00
|
|
|
"include/utils/mac",
|
2015-11-13 20:27:08 +00:00
|
|
|
"src/codec",
|
2015-08-17 19:58:10 +00:00
|
|
|
"src/core",
|
|
|
|
"src/gpu",
|
|
|
|
"src/image",
|
2017-08-15 17:13:59 +00:00
|
|
|
"src/images",
|
2015-08-17 19:58:10 +00:00
|
|
|
"src/lazy",
|
|
|
|
"src/opts",
|
|
|
|
"src/pdf",
|
2018-03-26 19:46:40 +00:00
|
|
|
"src/ports",
|
2015-08-17 19:58:10 +00:00
|
|
|
"src/sfnt",
|
2017-05-30 20:39:47 +00:00
|
|
|
"src/shaders",
|
Reland "Base Gradient FP Refactor"
This reverts commit 1ea5656a285bcfef445d6f69eaab477e68595b54.
Reason for revert: Fixed google3 build failure
Original change's description:
> Revert "Base Gradient FP Refactor"
>
> This reverts commit 10f7a1e07554a362aef979d32ba288a009bdff90.
>
> Reason for revert: broke google3 roll
> Original change's description:
> > Base Gradient FP Refactor
> >
> > --
> >
> > Redefines how gradients will be written in the GPU back-end:
> >
> > They are split into three fragment processor components: master, layout, and colorizer.
> > The layout FP is responsible for converting the fragment position into an interpolant value, t.
> > Each high-level gradient--such as linear, radial, etc.--are implemented solely in a layout FP.
> > The colorizer FP is responsible for converting t into a color.
> > The master FP invokes the layout, clamps t into the proper domain, and then invokes the colorizer.
> > GrGradientShader provides factory functions to create FP graphs from SkGradientShader instances.
> > This pattern is documented in gpu/gradients/README.md.
> >
> > Goals for current CL
> > ====================
> >
> > Outline the FP components by providing .fp implementations for the simplest gradients.
> > Defines a two-color single interval colorizer and a linear gradient layout, and the master effect.
> > A MakeLinear() factory function is provided that can convert SkGradientShaders that fit these constraints.
> > SkLinearGradient first attempts to use the new system, falling back to the original GrGradientEffect.
> >
> > Future CLs
> > ==========
> >
> > To keep the CL reviews manageable, additional dependent CLs will be added that gradually replace past functionality.
> > A CL for each layout will be defined.
> > CLs for the different analytic colorizer cases and the textured gradient case will be defined.
> > Once the new system supports all current layouts and colorizer capabilities, all old GPU gradient code will be removed.
> > After this clean-up, analytic colorization can hopefully be expanded to reduce the usage of textured gradients.
> >
> > Bug: skia:
> > Change-Id: Iafe7b8b4071491a71c473babcd7bedda659150c1
> > Reviewed-on: https://skia-review.googlesource.com/148120
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=bsalomon@google.com,michaelludwig@google.com
>
> Change-Id: Ib735e323795ac8874cb00b007a915786b50517a6
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/153600
> Reviewed-by: Cary Clark <caryclark@google.com>
> Commit-Queue: Cary Clark <caryclark@google.com>
TBR=bsalomon@google.com,caryclark@google.com,michaelludwig@google.com
Change-Id: Ibf6ffbcb1af0dfbdac7317151aeb08f18f84c7fd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/153887
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2018-09-12 19:22:16 +00:00
|
|
|
"src/shaders/gradients",
|
2016-09-30 19:06:27 +00:00
|
|
|
"src/sksl",
|
2015-08-17 19:58:10 +00:00
|
|
|
"src/utils",
|
2019-01-15 18:24:45 +00:00
|
|
|
"third_party/etc1",
|
2016-10-24 18:11:12 +00:00
|
|
|
"third_party/gif",
|
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",
|
2018-09-21 15:19:45 +00:00
|
|
|
"experimental/pipe/*.cpp",
|
|
|
|
"experimental/pipe/*.h",
|
2018-03-26 19:46:40 +00:00
|
|
|
"experimental/svg/model/*.cpp",
|
|
|
|
"experimental/svg/model/*.h",
|
2015-10-15 15:09:44 +00:00
|
|
|
"gm/*.cpp",
|
|
|
|
"gm/*.h",
|
2018-03-26 19:46:40 +00:00
|
|
|
"src/xml/*.cpp",
|
2015-10-15 15:09:44 +00:00
|
|
|
"tests/*.cpp",
|
|
|
|
"tests/*.h",
|
2018-03-26 21:48:09 +00:00
|
|
|
"tools/ios_utils.h",
|
|
|
|
"tools/BinaryAsset.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",
|
2018-05-30 12:27:26 +00:00
|
|
|
"tools/DDLPromiseImageHelper.cpp",
|
|
|
|
"tools/DDLPromiseImageHelper.h",
|
|
|
|
"tools/DDLTileHelper.cpp",
|
|
|
|
"tools/DDLTileHelper.h",
|
2015-10-15 15:09:44 +00:00
|
|
|
"tools/ProcStats.cpp",
|
|
|
|
"tools/ProcStats.h",
|
2018-03-26 21:48:09 +00:00
|
|
|
"tools/Registry.h",
|
|
|
|
"tools/ResourceFactory.h",
|
2015-10-15 15:09:44 +00:00
|
|
|
"tools/Resources.cpp",
|
|
|
|
"tools/Resources.h",
|
2016-07-28 22:12:21 +00:00
|
|
|
"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",
|
2018-02-20 22:06:07 +00:00
|
|
|
"tools/fonts/SkRandomScalerContext.cpp",
|
|
|
|
"tools/fonts/SkRandomScalerContext.h",
|
|
|
|
"tools/fonts/SkTestFontMgr.cpp",
|
|
|
|
"tools/fonts/SkTestFontMgr.h",
|
2018-02-15 15:20:04 +00:00
|
|
|
"tools/fonts/SkTestSVGTypeface.cpp",
|
|
|
|
"tools/fonts/SkTestSVGTypeface.h",
|
|
|
|
"tools/fonts/SkTestTypeface.cpp",
|
|
|
|
"tools/fonts/SkTestTypeface.h",
|
2018-02-20 22:06:07 +00:00
|
|
|
"tools/fonts/sk_tool_utils_font.cpp",
|
|
|
|
"tools/fonts/test_font_monospace.inc",
|
|
|
|
"tools/fonts/test_font_sans_serif.inc",
|
|
|
|
"tools/fonts/test_font_serif.inc",
|
|
|
|
"tools/fonts/test_font_index.inc",
|
2016-04-01 12:00:51 +00:00
|
|
|
"tools/gpu/**/*.cpp",
|
|
|
|
"tools/gpu/**/*.h",
|
2016-02-09 20:32:52 +00:00
|
|
|
"tools/random_parse_path.cpp",
|
|
|
|
"tools/random_parse_path.h",
|
2018-03-26 21:48:09 +00:00
|
|
|
"tools/sk_pixel_iter.h",
|
2015-10-15 15:09:44 +00:00
|
|
|
"tools/sk_tool_utils.cpp",
|
|
|
|
"tools/sk_tool_utils.h",
|
2015-10-24 14:55:31 +00:00
|
|
|
"tools/timer/*.cpp",
|
|
|
|
"tools/timer/*.h",
|
2017-07-19 17:05:11 +00:00
|
|
|
"tools/trace/*.cpp",
|
|
|
|
"tools/trace/*.h",
|
2015-10-15 15:09:44 +00:00
|
|
|
],
|
|
|
|
exclude = [
|
2018-06-01 15:01:11 +00:00
|
|
|
"gm/cgms.cpp",
|
2015-10-26 17:46:25 +00:00
|
|
|
"tests/FontMgrAndroidParserTest.cpp", # Android-only.
|
2018-06-22 21:11:00 +00:00
|
|
|
"tests/FontMgrFontConfigTest.cpp", # FontConfig-only.
|
2015-10-15 15:09:44 +00:00
|
|
|
"tests/skia_test.cpp", # Old main.
|
2017-11-19 19:46:36 +00:00
|
|
|
"tools/gpu/atlastext/*",
|
2016-04-01 12:00:51 +00:00
|
|
|
"tools/gpu/gl/angle/*",
|
|
|
|
"tools/gpu/gl/egl/*",
|
|
|
|
"tools/gpu/gl/glx/*",
|
|
|
|
"tools/gpu/gl/iOS/*",
|
|
|
|
"tools/gpu/gl/mac/*",
|
|
|
|
"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
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2017-03-16 23:15:09 +00:00
|
|
|
################################################################################
|
|
|
|
## dm_srcs()
|
|
|
|
################################################################################
|
|
|
|
|
2017-10-17 14:57:34 +00:00
|
|
|
def dm_srcs(os_conditions):
|
2018-07-31 14:31:06 +00:00
|
|
|
"""Sources for the dm binary for the specified os."""
|
|
|
|
return skia_glob(DM_SRCS_ALL) + skia_select(
|
|
|
|
os_conditions,
|
|
|
|
[
|
|
|
|
[],
|
|
|
|
["tests/FontMgrAndroidParserTest.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",
|
2018-09-21 15:19:45 +00:00
|
|
|
"experimental/pipe",
|
2017-02-18 19:12:08 +00:00
|
|
|
"experimental/svg/model",
|
2015-10-15 15:09:44 +00:00
|
|
|
"src/codec",
|
2017-02-18 17:57:09 +00:00
|
|
|
"src/core",
|
2015-10-15 15:09:44 +00:00
|
|
|
"src/effects",
|
|
|
|
"src/fonts",
|
2016-11-23 15:55:18 +00:00
|
|
|
"src/images",
|
2015-10-15 15:09:44 +00:00
|
|
|
"src/pathops",
|
|
|
|
"src/pipe/utils",
|
2015-10-26 17:46:25 +00:00
|
|
|
"src/ports",
|
2017-05-30 20:39:47 +00:00
|
|
|
"src/shaders",
|
|
|
|
"src/shaders/gradients",
|
2017-02-18 14:51:33 +00:00
|
|
|
"src/xml",
|
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",
|
2018-02-20 22:06:07 +00:00
|
|
|
"tools/fonts",
|
2016-04-01 12:00:51 +00:00
|
|
|
"tools/gpu",
|
2015-10-15 15:09:44 +00:00
|
|
|
"tools/timer",
|
2017-07-19 17:05:11 +00:00
|
|
|
"tools/trace",
|
2015-10-15 15:09:44 +00:00
|
|
|
]
|
|
|
|
|
2016-01-13 18:45:19 +00:00
|
|
|
################################################################################
|
|
|
|
## DM_ARGS
|
|
|
|
################################################################################
|
2016-01-12 20:00:49 +00:00
|
|
|
|
2016-11-28 20:30:37 +00:00
|
|
|
def DM_ARGS(asan):
|
2018-11-08 19:26:02 +00:00
|
|
|
source = ["gm", "image", "lottie"]
|
2018-07-31 14:31:06 +00:00
|
|
|
|
|
|
|
# TODO(benjaminwagner): f16, pic-8888, serialize-8888, and tiles_rt-8888 fail.
|
|
|
|
config = ["565", "8888", "pdf"]
|
|
|
|
match = ["~Codec_78329453"]
|
|
|
|
return (["--src"] + source + ["--config"] + config + ["--nonativeFonts"] +
|
|
|
|
["--match"] + match)
|
2016-01-13 18:45:19 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
## COPTS
|
|
|
|
################################################################################
|
2015-11-02 19:11:21 +00:00
|
|
|
|
2017-10-17 14:57:34 +00:00
|
|
|
def base_copts(os_conditions):
|
2018-07-31 14:31:06 +00:00
|
|
|
return skia_select(
|
|
|
|
os_conditions,
|
|
|
|
[
|
|
|
|
# UNIX
|
|
|
|
[
|
|
|
|
"-Wno-implicit-fallthrough", # Some intentional fallthrough.
|
|
|
|
# Internal use of deprecated methods. :(
|
|
|
|
"-Wno-deprecated-declarations",
|
|
|
|
# TODO(kjlubick)
|
|
|
|
"-Wno-self-assign", # Spurious warning in tests/PathOpsDVectorTest.cpp?
|
|
|
|
],
|
|
|
|
# ANDROID
|
|
|
|
[
|
2018-08-22 20:45:11 +00:00
|
|
|
"-Wno-implicit-fallthrough", # Some intentional fallthrough.
|
2018-07-31 14:31:06 +00:00
|
|
|
# 'GrResourceCache' declared with greater visibility than the
|
|
|
|
# type of its field 'GrResourceCache::fPurgeableQueue'... bogus.
|
|
|
|
"-Wno-error=attributes",
|
|
|
|
],
|
|
|
|
# IOS
|
2018-07-31 20:41:37 +00:00
|
|
|
[
|
|
|
|
"-Wno-implicit-fallthrough", # Some intentional fallthrough.
|
|
|
|
],
|
2018-07-31 14:31:06 +00:00
|
|
|
],
|
|
|
|
)
|
2016-01-13 18:45:19 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
## DEFINES
|
|
|
|
################################################################################
|
|
|
|
|
2017-10-17 14:57:34 +00:00
|
|
|
def base_defines(os_conditions):
|
2018-07-31 14:31:06 +00:00
|
|
|
return [
|
|
|
|
# Chrome DEFINES.
|
|
|
|
"SK_USE_FREETYPE_EMBOLDEN",
|
|
|
|
# Turn on a few Google3-specific build fixes.
|
|
|
|
"SK_BUILD_FOR_GOOGLE3",
|
|
|
|
# Required for building dm.
|
|
|
|
"GR_TEST_UTILS",
|
|
|
|
# Staging flags for API changes
|
|
|
|
# Should remove after we update golden images
|
|
|
|
"SK_WEBP_ENCODER_USE_DEFAULT_METHOD",
|
|
|
|
# Experiment to diagnose image diffs in Google3
|
2018-10-24 10:52:35 +00:00
|
|
|
"SK_DISABLE_LOWP_RASTER_PIPELINE",
|
2018-07-31 14:31:06 +00:00
|
|
|
# JPEG is in codec_limited
|
|
|
|
"SK_HAS_JPEG_LIBRARY",
|
|
|
|
] + skia_select(
|
|
|
|
os_conditions,
|
|
|
|
[
|
|
|
|
# UNIX
|
|
|
|
[
|
|
|
|
"PNG_SKIP_SETJMP_CHECK",
|
|
|
|
"SK_BUILD_FOR_UNIX",
|
|
|
|
"SK_SAMPLES_FOR_X",
|
|
|
|
"SK_PDF_USE_SFNTLY",
|
|
|
|
"SK_HAS_PNG_LIBRARY",
|
|
|
|
"SK_HAS_WEBP_LIBRARY",
|
|
|
|
],
|
|
|
|
# ANDROID
|
|
|
|
[
|
|
|
|
"SK_BUILD_FOR_ANDROID",
|
|
|
|
"SK_HAS_PNG_LIBRARY",
|
|
|
|
"SK_HAS_WEBP_LIBRARY",
|
|
|
|
],
|
|
|
|
# IOS
|
|
|
|
[
|
|
|
|
"SK_BUILD_FOR_IOS",
|
|
|
|
"SK_BUILD_NO_OPTS",
|
|
|
|
"SKNX_NO_SIMD",
|
|
|
|
],
|
|
|
|
],
|
|
|
|
)
|
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
|
|
|
|
2017-10-17 14:57:34 +00:00
|
|
|
def base_linkopts(os_conditions):
|
2018-07-31 14:31:06 +00:00
|
|
|
return [
|
|
|
|
"-ldl",
|
|
|
|
] + skia_select(
|
|
|
|
os_conditions,
|
|
|
|
[
|
|
|
|
# UNIX
|
|
|
|
[],
|
|
|
|
# ANDROID
|
|
|
|
[
|
|
|
|
"-lEGL",
|
2018-08-17 13:28:53 +00:00
|
|
|
"-lGLESv2",
|
2018-07-31 14:31:06 +00:00
|
|
|
],
|
|
|
|
# IOS
|
|
|
|
[
|
|
|
|
"-framework CoreFoundation",
|
|
|
|
"-framework CoreGraphics",
|
|
|
|
"-framework CoreText",
|
|
|
|
"-framework ImageIO",
|
|
|
|
"-framework MobileCoreServices",
|
|
|
|
],
|
|
|
|
],
|
|
|
|
)
|
2018-11-08 19:25:19 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
## skottie_tool
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
SKOTTIE_TOOL_INCLUDES = [
|
2018-11-09 21:19:44 +00:00
|
|
|
"modules/skottie/utils",
|
2018-11-08 19:25:19 +00:00
|
|
|
"tools/flags",
|
|
|
|
]
|
|
|
|
|
|
|
|
SKOTTIE_TOOL_SRCS = [
|
|
|
|
"modules/skottie/src/SkottieTool.cpp",
|
2018-11-09 21:19:44 +00:00
|
|
|
"modules/skottie/utils/SkottieUtils.cpp",
|
|
|
|
"modules/skottie/utils/SkottieUtils.h",
|
2018-11-08 19:25:19 +00:00
|
|
|
# TODO(benjaminwagner): Add "flags" target.
|
|
|
|
"tools/flags/SkCommandLineFlags.cpp",
|
|
|
|
"tools/flags/SkCommandLineFlags.h",
|
|
|
|
]
|
2019-01-17 21:42:15 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
## SkShaper
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
SKSHAPER_INCLUDES = [
|
|
|
|
"modules/skshaper/include",
|
|
|
|
]
|
|
|
|
|
2019-01-21 16:55:51 +00:00
|
|
|
SKSHAPER_HARFBUZZ_SRCS = [
|
2019-01-17 21:42:15 +00:00
|
|
|
"modules/skshaper/include/SkShaper.h",
|
|
|
|
"modules/skshaper/src/SkShaper.cpp",
|
|
|
|
"modules/skshaper/src/SkShaper_harfbuzz.cpp",
|
|
|
|
]
|
2019-01-21 16:55:51 +00:00
|
|
|
|
|
|
|
SKSHAPER_PRIMITIVE_SRCS = [
|
|
|
|
"modules/skshaper/include/SkShaper.h",
|
|
|
|
"modules/skshaper/src/SkShaper.cpp",
|
|
|
|
"modules/skshaper/src/SkShaper_primitive.cpp",
|
|
|
|
]
|