skia2/tools/debugger/BUILD.bazel
Kevin Lubick 9cb74e9079 [bazel] Compile gms for wasm and WebGL
PS 1 is re-generating existing BUILD.bazel files
PS 2 is generating BUILD.bazel files for tests/gms
PS 3+ makes modifications to build all of the gms and tests.

It is recommended to view this CL with just a diff between
PS 2 and the end, due to the large amount of generated changes
in PS 1 and 2.

We make a filegroup for the gms and tests because they need
to be compiled as one large blob in order for the registries
to work. Maybe in the future we will break these up, but at least
for WASM/JS, the overhead of starting a browser for each new
test would likely grind things to a halt, so we just group them
all together for now. It's also the most similar to what we
currently do.

In gm/BUILD.bazel and tests/BUILD.bazel, we add a cc_library
that encapsulates all of the deps of the tests, so we can
easily include that the build. These were discovered via
trial and error, not anything automatic or systematic.

The is_skia_dev_build config_setting is very similar to the
GN equivalent from which it was based.

The list of gms and tests to skip (e.g. which are incompatible
with WASM) was determined by building the wasm bundle:

modules/canvaskit$ make bazel_gms_release
tools/run-wasm-gm-tests$ make run_local_debug
# Don't forget to click the button on the screen after the
# browser loads

This way of invoking the tests will be replace soon with
`bazel test <something>`. As such, I didn't bother fully
documenting the current way.

Suggested review order:
 - modules/canvaskit/BUILD.bazel taking note that we always
   use profiling-funcs to make the stacktraces human readable.
 - gm/BUILD.bazel and tests/BUILD.bazel to see the lists of
   gms/tests. Notice the tests are roughly partitioned because
   we don't support things like vulkan/PDF in the wasm build
   and we will want a way to not build certain tests for
   certain configurations
 - tools/* noting some of the cc_libraries added to make
   dependencies easier to add when needed.
 - All other files.

Change-Id: I43059cd93c28af1c4c12b93d6ebd9c46a12d381f
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506256
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-02-09 18:56:17 +00:00

154 lines
4.4 KiB
Python

load("//bazel:macros.bzl", "generated_cc_atom")
cc_library(
name = "debugger",
visibility = ["//:__subpackages__"],
deps = [
":DebugCanvas_src",
":DebugLayerManager_src",
":DrawCommand_src",
":JsonWriteBuffer_src",
"//tools:SkSharingProc_src",
"//tools:UrlDataManager_src",
],
)
generated_cc_atom(
name = "DebugCanvas_hdr",
hdrs = ["DebugCanvas.h"],
visibility = ["//:__subpackages__"],
deps = [
":DrawCommand_hdr",
"//include/core:SkCanvasVirtualEnforcer_hdr",
"//include/core:SkCanvas_hdr",
"//include/core:SkPath_hdr",
"//include/core:SkString_hdr",
"//include/core:SkVertices_hdr",
"//include/pathops:SkPathOps_hdr",
"//include/private:SkTArray_hdr",
"//tools:UrlDataManager_hdr",
],
)
generated_cc_atom(
name = "DebugCanvas_src",
srcs = ["DebugCanvas.cpp"],
visibility = ["//:__subpackages__"],
deps = [
":DebugCanvas_hdr",
":DebugLayerManager_hdr",
":DrawCommand_hdr",
"//include/core:SkPaint_hdr",
"//include/core:SkPath_hdr",
"//include/core:SkPicture_hdr",
"//include/core:SkPoint_hdr",
"//include/core:SkTextBlob_hdr",
"//include/gpu:GrDirectContext_hdr",
"//include/utils:SkPaintFilterCanvas_hdr",
"//src/core:SkCanvasPriv_hdr",
"//src/core:SkRectPriv_hdr",
"//src/gpu:GrAuditTrail_hdr",
"//src/gpu:GrRecordingContextPriv_hdr",
"//src/utils:SkJSONWriter_hdr",
],
)
generated_cc_atom(
name = "DebugLayerManager_hdr",
hdrs = ["DebugLayerManager.h"],
visibility = ["//:__subpackages__"],
deps = [
":DebugCanvas_hdr",
"//include/core:SkImage_hdr",
"//include/private:SkTHash_hdr",
"//src/utils:SkJSONWriter_hdr",
],
)
generated_cc_atom(
name = "DebugLayerManager_src",
srcs = ["DebugLayerManager.cpp"],
visibility = ["//:__subpackages__"],
deps = [
":DebugCanvas_hdr",
":DebugLayerManager_hdr",
"//include/core:SkImageInfo_hdr",
"//include/core:SkImage_hdr",
"//include/core:SkPicture_hdr",
"//include/core:SkSurface_hdr",
"//include/private:SkTHash_hdr",
],
)
generated_cc_atom(
name = "DrawCommand_hdr",
hdrs = ["DrawCommand.h"],
visibility = ["//:__subpackages__"],
deps = [
"//include/core:SkBitmap_hdr",
"//include/core:SkCanvas_hdr",
"//include/core:SkFlattenable_hdr",
"//include/core:SkPath_hdr",
"//include/core:SkRRect_hdr",
"//include/core:SkRSXform_hdr",
"//include/core:SkRegion_hdr",
"//include/core:SkString_hdr",
"//include/core:SkVertices_hdr",
"//include/private:SkTDArray_hdr",
"//src/core:SkDrawShadowInfo_hdr",
"//src/core:SkTLazy_hdr",
"//src/utils:SkJSONWriter_hdr",
"//tools:UrlDataManager_hdr",
],
)
generated_cc_atom(
name = "DrawCommand_src",
srcs = ["DrawCommand.cpp"],
visibility = ["//:__subpackages__"],
deps = [
":DebugLayerManager_hdr",
":DrawCommand_hdr",
":JsonWriteBuffer_hdr",
"//include/core:SkColorFilter_hdr",
"//include/core:SkDrawable_hdr",
"//include/core:SkImageFilter_hdr",
"//include/core:SkPathEffect_hdr",
"//include/core:SkPicture_hdr",
"//include/core:SkTypeface_hdr",
"//include/effects:SkDashPathEffect_hdr",
"//include/encode:SkPngEncoder_hdr",
"//include/gpu:GrDirectContext_hdr",
"//include/private:SkShadowFlags_hdr",
"//include/private:SkTHash_hdr",
"//src/core:SkAutoMalloc_hdr",
"//src/core:SkCanvasPriv_hdr",
"//src/core:SkLatticeIter_hdr",
"//src/core:SkMaskFilterBase_hdr",
"//src/core:SkPaintDefaults_hdr",
"//src/core:SkPaintPriv_hdr",
"//src/core:SkReadBuffer_hdr",
"//src/core:SkRectPriv_hdr",
"//src/core:SkTextBlobPriv_hdr",
"//src/core:SkWriteBuffer_hdr",
"//src/image:SkImage_Base_hdr",
],
)
generated_cc_atom(
name = "JsonWriteBuffer_hdr",
hdrs = ["JsonWriteBuffer.h"],
visibility = ["//:__subpackages__"],
deps = ["//src/core:SkWriteBuffer_hdr"],
)
generated_cc_atom(
name = "JsonWriteBuffer_src",
srcs = ["JsonWriteBuffer.cpp"],
visibility = ["//:__subpackages__"],
deps = [
":DrawCommand_hdr",
":JsonWriteBuffer_hdr",
],
)