[infra] Add SkParagraph (harfbuzz, ICU) to Canvaskit Bazel build.

As a follow-up to https://skia-review.googlesource.com/c/skia/+/476219,
this sketches out how we can maybe use cc_library for the things
in //modules to make sure something in //src doesn't depend on
anything in //modules, for example.

The following succeeds:
bazel build //modules/skparagraph:skparagraph --config=clang \
  --shaper_backend=harfbuzz_shaper --with_icu

As does `make bazel_canvaskit_debug` in //modules/canvaskit

Suggested Review Order:
 - third_party/BUILD.bazel for ICU and harfbuzz rules. Pay
   special attention to the genrules used to call the python
   script for turning the icu .dat file into .S or .cpp.
 - bazelrc and bazel/ for new flags and defines that control
   use of ICU and harfbuzz. Unlike GN, with the public_defines
   that get added in automatically if icu or harfbuzz is
   depended upon, we need to set the defines at the top level.
   This necessity might go away if we change the atoms to
   depend on //modules/skshaper, which could define that flag.
 - Top level BUILD.bazel files in //modules/skparagraph,
   //modules/skshaper, //modules/skunicode, //modules/canvaskit
 - All other .bazel file changes are automatic.

Bug: skia:12541
Change-Id: I38a9e0a9261d7e142eeb271c2ddb23f362f91473
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/478116
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
This commit is contained in:
Kevin Lubick 2021-11-30 15:59:32 -05:00
parent 5588bdd72d
commit 4bd08c52c0
29 changed files with 2062 additions and 9 deletions

View File

@ -12,8 +12,11 @@ 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

View File

@ -63,8 +63,22 @@ PLATFORM_DEFINES = select({
"//conditions:default": [],
})
SHAPER_DEFINES = select_multi(
{
"//bazel/common_config_settings:coretext_shaper": ["SK_SHAPER_CORETEXT_AVAILABLE"],
"//bazel/common_config_settings:harfbuzz_shaper": ["SK_SHAPER_HARFBUZZ_AVAILABLE"],
},
default = [],
)
UNICODE_DEFINES = select({
"//bazel/common_config_settings:use_icu_true": ["SK_UNICODE_AVAILABLE"],
"//conditions:default": [],
})
cc_library(
name = "defines_from_flags",
defines = GENERAL_DEFINES + GPU_DEFINES + CODEC_DEFINES + PLATFORM_DEFINES,
defines = GENERAL_DEFINES + GPU_DEFINES + CODEC_DEFINES + PLATFORM_DEFINES +
SHAPER_DEFINES + UNICODE_DEFINES,
visibility = ["//:__subpackages__"],
)

View File

@ -2,7 +2,8 @@ generate:
bazel build @org_skia_go_infra//bazel/gazelle:gazelle_cpp
cd .. && bazel-bin/external/org_skia_go_infra/bazel/gazelle/gazelle_cpp_/gazelle_cpp update \
--third_party_file_map="third_party/file_map_for_bazel.json" \
include src tools modules/skshaper modules/svg modules/skresources \
include src tools \
modules/skshaper modules/svg modules/skresources modules/skparagraph modules/skunicode \
experimental/bazel_test
gazelle_update_repo:

View File

