diff --git a/BUILD.gn b/BUILD.gn index 4d8951881c..5e109ad6cd 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -1004,7 +1004,7 @@ optional("gpu") { cflags_objcc += [ "-fobjc-arc" ] } - if (is_debug) { + if (is_debug || skia_build_for_debugger) { public_defines += [ "SK_ENABLE_DUMP_GPU" ] } } @@ -1375,6 +1375,10 @@ skia_component("skia") { sources += skia_sksl_sources } + if (skia_build_for_debugger) { + defines += [ "SK_BUILD_FOR_DEBUGGER" ] + } + if (is_win) { sources += [ "src/ports/SkDebug_win.cpp", diff --git a/gn/skia.gni b/gn/skia.gni index d2acd24e04..89ec00e68e 100644 --- a/gn/skia.gni +++ b/gn/skia.gni @@ -127,6 +127,7 @@ declare_args() { skia_enable_direct3d_debug_layer = skia_enable_gpu_debug_layers skia_enable_metal_debug_info = skia_enable_gpu_debug_layers skia_use_vma = skia_use_vulkan + skia_build_for_debugger = false } declare_args() { diff --git a/modules/canvaskit/BUILD.gn b/modules/canvaskit/BUILD.gn index 9f279febcf..b4b8dbc23a 100644 --- a/modules/canvaskit/BUILD.gn +++ b/modules/canvaskit/BUILD.gn @@ -382,10 +382,4 @@ skia_wasm_lib("canvaskit") { if (!skia_canvaskit_enable_font) { defines += [ "CK_NO_FONTS" ] } - if (skia_canvaskit_enable_debugger) { - defines += [ - "SK_BUILD_FOR_DEBUGGER", - "SK_ENABLE_DUMP_GPU", - ] - } } diff --git a/modules/canvaskit/Makefile b/modules/canvaskit/Makefile index ac291559e9..925ed9b4c3 100644 --- a/modules/canvaskit/Makefile +++ b/modules/canvaskit/Makefile @@ -171,7 +171,7 @@ with_debugger: mkdir build cp ../../out/canvaskit_wasm_debug/canvaskit.js ./build/ cp ../../out/canvaskit_wasm_debug/canvaskit.wasm ./build/ - mkdir ${SKIA_INFRA_ROOT}/debugger-app/wasm_libs/local_build/ + - mkdir ${SKIA_INFRA_ROOT}/debugger-app/wasm_libs/local_build/ cp ./build/canvaskit.js ${SKIA_INFRA_ROOT}/debugger-app/wasm_libs/local_build/ cp ./build/canvaskit.wasm ${SKIA_INFRA_ROOT}/debugger-app/wasm_libs/local_build/ cp ./npm_build/types/index.d.ts ${SKIA_INFRA_ROOT}/debugger-app/wasm_libs/local_build/canvaskit.d.ts @@ -182,7 +182,7 @@ with_debugger_release: mkdir build cp ../../out/canvaskit_wasm/canvaskit.js ./build/ cp ../../out/canvaskit_wasm/canvaskit.wasm ./build/ - mkdir ${SKIA_INFRA_ROOT}/debugger-app/wasm_libs/local_build/ + - mkdir ${SKIA_INFRA_ROOT}/debugger-app/wasm_libs/local_build/ cp ./build/canvaskit.js ${SKIA_INFRA_ROOT}/debugger-app/wasm_libs/local_build/ cp ./build/canvaskit.wasm ${SKIA_INFRA_ROOT}/debugger-app/wasm_libs/local_build/ cp ./npm_build/types/index.d.ts ${SKIA_INFRA_ROOT}/debugger-app/wasm_libs/local_build/canvaskit.d.ts diff --git a/modules/canvaskit/compile.sh b/modules/canvaskit/compile.sh index 63ca5d2dd2..3f2e9feedc 100755 --- a/modules/canvaskit/compile.sh +++ b/modules/canvaskit/compile.sh @@ -229,6 +229,7 @@ echo "Compiling" skia_use_wuffs=true \ skia_use_zlib=true \ skia_enable_gpu=${ENABLE_GPU} \ + skia_build_for_debugger=${DEBUGGER_ENABLED} \ \ ${GN_SHAPER} \ ${GN_FONT} \