From 7f568e968e0442c5be1c7fbd73efcfaa8f40c78e Mon Sep 17 00:00:00 2001 From: Kevin Lubick Date: Tue, 15 Feb 2022 11:24:34 -0500 Subject: [PATCH] [bazel] Update to use emsdk 3.1.4 PS1 regenerates the BUILD.bazel files This allows us to use closure to minify the JS in canvaskit.js Change-Id: Ib8326d2e3a19cd2168b740b6946f9165a2810133 Bug: skia:12541 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/509177 Reviewed-by: Ben Wagner --- WORKSPACE.bazel | 10 ++++----- bazel/gcs_mirror/gcs_mirror.go | 2 +- experimental/graphite/src/BUILD.bazel | 12 ++++++++++- gm/BUILD.bazel | 17 +++------------ modules/canvaskit/BUILD.bazel | 12 ++++++----- src/core/BUILD.bazel | 7 +++++++ src/gpu/BUILD.bazel | 1 + src/gpu/text/BUILD.bazel | 30 +++++++++++++++++++++++++++ src/ports/BUILD.bazel | 4 ++++ src/shaders/BUILD.bazel | 1 + tests/BUILD.bazel | 23 ++++++++++++++++++++ tools/fonts/BUILD.bazel | 1 + tools/viewer/BUILD.bazel | 1 + 13 files changed, 95 insertions(+), 26 deletions(-) diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel index a13cce5b0c..25a69f2428 100644 --- a/WORKSPACE.bazel +++ b/WORKSPACE.bazel @@ -6,11 +6,11 @@ load("//toolchain:build_toolchain.bzl", "build_cpp_toolchain") # See https://github.com/emscripten-core/emsdk/tree/85d27a4a2a60d591613a305b14ae438c2bb3ce11/bazel#setup-instructions http_archive( name = "emsdk", - sha256 = "a2c5f3cf36525cf6a4b569f9d25500e3b2f7341c6e6779b54bcf4703b834202d", - strip_prefix = "emsdk-3.1.0/bazel", + sha256 = "7dc13d967705582e11ff62ae143425dbc63c38372f1a1b14f0cb681fda413714", + strip_prefix = "emsdk-3.1.4/bazel", urls = [ - "https://github.com/emscripten-core/emsdk/archive/refs/tags/3.1.0.tar.gz", - "https://storage.googleapis.com/skia-world-readable/bazel/a2c5f3cf36525cf6a4b569f9d25500e3b2f7341c6e6779b54bcf4703b834202d.tar.gz", + "https://github.com/emscripten-core/emsdk/archive/refs/tags/3.1.4.tar.gz", + "https://storage.googleapis.com/skia-world-readable/bazel/7dc13d967705582e11ff62ae143425dbc63c38372f1a1b14f0cb681fda413714.tar.gz", ], ) @@ -20,7 +20,7 @@ emsdk_deps() load("@emsdk//:emscripten_deps.bzl", emsdk_emscripten_deps = "emscripten_deps") -emsdk_emscripten_deps(emscripten_version = "3.1.0") +emsdk_emscripten_deps(emscripten_version = "3.1.4") build_cpp_toolchain( # Meant to run on amd64 linux and compile for amd64 linux. diff --git a/bazel/gcs_mirror/gcs_mirror.go b/bazel/gcs_mirror/gcs_mirror.go index 0e2e87a142..dda38deaf2 100644 --- a/bazel/gcs_mirror/gcs_mirror.go +++ b/bazel/gcs_mirror/gcs_mirror.go @@ -44,7 +44,7 @@ func main() { if (*url != "" && *sha256Hash == "") || (*url == "" && *sha256Hash != "") { flag.Usage() fatalf("Must set both of or non of --url and --sha256") - } else if !*jsonFromStdin { + } else if *url == "" && *sha256Hash == "" && !*jsonFromStdin { fatalf("Must specify --url and --sha256 or --json") } diff --git a/experimental/graphite/src/BUILD.bazel b/experimental/graphite/src/BUILD.bazel index 62716c907f..ea757157b8 100644 --- a/experimental/graphite/src/BUILD.bazel +++ b/experimental/graphite/src/BUILD.bazel @@ -288,6 +288,7 @@ generated_cc_atom( "//experimental/graphite/include:Recorder_hdr", "//experimental/graphite/src/geom:BoundsManager_hdr", "//experimental/graphite/src/geom:Shape_hdr", + "//include/core:SkPixmap_hdr", "//include/private:SkColorData_hdr", ], ) @@ -805,7 +806,10 @@ generated_cc_atom( name = "Resource_hdr", hdrs = ["Resource.h"], visibility = ["//:__subpackages__"], - deps = ["//include/core:SkTypes_hdr"], + deps = [ + ":ResourceTypes_hdr", + "//include/core:SkTypes_hdr", + ], ) generated_cc_atom( @@ -916,6 +920,7 @@ generated_cc_atom( visibility = ["//:__subpackages__"], deps = [ ":Task_hdr", + "//include/core:SkImageInfo_hdr", "//include/core:SkRect_hdr", "//include/core:SkRefCnt_hdr", ], @@ -927,10 +932,15 @@ generated_cc_atom( visibility = ["//:__subpackages__"], deps = [ ":Buffer_hdr", + ":Caps_hdr", ":CommandBuffer_hdr", ":Log_hdr", + ":RecorderPriv_hdr", + ":ResourceProvider_hdr", ":TextureProxy_hdr", ":Texture_hdr", ":UploadTask_hdr", + "//experimental/graphite/include:Recorder_hdr", + "//src/core:SkConvertPixels_hdr", ], ) diff --git a/gm/BUILD.bazel b/gm/BUILD.bazel index 37da9d0b16..98519b22ab 100644 --- a/gm/BUILD.bazel +++ b/gm/BUILD.bazel @@ -4838,6 +4838,8 @@ generated_cc_atom( "//include/core:SkCanvas_hdr", "//include/core:SkImage_hdr", "//include/core:SkPaint_hdr", + "//include/effects:SkGradientShader_hdr", + "//tools:Resources_hdr", ], ) @@ -7015,6 +7017,7 @@ generated_cc_atom( "//include/core:SkShader_hdr", "//include/core:SkSize_hdr", "//include/core:SkString_hdr", + "//include/core:SkTextBlob_hdr", "//include/core:SkTileMode_hdr", "//include/core:SkTypes_hdr", "//tools:ToolUtils_hdr", @@ -9551,20 +9554,6 @@ generated_cc_atom( ], ) -generated_cc_atom( - name = "xform_src", - srcs = ["xform.cpp"], - visibility = ["//:__subpackages__"], - deps = [ - ":gm_hdr", - "//experimental/xform:SkShape_hdr", - "//experimental/xform:SkXform_hdr", - "//include/core:SkCanvas_hdr", - "//include/core:SkPaint_hdr", - "//tools/timer:TimeUtils_hdr", - ], -) - generated_cc_atom( name = "ycbcrimage_src", srcs = ["ycbcrimage.cpp"], diff --git a/modules/canvaskit/BUILD.bazel b/modules/canvaskit/BUILD.bazel index 5d46a929b1..976acee98c 100644 --- a/modules/canvaskit/BUILD.bazel +++ b/modules/canvaskit/BUILD.bazel @@ -23,10 +23,6 @@ BASE_LINKOPTS = [ ] RELEASE_OPTS = [ - # Closure disabled until https://github.com/emscripten-core/emsdk/pull/941 is sorted out. - #"--closure 1", # Run the closure compiler - # pass the externs file in - #"--closure-args=--externs=modules/canvaskit/externs.js", "-sASSERTIONS=0", # Turn off assertions "-Oz", ] @@ -151,6 +147,12 @@ CK_DEFINES = [ ":enable_sksl_tracing_false": [], }) +CK_RELEASE_OPTS = [ + "--closure 1", # Run the closure compiler + # pass the externs file in + "--closure-args=--externs=$(location externs.js)", +] + CK_OPTS = BASE_LINKOPTS + [ "-sEXPORT_NAME=CanvasKitInit", "-sINITIAL_MEMORY=128MB", @@ -256,7 +258,7 @@ CK_OPTS = BASE_LINKOPTS + [ "--pre-js", "modules/canvaskit/debug.js", ], - "//conditions:default": RELEASE_OPTS + [ + "//conditions:default": RELEASE_OPTS + CK_RELEASE_OPTS + [ "--pre-js", "modules/canvaskit/release.js", ], diff --git a/src/core/BUILD.bazel b/src/core/BUILD.bazel index bacbbc65a4..a9f343e5cc 100644 --- a/src/core/BUILD.bazel +++ b/src/core/BUILD.bazel @@ -1464,6 +1464,8 @@ generated_cc_atom( hdrs = ["SkDescriptor.h"], visibility = ["//:__subpackages__"], deps = [ + ":SkBuffer_hdr", + ":SkFontPriv_hdr", ":SkScalerContext_hdr", "//include/private:SkMacros_hdr", "//include/private:SkNoncopyable_hdr", @@ -1477,8 +1479,12 @@ generated_cc_atom( deps = [ ":SkDescriptor_hdr", ":SkOpts_hdr", + ":SkReadBuffer_hdr", + ":SkWriteBuffer_hdr", "//include/core:SkTypes_hdr", "//include/private:SkTo_hdr", + "//include/private/chromium:SkChromeRemoteGlyphCache_hdr", + "//src/gpu:GrResourceProvider_hdr", ], ) @@ -5491,6 +5497,7 @@ generated_cc_atom( ":SkDraw_hdr", ":SkEnumerate_hdr", ":SkGlyphRun_hdr", + ":SkReadBuffer_hdr", ":SkScalerCache_hdr", ":SkStrikeCache_hdr", ":SkStrikeForGPU_hdr", diff --git a/src/gpu/BUILD.bazel b/src/gpu/BUILD.bazel index 7a843976c8..32dd1c193b 100644 --- a/src/gpu/BUILD.bazel +++ b/src/gpu/BUILD.bazel @@ -191,6 +191,7 @@ cc_library( "//src/gpu/tessellate/shaders:GrTessellationShader_src", "//src/gpu/text:GrAtlasManager_src", "//src/gpu/text:GrDistanceFieldAdjustTable_src", + "//src/gpu/text:GrGlyphVector_src", "//src/gpu/text:GrSDFMaskFilter_src", "//src/gpu/text:GrSDFTControl_src", "//src/gpu/text:GrSlug_src", diff --git a/src/gpu/text/BUILD.bazel b/src/gpu/text/BUILD.bazel index a9c15e628c..aa7346a790 100644 --- a/src/gpu/text/BUILD.bazel +++ b/src/gpu/text/BUILD.bazel @@ -160,6 +160,7 @@ generated_cc_atom( visibility = ["//:__subpackages__"], deps = [ ":GrAtlasManager_hdr", + ":GrGlyphVector_hdr", ":GrStrikeCache_hdr", ":GrTextBlob_hdr", "//include/core:SkColorFilter_hdr", @@ -211,3 +212,32 @@ generated_cc_atom( "//src/gpu/v1:SurfaceDrawContext_v1_hdr", ], ) + +generated_cc_atom( + name = "GrGlyphVector_hdr", + hdrs = ["GrGlyphVector.h"], + visibility = ["//:__subpackages__"], + deps = [ + ":GrStrikeCache_hdr", + "//include/core:SkSpan_hdr", + "//src/core:SkGlyphBuffer_hdr", + "//src/core:SkGlyph_hdr", + "//src/gpu:GrGlyph_hdr", + "//src/gpu:GrMeshDrawTarget_hdr", + "//src/gpu:GrSubRunAllocator_hdr", + ], +) + +generated_cc_atom( + name = "GrGlyphVector_src", + srcs = ["GrGlyphVector.cpp"], + visibility = ["//:__subpackages__"], + deps = [ + ":GrAtlasManager_hdr", + ":GrGlyphVector_hdr", + "//src/core:SkReadBuffer_hdr", + "//src/core:SkStrikeCache_hdr", + "//src/core:SkStrikeSpec_hdr", + "//src/core:SkWriteBuffer_hdr", + ], +) diff --git a/src/ports/BUILD.bazel b/src/ports/BUILD.bazel index 38694995a3..5a820b35fc 100644 --- a/src/ports/BUILD.bazel +++ b/src/ports/BUILD.bazel @@ -284,7 +284,9 @@ generated_cc_atom( "//include/core:SkBitmap_hdr", "//include/core:SkCanvas_hdr", "//include/core:SkColor_hdr", + "//include/core:SkDrawable_hdr", "//include/core:SkPath_hdr", + "//include/core:SkPictureRecorder_hdr", "//include/effects:SkGradientShader_hdr", "//include/private:SkColorData_hdr", "//include/private:SkTo_hdr", @@ -303,6 +305,7 @@ generated_cc_atom( "//include/core:SkBitmap_hdr", "//include/core:SkCanvas_hdr", "//include/core:SkData_hdr", + "//include/core:SkDrawable_hdr", "//include/core:SkFontMetrics_hdr", "//include/core:SkPath_hdr", "//include/core:SkStream_hdr", @@ -1054,6 +1057,7 @@ generated_cc_atom( ":SkTypeface_win_dw_hdr", "//include/codec:SkCodec_hdr", "//include/core:SkBitmap_hdr", + "//include/core:SkDrawable_hdr", "//include/core:SkFontMetrics_hdr", "//include/core:SkPath_hdr", "//include/core:SkTypes_hdr", diff --git a/src/shaders/BUILD.bazel b/src/shaders/BUILD.bazel index 3e2d1f361b..fa7db3e1e2 100644 --- a/src/shaders/BUILD.bazel +++ b/src/shaders/BUILD.bazel @@ -272,6 +272,7 @@ generated_cc_atom( "//include/private:SkImageInfoPriv_hdr", "//src/core:SkArenaAlloc_hdr", "//src/core:SkImagePriv_hdr", + "//src/core:SkMatrixPriv_hdr", "//src/core:SkMatrixProvider_hdr", "//src/core:SkMatrixUtils_hdr", "//src/core:SkPicturePriv_hdr", diff --git a/tests/BUILD.bazel b/tests/BUILD.bazel index 4f9fe28414..1c4add0709 100644 --- a/tests/BUILD.bazel +++ b/tests/BUILD.bazel @@ -1631,8 +1631,13 @@ generated_cc_atom( deps = [ ":Test_hdr", "//include/core:SkTypes_hdr", + "//include/private/chromium:SkChromeRemoteGlyphCache_hdr", "//src/core:SkDescriptor_hdr", + "//src/core:SkFontPriv_hdr", + "//src/core:SkReadBuffer_hdr", "//src/core:SkScalerContext_hdr", + "//src/core:SkWriteBuffer_hdr", + "//src/gpu:GrResourceProvider_hdr", ], ) @@ -7008,3 +7013,21 @@ generated_cc_atom( "//tools:ToolUtils_hdr", ], ) + +generated_cc_atom( + name = "GrGlyphVectorTest_src", + srcs = ["GrGlyphVectorTest.cpp"], + visibility = ["//:__subpackages__"], + deps = [ + ":Test_hdr", + "//src/core:SkGlyphBuffer_hdr", + "//src/core:SkGlyph_hdr", + "//src/core:SkReadBuffer_hdr", + "//src/core:SkStrikeCache_hdr", + "//src/core:SkStrikeSpec_hdr", + "//src/core:SkWriteBuffer_hdr", + "//src/gpu:GrResourceProvider_hdr", + "//src/gpu:GrSubRunAllocator_hdr", + "//src/gpu/text:GrGlyphVector_hdr", + ], +) diff --git a/tools/fonts/BUILD.bazel b/tools/fonts/BUILD.bazel index 7cab224224..aca61d0c16 100644 --- a/tools/fonts/BUILD.bazel +++ b/tools/fonts/BUILD.bazel @@ -30,6 +30,7 @@ generated_cc_atom( ":RandomScalerContext_hdr", "//include/core:SkBitmap_hdr", "//include/core:SkCanvas_hdr", + "//include/core:SkDrawable_hdr", "//include/core:SkPath_hdr", "//src/core:SkAdvancedTypefaceMetrics_hdr", "//src/core:SkGlyph_hdr", diff --git a/tools/viewer/BUILD.bazel b/tools/viewer/BUILD.bazel index f10c80ac4b..f1703240c5 100644 --- a/tools/viewer/BUILD.bazel +++ b/tools/viewer/BUILD.bazel @@ -455,6 +455,7 @@ generated_cc_atom( "//misc/cpp:imgui_stdlib_hdr", "//src/core:SkAutoPixmapStorage_hdr", "//src/core:SkColorSpacePriv_hdr", + "//src/core:SkGlyphRun_hdr", "//src/core:SkImagePriv_hdr", "//src/core:SkMD5_hdr", "//src/core:SkOSFile_hdr",