@ -6,6 +6,10 @@ It is based off of https://github.com/bazelbuild/examples/tree/main/rules/starla
"""
_bool_flags = [
"//bazel/common_config_settings:use_icu",
]
_string_flags = [
"//bazel/common_config_settings:fontmgr_factory",
"//bazel/common_config_settings:with_gl_standard",
@ -16,10 +20,11 @@ _string_list_flags = [
"//bazel/common_config_settings:include_decoder",
"//bazel/common_config_settings:include_encoder",
"//bazel/common_config_settings:include_fontmgr",
"//bazel/common_config_settings:shaper_backend",
]
# These are the flags that we support setting via set_flags
_flags = _string_flags + _string_list_flags
_flags = _bool_flags + _string_flags + _string_list_flags
def _flag_transition_impl(settings, attr):
rv = {}
@ -41,6 +46,11 @@ def _flag_transition_impl(settings, attr):
rv[key] = flag_setting[0]
else:
rv[key] = flag_setting # we know flag_setting is a string (e.g. the default).
elif key in _bool_flags:
if type(flag_setting) == "list":
rv[key] = flag_setting[0] == "True"
else:
rv[key] = flag_setting # flag_setting will be a boolean, the default
return rv
# This defines a Starlark transition and which flags it reads and writes.

View File

@ -1,4 +1,4 @@
load(":defs.bzl", "string_flag_with_values")
load(":defs.bzl", "bool_flag", "string_flag_with_values")
# @platforms is found at https://github.com/bazelbuild/platforms
package(default_visibility = ["//:__subpackages__"])
@ -133,3 +133,17 @@ string_flag_with_values(
"webp_encode_codec",
],
)
string_flag_with_values(
flag_name = "shaper_backend",
multiple = True,
values = [
"harfbuzz_shaper",
"coretext_shaper",
],
)
bool_flag(
default = False,
flag_name = "use_icu",
)

View File

@ -97,6 +97,7 @@ generated_cc_atom(
hdrs = ["SkImageFilters.h"],
visibility = ["//:__subpackages__"],
deps = [
":SkRuntimeEffect_hdr",
"//include/core:SkBlendMode_hdr",
"//include/core:SkColor_hdr",
"//include/core:SkImageFilter_hdr",
@ -104,6 +105,7 @@ generated_cc_atom(
"//include/core:SkPicture_hdr",
"//include/core:SkRect_hdr",
"//include/core:SkTileMode_hdr",
"//include/core:SkTypes_hdr",
],
)

View File

@ -111,7 +111,7 @@ genrule(
)
CK_DEFINES = select({
":enable_fonts_true": [],
":enable_fonts_true": ["SK_INCLUDE_PARAGRAPH=1"],
":enable_fonts_false": ["SK_NO_FONTS"],
})
@ -147,6 +147,8 @@ CK_OPTS = BASE_LINKOPTS + [
":enable_fonts_true": [
"--pre-js",
"modules/canvaskit/font.js",
"--pre-js",
"modules/canvaskit/paragraph.js",
],
":enable_fonts_false": [],
}) + select({
@ -233,6 +235,12 @@ CK_SRCS = [
] + select({
":include_embedded_font_true": ["fonts/NotoMono-Regular.ttf.bazel.cpp"],
":include_embedded_font_false": [],
}) + select({
":enable_fonts_true": [
"paragraph_bindings.cpp",
"paragraph_bindings_gen.cpp",
],
":enable_fonts_false": [],
})
cc_binary_with_flags(
@ -272,13 +280,24 @@ cc_binary_with_flags(
"with_gl_standard": [
"webgl_standard",
],
"use_icu": [
"True",
],
"shaper_backend": [
"harfbuzz_shaper",
],
},
# This target won't build successfully on its own because of missing emscripten
# headers etc. Therefore, we hide it from wildcards.
tags = ["manual"],
deps = [
"//:skia_core",
],
] + select({
":enable_fonts_true": [
"//modules/skparagraph:skparagraph",
],
":enable_fonts_false": [],
}),
)
wasm_cc_binary(

View File

@ -0,0 +1,24 @@
cc_library(
name = "skparagraph",
hdrs = ["//modules/skparagraph/include:hdrs"],
visibility = ["//:__subpackages__"],
deps = [
"//modules/skparagraph/src:Decorations_src",
"//modules/skparagraph/src:FontCollection_src",
"//modules/skparagraph/src:OneLineShaper_src",
"//modules/skparagraph/src:ParagraphBuilderImpl_src",
"//modules/skparagraph/src:ParagraphCache_src",
"//modules/skparagraph/src:ParagraphImpl_src",
"//modules/skparagraph/src:ParagraphStyle_src",
"//modules/skparagraph/src:Run_src",
"//modules/skparagraph/src:TextLine_src",
"//modules/skparagraph/src:TextShadow_src",
"//modules/skparagraph/src:TextStyle_src",
"//modules/skparagraph/src:TextWrapper_src",
"//modules/skparagraph/src:TypefaceFontProvider_src",
# TODO(kjlubick) Can this make a bigger, clearer error if harfbuzz and ICU are not
# available?
"//modules/skshaper",
"//modules/skunicode",
],
)

View File

@ -0,0 +1,17 @@
load("//bazel:macros.bzl", "generated_cc_atom")
generated_cc_atom(
name = "ParagraphBench_src",
srcs = ["ParagraphBench.cpp"],
visibility = ["//:__subpackages__"],
deps = [
"//bench:Benchmark_hdr",
"//include/core:SkPictureRecorder_hdr",
"//modules/skparagraph/include:FontCollection_hdr",
"//modules/skparagraph/include:Paragraph_hdr",
"//modules/skparagraph/src:ParagraphBuilderImpl_hdr",
"//modules/skparagraph/src:ParagraphImpl_hdr",
"//modules/skparagraph/utils:TestFontCollection_hdr",
"//tools:Resources_hdr",
],
)

View File

@ -0,0 +1,25 @@
load("//bazel:macros.bzl", "generated_cc_atom")
generated_cc_atom(
name = "simple_gm_src",
srcs = ["simple_gm.cpp"],
visibility = ["//:__subpackages__"],
deps = [
"//gm:gm_hdr",
"//include/core:SkCanvas_hdr",
"//include/core:SkColor_hdr",
"//include/core:SkFontTypes_hdr",
"//include/core:SkFont_hdr",
"//include/core:SkPaint_hdr",
"//include/core:SkPoint_hdr",
"//include/core:SkRect_hdr",
"//include/core:SkScalar_hdr",
"//include/core:SkShader_hdr",
"//include/core:SkSize_hdr",
"//include/core:SkString_hdr",
"//include/core:SkTypeface_hdr",
"//modules/skparagraph/include:Paragraph_hdr",
"//modules/skparagraph/src:ParagraphBuilderImpl_hdr",
"//tools:ToolUtils_hdr",
],
)

View File

@ -0,0 +1,134 @@
load("//bazel:macros.bzl", "generated_cc_atom")
filegroup(
name = "hdrs",
srcs = [
"DartTypes.h",
"FontCollection.h",
"Metrics.h",
"Paragraph.h",
"ParagraphBuilder.h",
"ParagraphCache.h",
"ParagraphStyle.h",
"TextShadow.h",
"TextStyle.h",
"TypefaceFontProvider.h",
],
visibility = ["//modules/skparagraph:__pkg__"],
)
generated_cc_atom(
name = "DartTypes_hdr",
hdrs = ["DartTypes.h"],
visibility = ["//:__subpackages__"],
deps = [
"//include/core:SkRect_hdr",
"//include/core:SkTypes_hdr",
],
)
generated_cc_atom(
name = "FontCollection_hdr",
hdrs = ["FontCollection.h"],
visibility = ["//:__subpackages__"],
deps = [
":ParagraphCache_hdr",
":TextStyle_hdr",
"//include/core:SkFontMgr_hdr",
"//include/core:SkRefCnt_hdr",
"//include/private:SkTHash_hdr",
],
)
generated_cc_atom(
name = "Metrics_hdr",
hdrs = ["Metrics.h"],
visibility = ["//:__subpackages__"],
deps = [":TextStyle_hdr"],
)
generated_cc_atom(
name = "ParagraphBuilder_hdr",
hdrs = ["ParagraphBuilder.h"],
visibility = ["//:__subpackages__"],
deps = [
":FontCollection_hdr",
":ParagraphStyle_hdr",
":Paragraph_hdr",
":TextStyle_hdr",
],
)
generated_cc_atom(
name = "ParagraphCache_hdr",
hdrs = ["ParagraphCache.h"],
visibility = ["//:__subpackages__"],
deps = [
"//include/private:SkMutex_hdr",
"//src/core:SkLRUCache_hdr",
],
)
generated_cc_atom(
name = "ParagraphStyle_hdr",
hdrs = ["ParagraphStyle.h"],
visibility = ["//:__subpackages__"],
deps = [
":DartTypes_hdr",
":TextStyle_hdr",
"//include/core:SkFontStyle_hdr",
"//include/core:SkScalar_hdr",
"//include/core:SkString_hdr",
],
)
generated_cc_atom(
name = "Paragraph_hdr",
hdrs = ["Paragraph.h"],
visibility = ["//:__subpackages__"],
deps = [
":FontCollection_hdr",
":Metrics_hdr",
":ParagraphStyle_hdr",
":TextStyle_hdr",
],
)
generated_cc_atom(
name = "TextShadow_hdr",
hdrs = ["TextShadow.h"],
visibility = ["//:__subpackages__"],
deps = [
"//include/core:SkColor_hdr",
"//include/core:SkPoint_hdr",
],
)
generated_cc_atom(
name = "TextStyle_hdr",
hdrs = ["TextStyle.h"],
visibility = ["//:__subpackages__"],
deps = [
":DartTypes_hdr",
":TextShadow_hdr",
"//include/core:SkColor_hdr",
"//include/core:SkFontMetrics_hdr",
"//include/core:SkFontStyle_hdr",
"//include/core:SkFont_hdr",
"//include/core:SkPaint_hdr",
"//include/core:SkScalar_hdr",
],
)
generated_cc_atom(
name = "TypefaceFontProvider_hdr",
hdrs = ["TypefaceFontProvider.h"],
visibility = ["//:__subpackages__"],
deps = [
"//include/core:SkFontMgr_hdr",
"//include/core:SkStream_hdr",
"//include/core:SkString_hdr",
"//include/private:SkTArray_hdr",
"//include/private:SkTHash_hdr",
],
)

View File

@ -0,0 +1,36 @@
load("//bazel:macros.bzl", "generated_cc_atom")
generated_cc_atom(
name = "SampleParagraph_src",
srcs = ["SampleParagraph.cpp"],
visibility = ["//:__subpackages__"],
deps = [
"//include/core:SkCanvas_hdr",
"//include/core:SkColorFilter_hdr",
"//include/core:SkColorPriv_hdr",
"//include/core:SkFontMgr_hdr",
"//include/core:SkGraphics_hdr",
"//include/core:SkPath_hdr",
"//include/core:SkRegion_hdr",
"//include/core:SkShader_hdr",
"//include/core:SkStream_hdr",
"//include/core:SkTextBlob_hdr",
"//include/core:SkTime_hdr",
"//include/core:SkTypeface_hdr",
"//include/effects:SkGradientShader_hdr",
"//include/utils:SkRandom_hdr",
"//modules/skparagraph/include:Paragraph_hdr",
"//modules/skparagraph/include:TypefaceFontProvider_hdr",
"//modules/skparagraph/src:ParagraphBuilderImpl_hdr",
"//modules/skparagraph/src:ParagraphImpl_hdr",
"//modules/skparagraph/src:TextLine_hdr",
"//modules/skparagraph/utils:TestFontCollection_hdr",
"//samplecode:Sample_hdr",
"//src/core:SkOSFile_hdr",
"//src/shaders:SkColorShader_hdr",
"//src/utils:SkOSPath_hdr",
"//src/utils:SkUTF_hdr",
"//tools:Resources_hdr",
"//tools/flags:CommandLineFlags_hdr",
],
)

View File

@ -0,0 +1,322 @@
load("//bazel:macros.bzl", "generated_cc_atom")
generated_cc_atom(
name = "Decorations_hdr",
hdrs = ["Decorations.h"],
visibility = ["//:__subpackages__"],
deps = [
":TextLine_hdr",
"//include/core:SkCanvas_hdr",
"//include/core:SkPath_hdr",
"//modules/skparagraph/include:TextStyle_hdr",
],
)
generated_cc_atom(
name = "Decorations_src",
srcs = ["Decorations.cpp"],
visibility = ["//:__subpackages__"],
deps = [
":Decorations_hdr",
"//include/core:SkPathBuilder_hdr",
"//include/effects:SkDashPathEffect_hdr",
"//include/effects:SkDiscretePathEffect_hdr",
],
)
generated_cc_atom(
name = "FontCollection_src",
srcs = ["FontCollection.cpp"],
visibility = ["//:__subpackages__"],
deps = [
":ParagraphImpl_hdr",
"//include/core:SkTypeface_hdr",
"//modules/skparagraph/include:FontCollection_hdr",
"//modules/skparagraph/include:Paragraph_hdr",
"//modules/skshaper/include:SkShaper_hdr",
],
)
generated_cc_atom(
name = "Iterators_hdr",
hdrs = ["Iterators.h"],
visibility = ["//:__subpackages__"],
deps = [
"//include/core:SkSpan_hdr",
"//include/core:SkString_hdr",
"//include/core:SkTypes_hdr",
"//modules/skparagraph/include:TextStyle_hdr",
"//modules/skshaper/include:SkShaper_hdr",
],
)
generated_cc_atom(
name = "OneLineShaper_hdr",
hdrs = ["OneLineShaper.h"],
visibility = ["//:__subpackages__"],
deps = [
":ParagraphImpl_hdr",
":Run_hdr",
"//include/core:SkSpan_hdr",
"//modules/skparagraph/include:TextStyle_hdr",
],
)
generated_cc_atom(
name = "OneLineShaper_src",
srcs = ["OneLineShaper.cpp"],
visibility = ["//:__subpackages__"],
deps = [
":Iterators_hdr",
":OneLineShaper_hdr",
"//src/utils:SkUTF_hdr",
],
)
generated_cc_atom(
name = "ParagraphBuilderImpl_hdr",
hdrs = ["ParagraphBuilderImpl.h"],
visibility = ["//:__subpackages__"],
deps = [
"//modules/skparagraph/include:FontCollection_hdr",
"//modules/skparagraph/include:ParagraphBuilder_hdr",
"//modules/skparagraph/include:ParagraphStyle_hdr",
"//modules/skparagraph/include:Paragraph_hdr",
"//modules/skparagraph/include:TextStyle_hdr",
"//modules/skunicode/include:SkUnicode_hdr",
],
)
generated_cc_atom(
name = "ParagraphBuilderImpl_src",
srcs = ["ParagraphBuilderImpl.cpp"],
visibility = ["//:__subpackages__"],
deps = [
":ParagraphBuilderImpl_hdr",
":ParagraphImpl_hdr",
"//include/core:SkTypes_hdr",
"//modules/skparagraph/include:FontCollection_hdr",
"//modules/skparagraph/include:ParagraphBuilder_hdr",
"//modules/skparagraph/include:ParagraphStyle_hdr",
"//modules/skparagraph/include:Paragraph_hdr",
"//modules/skparagraph/include:TextStyle_hdr",
"//src/core:SkStringUtils_hdr",
],
)
generated_cc_atom(
name = "ParagraphCache_src",
srcs = ["ParagraphCache.cpp"],
visibility = ["//:__subpackages__"],
deps = [
":ParagraphImpl_hdr",
"//modules/skparagraph/include:ParagraphCache_hdr",
],
)
generated_cc_atom(
name = "ParagraphImpl_hdr",
hdrs = ["ParagraphImpl.h"],
visibility = ["//:__subpackages__"],
deps = [
":Run_hdr",
":TextLine_hdr",
"//include/core:SkFont_hdr",
"//include/core:SkPaint_hdr",
"//include/core:SkPicture_hdr",
"//include/core:SkPoint_hdr",
"//include/core:SkRect_hdr",
"//include/core:SkRefCnt_hdr",
"//include/core:SkScalar_hdr",
"//include/core:SkSpan_hdr",
"//include/core:SkString_hdr",
"//include/core:SkTypes_hdr",
"//include/private:SkBitmaskEnum_hdr",
"//include/private:SkTArray_hdr",
"//include/private:SkTHash_hdr",
"//include/private:SkTemplates_hdr",
"//modules/skparagraph/include:DartTypes_hdr",
"//modules/skparagraph/include:FontCollection_hdr",
"//modules/skparagraph/include:ParagraphCache_hdr",
"//modules/skparagraph/include:ParagraphStyle_hdr",
"//modules/skparagraph/include:Paragraph_hdr",
"//modules/skparagraph/include:TextShadow_hdr",
"//modules/skparagraph/include:TextStyle_hdr",
"//modules/skunicode/include:SkUnicode_hdr",
],
)
generated_cc_atom(
name = "ParagraphImpl_src",
srcs = ["ParagraphImpl.cpp"],
visibility = ["//:__subpackages__"],
deps = [
":OneLineShaper_hdr",
":ParagraphImpl_hdr",
":Run_hdr",
":TextLine_hdr",
":TextWrapper_hdr",
"//include/core:SkCanvas_hdr",
"//include/core:SkFontMetrics_hdr",
"//include/core:SkMatrix_hdr",
"//include/core:SkPictureRecorder_hdr",
"//include/core:SkSpan_hdr",
"//include/core:SkTypeface_hdr",
"//include/private:SkTFitsIn_hdr",
"//include/private:SkTo_hdr",
"//modules/skparagraph/include:Metrics_hdr",
"//modules/skparagraph/include:ParagraphStyle_hdr",
"//modules/skparagraph/include:Paragraph_hdr",
"//modules/skparagraph/include:TextStyle_hdr",
"//src/utils:SkUTF_hdr",
],
)
generated_cc_atom(
name = "ParagraphStyle_src",
srcs = ["ParagraphStyle.cpp"],
visibility = ["//:__subpackages__"],
deps = [
"//modules/skparagraph/include:DartTypes_hdr",
"//modules/skparagraph/include:ParagraphStyle_hdr",
"//src/core:SkStringUtils_hdr",
"//src/utils:SkUTF_hdr",
],
)
generated_cc_atom(
name = "Run_hdr",
hdrs = ["Run.h"],
visibility = ["//:__subpackages__"],
deps = [
"//include/core:SkFontMetrics_hdr",
"//include/core:SkFont_hdr",
"//include/core:SkPoint_hdr",
"//include/core:SkRect_hdr",
"//include/core:SkScalar_hdr",
"//include/core:SkSpan_hdr",
"//include/core:SkTypes_hdr",
"//include/private:SkTArray_hdr",
"//modules/skparagraph/include:DartTypes_hdr",
"//modules/skparagraph/include:TextStyle_hdr",
"//modules/skshaper/include:SkShaper_hdr",
],
)
generated_cc_atom(
name = "Run_src",
srcs = ["Run.cpp"],
visibility = ["//:__subpackages__"],
deps = [
":ParagraphImpl_hdr",
":Run_hdr",
"//include/core:SkFontMetrics_hdr",
"//include/core:SkTextBlob_hdr",
"//include/private:SkFloatingPoint_hdr",
"//include/private:SkMalloc_hdr",
"//include/private:SkTo_hdr",
"//modules/skparagraph/include:DartTypes_hdr",
"//modules/skparagraph/include:TextStyle_hdr",
"//modules/skshaper/include:SkShaper_hdr",
"//src/utils:SkUTF_hdr",
],
)
generated_cc_atom(
name = "TextLine_hdr",
hdrs = ["TextLine.h"],
visibility = ["//:__subpackages__"],
deps = [
":Run_hdr",
"//include/core:SkPoint_hdr",
"//include/core:SkRect_hdr",
"//include/core:SkScalar_hdr",
"//include/private:SkTArray_hdr",
"//modules/skparagraph/include:DartTypes_hdr",
"//modules/skparagraph/include:Metrics_hdr",
"//modules/skparagraph/include:TextStyle_hdr",
],
)
generated_cc_atom(
name = "TextLine_src",
srcs = ["TextLine.cpp"],
visibility = ["//:__subpackages__"],
deps = [
":Decorations_hdr",
":ParagraphImpl_hdr",
":TextLine_hdr",
"//include/core:SkBlurTypes_hdr",
"//include/core:SkCanvas_hdr",
"//include/core:SkFontMetrics_hdr",
"//include/core:SkFont_hdr",
"//include/core:SkMaskFilter_hdr",
"//include/core:SkPaint_hdr",
"//include/core:SkSpan_hdr",
"//include/core:SkString_hdr",
"//include/core:SkTextBlob_hdr",
"//include/core:SkTypes_hdr",
"//include/private:SkTemplates_hdr",
"//include/private:SkTo_hdr",
"//modules/skparagraph/include:DartTypes_hdr",
"//modules/skparagraph/include:Metrics_hdr",
"//modules/skparagraph/include:ParagraphStyle_hdr",
"//modules/skparagraph/include:TextShadow_hdr",
"//modules/skparagraph/include:TextStyle_hdr",
"//modules/skshaper/include:SkShaper_hdr",
],
)
generated_cc_atom(
name = "TextShadow_src",
srcs = ["TextShadow.cpp"],
visibility = ["//:__subpackages__"],
deps = [
"//include/core:SkColor_hdr",
"//modules/skparagraph/include:TextShadow_hdr",
],
)
generated_cc_atom(
name = "TextStyle_src",
srcs = ["TextStyle.cpp"],
visibility = ["//:__subpackages__"],
deps = [
"//include/core:SkColor_hdr",
"//include/core:SkFontStyle_hdr",
"//modules/skparagraph/include:TextStyle_hdr",
],
)
generated_cc_atom(
name = "TextWrapper_hdr",
hdrs = ["TextWrapper.h"],
visibility = ["//:__subpackages__"],
deps = [
":TextLine_hdr",
"//include/core:SkSpan_hdr",
],
)
generated_cc_atom(
name = "TextWrapper_src",
srcs = ["TextWrapper.cpp"],
visibility = ["//:__subpackages__"],
deps = [
":ParagraphImpl_hdr",
":TextWrapper_hdr",
],
)
generated_cc_atom(
name = "TypefaceFontProvider_src",
srcs = ["TypefaceFontProvider.cpp"],
visibility = ["//:__subpackages__"],
deps = [
"//include/core:SkFontMgr_hdr",
"//include/core:SkString_hdr",
"//include/core:SkTypeface_hdr",
"//modules/skparagraph/include:TypefaceFontProvider_hdr",
"//src/core:SkFontDescriptor_hdr",
],
)

View File

@ -0,0 +1,44 @@
load("//bazel:macros.bzl", "generated_cc_atom")
generated_cc_atom(
name = "SkParagraphTest_src",
srcs = ["SkParagraphTest.cpp"],
visibility = ["//:__subpackages__"],
deps = [
"//include/core:SkBitmap_hdr",
"//include/core:SkCanvas_hdr",
"//include/core:SkColor_hdr",
"//include/core:SkEncodedImageFormat_hdr",
"//include/core:SkFontMgr_hdr",
"//include/core:SkFontStyle_hdr",
"//include/core:SkImageEncoder_hdr",
"//include/core:SkPaint_hdr",
"//include/core:SkPoint_hdr",
"//include/core:SkRect_hdr",
"//include/core:SkRefCnt_hdr",
"//include/core:SkScalar_hdr",
"//include/core:SkSpan_hdr",
"//include/core:SkStream_hdr",
"//include/core:SkString_hdr",
"//include/core:SkTypeface_hdr",
"//include/core:SkTypes_hdr",
"//modules/skparagraph/include:DartTypes_hdr",
"//modules/skparagraph/include:FontCollection_hdr",
"//modules/skparagraph/include:ParagraphCache_hdr",
"//modules/skparagraph/include:ParagraphStyle_hdr",
"//modules/skparagraph/include:Paragraph_hdr",
"//modules/skparagraph/include:TextShadow_hdr",
"//modules/skparagraph/include:TextStyle_hdr",
"//modules/skparagraph/include:TypefaceFontProvider_hdr",
"//modules/skparagraph/src:ParagraphBuilderImpl_hdr",
"//modules/skparagraph/src:ParagraphImpl_hdr",
"//modules/skparagraph/src:Run_hdr",
"//modules/skparagraph/src:TextLine_hdr",
"//modules/skparagraph/utils:TestFontCollection_hdr",
"//src/core:SkOSFile_hdr",
"//src/utils:SkOSPath_hdr",
"//src/utils:SkShaperJSONWriter_hdr",
"//tests:Test_hdr",
"//tools:Resources_hdr",
],
)

View File

@ -0,0 +1,25 @@
load("//bazel:macros.bzl", "generated_cc_atom")
generated_cc_atom(
name = "TestFontCollection_hdr",
hdrs = ["TestFontCollection.h"],
visibility = ["//:__subpackages__"],
deps = [
"//modules/skparagraph/include:FontCollection_hdr",
"//modules/skparagraph/include:TypefaceFontProvider_hdr",
"//src/core:SkFontDescriptor_hdr",
],
)
generated_cc_atom(
name = "TestFontCollection_src",
srcs = ["TestFontCollection.cpp"],
visibility = ["//:__subpackages__"],
deps = [
":TestFontCollection_hdr",
"//modules/skparagraph/src:ParagraphImpl_hdr",
"//src/core:SkOSFile_hdr",
"//src/utils:SkUTF_hdr",
"//tools:Resources_hdr",
],
)

View File

@ -0,0 +1,12 @@
cc_library(
name = "skshaper",
hdrs = ["//modules/skshaper/include:hdrs"],
visibility = ["//:__subpackages__"],
deps = [
"//modules/skshaper/src:SkShaper_primitive_src",
"//modules/skshaper/src:SkShaper_src",
] + select({
"//bazel/common_config_settings:harfbuzz_shaper": ["//modules/skshaper/src:SkShaper_harfbuzz_src"],
"//conditions:default": [],
}),
)

View File

@ -1,5 +1,13 @@
load("//bazel:macros.bzl", "generated_cc_atom")
filegroup(
name = "hdrs",
srcs = [
"SkShaper.h",
],
visibility = ["//modules/skshaper:__pkg__"],
)
generated_cc_atom(
name = "SkShaper_hdr",
hdrs = ["SkShaper.h"],

View File

@ -45,6 +45,7 @@ generated_cc_atom(
"//src/core:SkLRUCache_hdr",
"//src/core:SkTDPQueue_hdr",
"//src/utils:SkUTF_hdr",
"//third_party:harfbuzz",
],
)

View File

@ -0,0 +1,10 @@
cc_library(
name = "skunicode",
hdrs = ["//modules/skunicode/include:hdrs"],
visibility = ["//:__subpackages__"],
deps = [
"//modules/skunicode/src:SkUnicode_icu_src",
"//modules/skunicode/src:SkUnicode_icu_builtin_src",
# TODO(kjlubick,bungeman) make runtime available for Android
],
)

View File

@ -0,0 +1,20 @@
load("//bazel:macros.bzl", "generated_cc_atom")
filegroup(
name = "hdrs",
srcs = [
"SkUnicode.h",
],
visibility = ["//modules/skunicode:__pkg__"],
)
generated_cc_atom(
name = "SkUnicode_hdr",
hdrs = ["SkUnicode.h"],
visibility = ["//:__subpackages__"],
deps = [
"//include/core:SkSpan_hdr",
"//include/core:SkTypes_hdr",
"//src/utils:SkUTF_hdr",
],
)

View File

@ -0,0 +1,47 @@
load("//bazel:macros.bzl", "generated_cc_atom")
generated_cc_atom(
name = "SkUnicode_icu_builtin_src",
srcs = ["SkUnicode_icu_builtin.cpp"],
visibility = ["//:__subpackages__"],
deps = [":SkUnicode_icu_hdr"],
)
generated_cc_atom(
name = "SkUnicode_icu_hdr",
hdrs = ["SkUnicode_icu.h"],
visibility = ["//:__subpackages__"],
deps = [
"//include/private:SkTemplates_hdr",
"//third_party:icu",
],
)
generated_cc_atom(
name = "SkUnicode_icu_runtime_src",
srcs = ["SkUnicode_icu_runtime.cpp"],
visibility = ["//:__subpackages__"],
deps = [
":SkUnicode_icu_hdr",
"//include/core:SkString_hdr",
"//include/core:SkTypes_hdr",
],
)
generated_cc_atom(
name = "SkUnicode_icu_src",
srcs = ["SkUnicode_icu.cpp"],
visibility = ["//:__subpackages__"],
deps = [
":SkUnicode_icu_hdr",
"//include/core:SkString_hdr",
"//include/private:SkMutex_hdr",
"//include/private:SkOnce_hdr",
"//include/private:SkTFitsIn_hdr",
"//include/private:SkTHash_hdr",
"//include/private:SkTemplates_hdr",
"//modules/skunicode/include:SkUnicode_hdr",
"//src/utils:SkUTF_hdr",
"//third_party:icu",
],
)

View File

@ -389,6 +389,7 @@ generated_cc_atom(
"//include/core:SkPaint_hdr",
"//include/effects:SkImageFilters_hdr",
"//include/effects:SkRuntimeEffect_hdr",
"//include/private:SkSpinlock_hdr",
"//src/core:SkImageFilter_Base_hdr",
"//src/core:SkReadBuffer_hdr",
"//src/core:SkRuntimeEffectPriv_hdr",

View File

@ -190,6 +190,7 @@ cc_library(
"//src/gpu/text:GrDistanceFieldAdjustTable_src",
"//src/gpu/text:GrSDFMaskFilter_src",
"//src/gpu/text:GrSDFTControl_src",
"//src/gpu/text:GrSlug_src",
"//src/gpu/text:GrStrikeCache_src",
"//src/gpu/text:GrTextBlobCache_src",
"//src/gpu/text:GrTextBlob_src",

View File

@ -186,6 +186,7 @@ generated_cc_atom(
"//include/core:SkColorFilter_hdr",
"//include/gpu:GrRecordingContext_hdr",
"//include/private:SkTemplates_hdr",
"//include/private/chromium:GrSlug_hdr",
"//src/core:SkMaskFilterBase_hdr",
"//src/core:SkMatrixProvider_hdr",
"//src/core:SkPaintPriv_hdr",
@ -201,6 +202,7 @@ generated_cc_atom(
"//src/gpu/effects:GrDistanceFieldGeoProc_hdr",
"//src/gpu/geometry:GrStyledShape_hdr",
"//src/gpu/ops:AtlasTextOp_hdr",
"//src/gpu/v1:Device_v1_hdr",
"//src/gpu/v1:SurfaceDrawContext_v1_hdr",
],
)

View File

@ -547,6 +547,7 @@ generated_cc_atom(
"//include/private:SkTemplates_hdr",
"//include/private:SkTo_hdr",
"//src/utils:SkCallableTraits_hdr",
"//third_party:harfbuzz",
],
)

View File

@ -293,6 +293,7 @@ generated_cc_atom(
hdrs = ["SkVMDebugInfo.h"],
visibility = ["//:__subpackages__"],
deps = [
"//include/core:SkPoint_hdr",
"//src/core:SkVM_hdr",
"//src/sksl/ir:SkSLType_hdr",
],

1256
third_party/BUILD.bazel vendored

File diff suppressed because it is too large Load Diff

View File

@ -29,8 +29,11 @@
"freetype/t1tables.h": "//third_party:freetype2",
"freetype/ftfntfmt.h": "//third_party:freetype2",
"hb-subset.h": "SK_GAZELLE_IGNORE TODO //third_party:harfbuzz",
"hb.h": "SK_GAZELLE_IGNORE TODO //third_party:harfbuzz",
"hb-subset.h": "//third_party:harfbuzz",
"hb.h": "//third_party:harfbuzz",
"SkLoadICU.h": "//third_party:icu",
"unicode/ubidi.h": "//third_party:icu",
"imgui.h": "SK_GAZELLE_IGNORE TODO //third_party:imgui",

View File

@ -261,7 +261,7 @@ if (skia_use_system_harfbuzz) {
"config-override.h",
]
# The following sources are explictly not used.
# The following sources are explicitly not used.
# They are referenced to aid in detecting previously uncategorized files.
unused_sources = [
"$_src/hb-coretext.cc",