Skip to content

Commit

Permalink
Skia
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlstrom-g committed Feb 24, 2024
1 parent 487180e commit 2249169
Show file tree
Hide file tree
Showing 979 changed files with 75,662 additions and 28,315 deletions.
6 changes: 6 additions & 0 deletions cobalt/renderer/rasterizer/skia/skia/skia_sources.gni
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ sksl_sources = [
"//third_party/skia/include/sksl/DSLSymbols.h",
"//third_party/skia/include/sksl/DSLType.h",
"//third_party/skia/include/sksl/DSLVar.h",
"//third_party/skia/include/sksl/SkSLDebugTrace.h",
"//third_party/skia/src/sksl/SkSLAnalysis.cpp",
"//third_party/skia/src/sksl/SkSLAnalysis.h",
"//third_party/skia/src/sksl/SkSLBuiltinTypes.cpp",
Expand Down Expand Up @@ -146,6 +147,8 @@ sksl_sources = [
"//third_party/skia/src/sksl/SkSLRehydrator.cpp",
"//third_party/skia/src/sksl/SkSLRehydrator.h",
"//third_party/skia/src/sksl/SkSLSampleUsage.cpp",
"//third_party/skia/src/sksl/SkSLSharedCompiler.cpp",
"//third_party/skia/src/sksl/SkSLSharedCompiler.h",
"//third_party/skia/src/sksl/SkSLString.cpp",
"//third_party/skia/src/sksl/SkSLThreadContext.cpp",
"//third_party/skia/src/sksl/SkSLThreadContext.h",
Expand All @@ -170,6 +173,8 @@ sksl_sources = [
"//third_party/skia/src/sksl/codegen/SkSLSPIRVtoHLSL.h",
"//third_party/skia/src/sksl/codegen/SkSLVMCodeGenerator.cpp",
"//third_party/skia/src/sksl/codegen/SkSLVMCodeGenerator.h",
"//third_party/skia/src/sksl/codegen/SkVMDebugTrace.cpp",
"//third_party/skia/src/sksl/codegen/SkVMDebugTrace.h",
"//third_party/skia/src/sksl/dsl/DSLBlock.cpp",
"//third_party/skia/src/sksl/dsl/DSLCase.cpp",
"//third_party/skia/src/sksl/dsl/DSLCore.cpp",
Expand Down Expand Up @@ -212,6 +217,7 @@ sksl_sources = [
"//third_party/skia/src/sksl/ir/SkSLConstructorStruct.h",
"//third_party/skia/src/sksl/ir/SkSLDoStatement.cpp",
"//third_party/skia/src/sksl/ir/SkSLDoStatement.h",
"//third_party/skia/src/sksl/ir/SkSLExpression.cpp",
"//third_party/skia/src/sksl/ir/SkSLExpressionStatement.cpp",
"//third_party/skia/src/sksl/ir/SkSLExpressionStatement.h",
"//third_party/skia/src/sksl/ir/SkSLFieldAccess.cpp",
Expand Down
23 changes: 20 additions & 3 deletions third_party/skia/.bazelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
build:clang --crosstool_top=//toolchain:clang_suite
build:clang --compiler=clang

# Use the default Bazel C++ toolchain to build the tools used during the
# build.
build:clang --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
# Use the default Bazel C++ toolchain to build the tools used during the build.
build:clang --host_crosstool_top=@bazel_tools//tools/cpp:toolchain

# =============================================================================
# Alias to build configurations below. This makes configuring things from
# the command line easier.
build --flag_alias=fontmgr_factory=//bazel/common_config_settings:fontmgr_factory
build --flag_alias=gpu_backend=//bazel/common_config_settings:gpu_backend
build --flag_alias=include_decoder=//bazel/common_config_settings:include_decoder
build --flag_alias=include_encoder=//bazel/common_config_settings:include_encoder
build --flag_alias=include_fontmgr=//bazel/common_config_settings:include_fontmgr
build --flag_alias=shaper_backend=//bazel/common_config_settings:shaper_backend
build --flag_alias=with_gl_standard=//bazel/common_config_settings:with_gl_standard

build --flag_alias=with_icu=//bazel/common_config_settings:use_icu
build --flag_alias=with_no_icu=no//bazel/common_config_settings:use_icu

# CanvasKit flags
build --flag_alias=ck_enable_fonts=//modules/canvaskit:enable_fonts
build --flag_alias=ck_disable_fonts=no//modules/canvaskit:enable_fonts
1 change: 1 addition & 0 deletions third_party/skia/.bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6.0.0-pre.20211025.1
2 changes: 2 additions & 0 deletions third_party/skia/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ Marcin Kazmierczak <[email protected]>
Matthew Leibowitz <[email protected]>
Microsoft <*@microsoft.com>
MIPS <*@imgtec.com>
Nils André-Chang <[email protected]>
Ning Liu <[email protected]>
Noah Lavine <[email protected]>
NVIDIA <*@nvidia.com>
Opera Software ASA <*@opera.com>
Pavel Krajcevski <[email protected]>
Petar Kirov <[email protected]>
Raul Tambre <[email protected]>
Safa Sofuoglu <[email protected]>
Samsung <*@samsung.com>
Samsung Open Source Group <*@osg.samsung.com>
Sergey Melnikov <[email protected]>
Expand Down
137 changes: 137 additions & 0 deletions third_party/skia/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# https://github.com/bazelbuild/bazel-skylib
load("@bazel_skylib//lib:selects.bzl", "selects")
load("//bazel:macros.bzl", "select_multi")
load("@bazel_gazelle//:def.bzl", "gazelle")

package(default_visibility = ["//:__subpackages__"])

cc_test(
name = "bazel_test",
size = "small",
Expand All @@ -12,3 +19,133 @@ cc_test(
"//third_party:musl_compat",
],
)

selects.config_setting_group(
name = "needs_jpeg",
match_any = [
"//bazel/common_config_settings:raw_decode_codec",
"//bazel/common_config_settings:jpeg_decode_codec",
"//bazel/common_config_settings:jpeg_encode_codec",
],
)

selects.config_setting_group(
name = "needs_png",
match_any = [
"//bazel/common_config_settings:png_decode_codec",
"//bazel/common_config_settings:png_encode_codec",
],
)

selects.config_setting_group(
name = "needs_webp",
match_any = [
"//bazel/common_config_settings:webp_decode_codec",
"//bazel/common_config_settings:webp_encode_codec",
],
)

selects.config_setting_group(
name = "any_freetype_fontmgr",
match_any = [
"//bazel/common_config_settings:custom_directory_fontmgr",
"//bazel/common_config_settings:custom_embedded_fontmgr",
"//bazel/common_config_settings:custom_empty_fontmgr",
],
)

CORE_DEPS = [
"//src/android:srcs",
"//src/codec:srcs",
"//src/core:srcs",
"//src/image:srcs",
"//src/images:srcs",
"//src/effects:srcs",
"//src/opts:srcs",
"//src/pathops:srcs",
"//src/ports:srcs",
"//src/sfnt:srcs",
"//src/shaders:srcs",
"//src/utils:srcs",
"//third_party:skcms",
] + selects.with_or({
# https://github.com/bazelbuild/bazel-skylib/blob/main/docs/selects_doc.md#selectswith_or
("//bazel/common_config_settings:gl_backend", "//bazel/common_config_settings:vulkan_backend"): [
"//src/gpu:srcs",
"//src/sksl:srcs",
# TODO(kjlubick) should mock be test only?
"//src/gpu:mock_srcs",
],
"//conditions:default": [],
}) + select_multi(
{
"//bazel/common_config_settings:gif_decode_codec": ["//third_party:wuffs"],
":needs_png": ["//third_party:libpng"],
"//bazel/common_config_settings:raw_decode_codec": [
"//third_party:piex",
"//third_party:dng_sdk",
],
":needs_webp": ["//third_party:libwebp"],
":needs_jpeg": ["//third_party:libjpeg-turbo"],
},
default = [],
) + select({
":any_freetype_fontmgr": [
"//third_party:freetype2",
],
"//conditions:default": [],
})

cc_library(
name = "skia_core",
textual_hdrs = ["//src/sksl:txts"],
deps = CORE_DEPS,
)

cc_library(
name = "hash_and_encode",
testonly = True,
srcs = [
"//tools:cmdline",
"//tools:hash_and_encode",
],
deps = [
":skia-core",
"//third_party:libpng",
],
)

cc_library(
name = "gms",
testonly = True,
srcs = [
"//gm:gms",
"//gm:srcs",
"//tools:srcs",
],
hdrs = [
"//gm:hdrs",
],
textual_hdrs = ["//tools:txts"],
deps = [":skia-core"],
)

cc_library(
name = "tests",
testonly = True,
srcs = [
"//tests:srcs",
"//tools:srcs",
],
hdrs = [
"//tests:hdrs",
],
local_defines = [
"GR_TEST_UTILS",
],
textual_hdrs = ["//tools:txts"],
deps = [":skia-core"],
)

# gazelle:prefix go.skia.org/skia
gazelle(name = "gazelle")
34 changes: 25 additions & 9 deletions third_party/skia/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if (is_fuchsia) {
}

if (skia_use_dawn) {
import("third_party/externals/dawn/scripts/dawn_features.gni")
import("//third_party/externals/dawn/scripts/dawn_features.gni")
}

if (defined(skia_settings)) {
Expand Down Expand Up @@ -57,9 +57,6 @@ config("skia_public") {
"SK_USE_WEBGL",
]
}
if (skia_enable_skgpu_v2) {
defines += [ "SK_GPU_V2=1" ]
}
if (!skia_enable_skgpu_v1) {
defines += [ "SK_GPU_V1=0" ]
}
Expand Down Expand Up @@ -630,9 +627,11 @@ if (skia_compile_sksl_tests) {
defines = [
"SKSL_STANDALONE",
"SK_DISABLE_TRACING",
"SK_ENABLE_SPIRV_CROSS",
"SK_ENABLE_SPIRV_VALIDATION",
]
sources = [
"src/core/SkArenaAlloc.cpp",
"src/core/SkBlockAllocator.cpp",
"src/core/SkCpu.cpp",
"src/core/SkData.cpp",
Expand All @@ -653,6 +652,9 @@ if (skia_compile_sksl_tests) {
"src/ports/SkMemory_malloc.cpp",
"src/ports/SkOSFile_stdio.cpp",
"src/sksl/SkSLMain.cpp",
"src/utils/SkJSON.cpp",
"src/utils/SkJSONWriter.cpp",
"src/utils/SkParse.cpp",
"src/utils/SkUTF.cpp",
]
if (is_win) {
Expand All @@ -667,6 +669,7 @@ if (skia_compile_sksl_tests) {
":run_sksllex",
"//third_party/externals/spirv-tools:spvtools",
"//third_party/externals/spirv-tools:spvtools_val",
"//third_party/spirv-cross:spirv_cross",
]
}

Expand Down Expand Up @@ -853,9 +856,6 @@ optional("gpu") {
public_deps = []

sources = skia_gpu_sources + skia_sksl_gpu_sources
if (skia_enable_skgpu_v2) {
sources += skia_skgpu_v2_sources
}
if (!skia_enable_skgpu_v1) {
sources -= skia_skgpu_v1_sources
}
Expand Down Expand Up @@ -936,8 +936,11 @@ optional("gpu") {
deps += [
"//third_party/externals/dawn/src/dawn:dawn_proc",
"//third_party/externals/dawn/src/dawn:dawncpp",
"//third_party/externals/dawn/src/dawn_native",
]
if (dawn_enable_d3d12 || dawn_enable_desktop_gl || dawn_enable_metal ||
dawn_enable_opengles || dawn_enable_vulkan) {
deps += [ "//third_party/externals/dawn/src/dawn_native" ]
}
if (dawn_enable_d3d12) {
libs += [
"d3d12.lib",
Expand All @@ -950,7 +953,10 @@ optional("gpu") {
}

if (skia_use_direct3d) {
public_defines += [ "SK_DIRECT3D" ]
public_defines += [
"SK_DIRECT3D",
"SK_ENABLE_SPIRV_CROSS",
]
deps += [
"//third_party/d3d12allocator",
"//third_party/spirv-cross:spirv_cross",
Expand Down Expand Up @@ -1010,6 +1016,12 @@ optional("heif") {
enabled = skia_use_libheif
public_defines = [ "SK_HAS_HEIF_LIBRARY" ]

# This HEIF decoding functionality is a part of the Android Framework.
# https://android.googlesource.com/platform/frameworks/av/+/master/media/libheif/include/HeifDecoderAPI.h
# There isn't a way to compile that library outside of it, so we just link against
# the library. This feature is not supported on other platforms (and we haven't
# yet tried something like https://github.com/strukturag/libheif/tree/master/libheif).
# The dependency for Android is set in gn_to_bp.py.
deps = []

sources = [ "src/codec/SkHeifCodec.cpp" ]
Expand Down Expand Up @@ -1637,6 +1649,7 @@ if (skia_enable_tools) {
}
skia_source_set(target_name) {
forward_variables_from(invoker, "*", [])
check_includes = false
public_configs = [
":" + target_name + "_config",
":skia_private",
Expand Down Expand Up @@ -2032,6 +2045,9 @@ if (skia_enable_tools) {
}
if (skia_enable_graphite) {
sources += graphite_tests_sources
if (skia_use_metal) {
sources += graphite_metal_tests_sources
}
}
if (!skia_enable_skgpu_v1) {
sources -= skgpu_v1_tests_sources
Expand Down
24 changes: 12 additions & 12 deletions third_party/skia/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling different
# dependencies without interference from each other.
'sk_tool_revision': 'git_revision:8cba87bd19247084af412ca52dec7ab7ab33c923',
'sk_tool_revision': 'git_revision:47e2b5077062ef0ae7a32239ca7cea1abf8cc1a2',
}

deps = {
"buildtools" : "https://chromium.googlesource.com/chromium/buildtools.git@505de88083136eefd056e5ee4ca0f01fe9b33de8",
"third_party/externals/angle2" : "https://chromium.googlesource.com/angle/angle.git@8c9b8f03e0f3bfb58f2023231337db6d03b6fc84",
"buildtools" : "https://chromium.googlesource.com/chromium/src/buildtools.git@b138e6ce86ae843c42a1a08f37903207bebcca75",
"third_party/externals/angle2" : "https://chromium.googlesource.com/angle/angle.git@0e291f60ccbfd1deddad6f98159417c7d7f524b3",
"third_party/externals/brotli" : "https://skia.googlesource.com/external/github.com/google/brotli.git@e61745a6b7add50d380cfd7d3883dd6c62fc2c71",
"third_party/externals/d3d12allocator" : "https://skia.googlesource.com/external/github.com/GPUOpen-LibrariesAndSDKs/D3D12MemoryAllocator.git@169895d529dfce00390a20e69c2f516066fe7a3b",
# Dawn requires jinja2 and markupsafe for the code generator, tint for SPIRV compilation, and abseil for string formatting.
# When the Dawn revision is updated these should be updated from the Dawn DEPS as well.
"third_party/externals/dawn" : "https://dawn.googlesource.com/dawn.git@26db646d8ff86cd75977688bb0e21c67f9e89680",
"third_party/externals/dawn" : "https://dawn.googlesource.com/dawn.git@264f239259c558ff30e2992a6875a7b7c154bf48",
"third_party/externals/jinja2" : "https://chromium.googlesource.com/chromium/src/third_party/jinja2@ee69aa00ee8536f61db6a451f3858745cf587de6",
"third_party/externals/markupsafe" : "https://chromium.googlesource.com/chromium/src/third_party/markupsafe@0944e71f4b2cb9a871bcbe353f95e889b64a611a",
"third_party/externals/tint" : "https://dawn.googlesource.com/tint@e0e45a4d473a256aadc8e8765ce71a536c22b634",
"third_party/externals/tint" : "https://dawn.googlesource.com/tint@a8c202b8e779b7ddc7edf8bf2fac9534d521fa64",
"third_party/externals/abseil-cpp" : "https://chromium.googlesource.com/chromium/src/third_party/abseil-cpp@789af048b388657987c59d4da406859034fe310f",
"third_party/externals/dng_sdk" : "https://android.googlesource.com/platform/external/dng_sdk.git@c8d0c9b1d16bfda56f15165d39e0ffa360a11123",
"third_party/externals/egl-registry" : "https://skia.googlesource.com/external/github.com/KhronosGroup/EGL-Registry@a0bca08de07c7d7651047bedc0b653cfaaa4f2ae",
"third_party/externals/expat" : "https://chromium.googlesource.com/external/github.com/libexpat/libexpat.git@a28238bdeebc087071777001245df1876a11f5ee",
"third_party/externals/freetype" : "https://chromium.googlesource.com/chromium/src/third_party/freetype2.git@e6e6cbf1648d4a776da0857921872f2fbc853205",
"third_party/externals/harfbuzz" : "https://chromium.googlesource.com/external/github.com/harfbuzz/harfbuzz.git@a52c6df38a38c4e36ff991dfb4b7d92e48a44553",
"third_party/externals/freetype" : "https://chromium.googlesource.com/chromium/src/third_party/freetype2.git@cff026d41599945498044d2f4dcc0e610ffb6929",
"third_party/externals/harfbuzz" : "https://chromium.googlesource.com/external/github.com/harfbuzz/harfbuzz.git@3160789701463bcd822c26010da4de33c92c85d9",
"third_party/externals/icu" : "https://chromium.googlesource.com/chromium/deps/icu.git@a0718d4f121727e30b8d52c7a189ebf5ab52421f",
"third_party/externals/imgui" : "https://skia.googlesource.com/external/github.com/ocornut/imgui.git@9418dcb69355558f70de260483424412c5ca2fce",
"third_party/externals/imgui" : "https://skia.googlesource.com/external/github.com/ocornut/imgui.git@55d35d8387c15bf0cfd71861df67af8cfbda7456",
"third_party/externals/libgifcodec" : "https://skia.googlesource.com/libgifcodec@fd59fa92a0c86788dcdd84d091e1ce81eda06a77",
"third_party/externals/libjpeg-turbo" : "https://chromium.googlesource.com/chromium/deps/libjpeg_turbo.git@24e310554f07c0fdb8ee52e3e708e4f3e9eb6e20",
"third_party/externals/libpng" : "https://skia.googlesource.com/third_party/libpng.git@386707c6d19b974ca2e3db7f5c61873813c6fe44",
Expand All @@ -38,15 +38,15 @@ deps = {
"third_party/externals/piex" : "https://android.googlesource.com/platform/external/piex.git@bb217acdca1cc0c16b704669dd6f91a1b509c406",
"third_party/externals/sfntly" : "https://chromium.googlesource.com/external/github.com/googlei18n/sfntly.git@b55ff303ea2f9e26702b514cf6a3196a2e3e2974",
"third_party/externals/spirv-cross" : "https://chromium.googlesource.com/external/github.com/KhronosGroup/SPIRV-Cross@0e2880ab990e79ce6cc8c79c219feda42d98b1e8",
"third_party/externals/spirv-headers" : "https://skia.googlesource.com/external/github.com/KhronosGroup/SPIRV-Headers.git@cf653e4ca4858583802b0d1656bc934edff6bd7f",
"third_party/externals/spirv-tools" : "https://skia.googlesource.com/external/github.com/KhronosGroup/SPIRV-Tools.git@11cd875ed88484f93943071083b4821b4c3d2193",
"third_party/externals/swiftshader" : "https://swiftshader.googlesource.com/SwiftShader@e733a26e2ba04c8eb37aece51a81600a99e01612",
"third_party/externals/spirv-headers" : "https://skia.googlesource.com/external/github.com/KhronosGroup/SPIRV-Headers.git@814e728b30ddd0f4509233099a3ad96fd4318c07",
"third_party/externals/spirv-tools" : "https://skia.googlesource.com/external/github.com/KhronosGroup/SPIRV-Tools.git@4b092d2ab81854e61632bdd1e658907f0071c37e",
"third_party/externals/swiftshader" : "https://swiftshader.googlesource.com/SwiftShader@a4232c15e287a38b93d2a55bd1d7894cb4effac3",
#"third_party/externals/v8" : "https://chromium.googlesource.com/v8/v8.git@5f1ae66d5634e43563b2d25ea652dfb94c31a3b4",
"third_party/externals/wuffs" : "https://skia.googlesource.com/external/github.com/google/wuffs-mirror-release-c.git@600cd96cf47788ee3a74b40a6028b035c9fd6a61",
"third_party/externals/zlib" : "https://chromium.googlesource.com/chromium/src/third_party/zlib@c876c8f87101c5a75f6014b0f832499afeb65b73",

"../src": {
"url": "https://chromium.googlesource.com/chromium/src.git@f69977b0a3604f0fde84d1b6e957c1882837bfcf",
"url": "https://chromium.googlesource.com/chromium/src.git@4fa82a541d87a2da48b74c2e33f5d97b0a8c1783",
"condition": "checkout_chromium",
},

Expand Down
Loading

0 comments on commit 2249169

Please sign in to comment.