1 # Copyright 2016 Google Inc.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
6 import("gn/android_framework_defines.gni")
7 import("gn/shared_sources.gni")
10 import("//build/vulkan/config.gni")
13 if (!defined(is_skia_standalone)) {
14 is_skia_standalone = false
16 is_skia_dev_build = is_skia_standalone && !is_official_build
19 skia_use_angle = false
22 skia_use_fontconfig = is_linux
23 skia_use_freetype = is_android || is_fuchsia || is_linux
25 skia_use_icu = !is_fuchsia && !is_ios && !is_win # TODO: Windows
26 skia_use_libjpeg_turbo = true
27 skia_use_libpng = true
28 skia_use_libwebp = !is_fuchsia
31 skia_use_piex = !is_win
34 skia_android_serial = ""
35 skia_enable_android_framework_defines = false
36 skia_enable_discrete_gpu = true
37 skia_enable_effects = true
38 skia_enable_gpu = true
39 skia_enable_pdf = true
40 skia_enable_spirv_validation = is_skia_dev_build && is_debug
41 skia_enable_tools = is_skia_dev_build
42 skia_enable_vulkan_debug_layers = is_skia_dev_build && is_debug
43 skia_vulkan_sdk = getenv("VULKAN_SDK")
46 skia_use_dng_sdk = !is_fuchsia && skia_use_libjpeg_turbo && skia_use_zlib
47 skia_use_sfntly = skia_use_icu
50 skia_use_vulkan = defined(ndk_api) && ndk_api >= 24
51 } else if (is_fuchsia) {
52 skia_use_vulkan = fuchsia_use_vulkan
54 skia_use_vulkan = skia_vulkan_sdk != ""
58 if (skia_use_vulkan) {
60 skia_vulkan_headers = "$fuchsia_vulkan_sdk/include"
61 } else if (is_linux || is_win) {
62 skia_vulkan_headers = "$skia_vulkan_sdk/include"
64 # When buliding on Android we get the header via the NDK
65 skia_vulkan_headers = ""
68 skia_vulkan_headers = "third_party/vulkan"
72 # Our tools require static linking (they use non-exported symbols).
73 skia_enable_tools = skia_enable_tools && !is_component_build
75 fontmgr_android_enabled = skia_use_expat && skia_use_freetype
77 skia_public_includes = [
94 # Skia public API, generally provided by :skia.
95 config("skia_public") {
96 include_dirs = skia_public_includes
97 if (skia_vulkan_headers != "") {
98 include_dirs += [ skia_vulkan_headers ]
101 if (is_component_build) {
102 defines += [ "SKIA_DLL" ]
104 if (is_fuchsia || is_linux) {
105 defines += [ "SK_SAMPLES_FOR_X" ]
107 if (skia_enable_android_framework_defines) {
108 defines += android_framework_defines
110 if (!skia_enable_gpu) {
111 defines += [ "SK_SUPPORT_GPU=0" ]
115 # Skia internal APIs, used by Skia itself and a few test tools.
116 config("skia_private") {
117 visibility = [ ":*" ]
125 "src/effects/gradients",
142 defines = [ "SK_GAMMA_APPLY_TO_A8" ]
145 "SK_GAMMA_EXPONENT=1.4",
146 "SK_GAMMA_CONTRAST=0.0",
149 if (is_official_build || is_android) {
150 # TODO(bsalomon): it'd be nice to make Android normal.
151 defines += [ "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0" ]
155 if (skia_use_vulkan) {
156 if (skia_vulkan_sdk != "" && !is_android && !is_fuchsia) {
159 "$skia_vulkan_sdk/Bin",
160 "$skia_vulkan_sdk/Lib",
163 lib_dirs += [ "$skia_vulkan_sdk/lib/" ]
167 if (skia_enable_gpu) {
168 include_dirs += [ "src/gpu" ]
170 if (skia_use_angle) {
171 defines += [ "SK_ANGLE" ]
173 if (skia_enable_discrete_gpu) {
174 defines += [ "SK_ENABLE_DISCRETE_GPU" ]
178 # Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
179 config("skia_library") {
180 visibility = [ ":*" ]
181 defines = [ "SKIA_IMPLEMENTATION=1" ]
184 skia_library_configs = [
190 # Use for CPU-specific Skia code that needs particular compiler flags.
192 if (invoker.enabled) {
193 source_set(target_name) {
194 forward_variables_from(invoker, "*")
195 configs += skia_library_configs
198 # If not enabled, a phony empty target that swallows all otherwise unused variables.
199 source_set(target_name) {
200 forward_variables_from(invoker,
210 is_x86 = current_cpu == "x64" || current_cpu == "x86"
213 enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64"
214 sources = skia_opts.none_sources
219 enabled = current_cpu == "arm"
220 sources = skia_opts.armv7_sources
222 sources += skia_opts.neon_sources
228 enabled = current_cpu == "arm64"
229 sources = skia_opts.arm64_sources
234 enabled = current_cpu == "arm64"
235 sources = skia_opts.crc32_sources
236 cflags = [ "-march=armv8-a+crc" ]
241 sources = skia_opts.sse2_sources
243 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ]
245 cflags = [ "-msse2" ]
251 sources = skia_opts.ssse3_sources
253 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ]
255 cflags = [ "-mssse3" ]
261 sources = skia_opts.sse41_sources
263 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ]
265 cflags = [ "-msse4.1" ]
271 sources = skia_opts.sse42_sources
273 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ]
275 cflags = [ "-msse4.2" ]
281 sources = skia_opts.avx_sources
283 cflags = [ "/arch:AVX" ]
291 sources = skia_opts.hsw_sources
293 cflags = [ "/arch:AVX2" ]
305 # Any feature of Skia that requires third-party code should be optional and use this template.
306 template("optional") {
307 if (invoker.enabled) {
308 config(target_name + "_public") {
309 if (defined(invoker.public_defines)) {
310 defines = invoker.public_defines
313 source_set(target_name) {
314 forward_variables_from(invoker,
318 "sources_when_disabled",
321 all_dependent_configs = [ ":" + target_name + "_public" ]
322 configs += skia_library_configs
323 if (defined(invoker.configs_to_remove)) {
324 configs -= invoker.configs_to_remove
328 source_set(target_name) {
329 forward_variables_from(invoker,
336 "sources_when_disabled",
339 if (defined(invoker.sources_when_disabled)) {
340 sources = invoker.sources_when_disabled
342 configs += skia_library_configs
347 optional("effects") {
348 enabled = skia_enable_effects
350 skia_effects_sources + [ "src/ports/SkGlobalInitialization_default.cpp" ]
351 sources_when_disabled = [ "src/ports/SkGlobalInitialization_none.cpp" ]
354 optional("fontmgr_android") {
355 enabled = fontmgr_android_enabled
358 ":typeface_freetype",
359 "//third_party/expat",
362 "src/ports/SkFontMgr_android.cpp",
363 "src/ports/SkFontMgr_android_factory.cpp",
364 "src/ports/SkFontMgr_android_parser.cpp",
368 optional("fontmgr_custom") {
369 enabled = is_linux && skia_use_freetype && !skia_use_fontconfig
372 ":typeface_freetype",
375 "src/ports/SkFontMgr_custom.cpp",
376 "src/ports/SkFontMgr_custom.h",
377 "src/ports/SkFontMgr_custom_directory.cpp",
378 "src/ports/SkFontMgr_custom_directory_factory.cpp",
379 "src/ports/SkFontMgr_custom_embedded.cpp",
380 "src/ports/SkFontMgr_custom_empty.cpp",
384 optional("fontmgr_fontconfig") {
385 enabled = skia_use_freetype && skia_use_fontconfig
388 ":typeface_freetype",
389 "//third_party:fontconfig",
392 "src/ports/SkFontConfigInterface.cpp",
393 "src/ports/SkFontConfigInterface_direct.cpp",
394 "src/ports/SkFontConfigInterface_direct_factory.cpp",
395 "src/ports/SkFontMgr_FontConfigInterface.cpp",
396 "src/ports/SkFontMgr_fontconfig.cpp",
397 "src/ports/SkFontMgr_fontconfig_factory.cpp",
401 optional("fontmgr_fuchsia") {
402 enabled = is_fuchsia && skia_use_freetype
405 ":typeface_freetype",
408 "src/ports/SkFontMgr_custom.cpp",
409 "src/ports/SkFontMgr_custom_empty.cpp",
410 "src/ports/SkFontMgr_custom_empty_factory.cpp",
415 enabled = skia_enable_gpu
418 sources = skia_gpu_sources + skia_sksl_sources +
419 [ "src/gpu/gl/GrGLDefaultInterface_native.cpp" ]
421 # These paths need to be absolute to match the ones produced by shared_sources.gni.
422 sources -= get_path_info([
423 "src/gpu/gl/GrGLCreateNativeInterface_none.cpp",
424 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
429 sources += [ "src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp" ]
430 } else if (skia_use_egl) {
431 sources += [ "src/gpu/gl/egl/GrGLCreateNativeInterface_egl.cpp" ]
433 } else if (is_linux) {
434 sources += [ "src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp" ]
440 sources += [ "src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp" ]
442 sources += [ "src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp" ]
443 } else if (is_win && !is_winrt) {
444 sources += [ "src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp" ]
445 libs += [ "OpenGL32.lib" ]
447 sources += [ "src/gpu/gl/GrGLCreateNativeInterface_none.cpp" ]
450 if (skia_use_vulkan) {
451 public_defines += [ "SK_VULKAN" ]
452 sources += skia_vk_sources
453 if (skia_enable_vulkan_debug_layers) {
454 public_defines += [ "SK_ENABLE_VK_LAYERS" ]
457 if (skia_enable_spirv_validation) {
459 "//third_party/spirv-tools",
461 public_defines += [ "SK_ENABLE_SPIRV_VALIDATION" ]
466 enabled = skia_use_libjpeg_turbo
467 public_defines = [ "SK_HAS_JPEG_LIBRARY" ]
470 "//third_party/libjpeg-turbo:libjpeg",
473 "src/codec/SkJpegCodec.cpp",
474 "src/codec/SkJpegDecoderMgr.cpp",
475 "src/codec/SkJpegUtility.cpp",
476 "src/images/SkJPEGWriteUtility.cpp",
477 "src/images/SkJpegEncoder.cpp",
482 enabled = skia_use_zlib && skia_enable_pdf
483 public_defines = [ "SK_SUPPORT_PDF" ]
486 "//third_party/zlib",
488 sources = skia_pdf_sources
489 sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
491 if (skia_use_sfntly) {
492 deps += [ "//third_party/sfntly" ]
493 public_defines += [ "SK_PDF_USE_SFNTLY" ]
498 enabled = skia_use_libpng
499 public_defines = [ "SK_HAS_PNG_LIBRARY" ]
502 "//third_party/libpng",
505 "src/codec/SkIcoCodec.cpp",
506 "src/codec/SkPngCodec.cpp",
507 "src/images/SkPngEncoder.cpp",
512 enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo && skia_use_piex
513 public_defines = [ "SK_CODEC_DECODES_RAW" ]
516 "//third_party/dng_sdk",
517 "//third_party/libjpeg-turbo:libjpeg",
518 "//third_party/piex",
521 # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
523 configs_to_remove = [ "//gn:no_exceptions" ]
526 "src/codec/SkRawAdapterCodec.cpp",
527 "src/codec/SkRawCodec.cpp",
531 optional("typeface_freetype") {
532 enabled = skia_use_freetype
535 "//third_party/freetype2",
538 "src/ports/SkFontHost_FreeType.cpp",
539 "src/ports/SkFontHost_FreeType_common.cpp",
544 enabled = skia_use_libwebp
545 public_defines = [ "SK_HAS_WEBP_LIBRARY" ]
548 "//third_party/libwebp",
551 "src/codec/SkWebpAdapterCodec.cpp",
552 "src/codec/SkWebpCodec.cpp",
553 "src/images/SkWebpEncoder.cpp",
558 enabled = skia_use_expat
559 public_defines = [ "SK_XML" ]
562 "//third_party/expat",
565 "src/svg/SkSVGCanvas.cpp",
566 "src/svg/SkSVGDevice.cpp",
568 "src/xml/SkXMLParser.cpp",
569 "src/xml/SkXMLWriter.cpp",
574 public_configs = [ ":skia_public" ]
575 configs += skia_library_configs
585 ":fontmgr_fontconfig",
602 # This file (and all GN files in Skia) are designed to work with an
603 # empty sources assignment filter; we handle all that explicitly.
604 # We clear the filter here for clients who may have set up a global filter.
605 set_sources_assignment_filter([])
608 sources += skia_core_sources
609 sources += skia_utils_sources
610 sources += skia_xps_sources
612 "src/android/SkBitmapRegionCodec.cpp",
613 "src/android/SkBitmapRegionDecoder.cpp",
614 "src/codec/SkAndroidCodec.cpp",
615 "src/codec/SkBmpCodec.cpp",
616 "src/codec/SkBmpMaskCodec.cpp",
617 "src/codec/SkBmpRLECodec.cpp",
618 "src/codec/SkBmpStandardCodec.cpp",
619 "src/codec/SkCodec.cpp",
620 "src/codec/SkCodecImageGenerator.cpp",
621 "src/codec/SkGifCodec.cpp",
622 "src/codec/SkMaskSwizzler.cpp",
623 "src/codec/SkMasks.cpp",
624 "src/codec/SkSampledCodec.cpp",
625 "src/codec/SkSampler.cpp",
626 "src/codec/SkStreamBuffer.cpp",
627 "src/codec/SkSwizzler.cpp",
628 "src/codec/SkWbmpCodec.cpp",
629 "src/images/SkImageEncoder.cpp",
630 "src/ports/SkDiscardableMemory_none.cpp",
631 "src/ports/SkImageGenerator_skia.cpp",
632 "src/ports/SkMemory_malloc.cpp",
633 "src/ports/SkOSFile_stdio.cpp",
634 "src/sfnt/SkOTTable_name.cpp",
635 "src/sfnt/SkOTUtils.cpp",
636 "src/utils/mac/SkStream_mac.cpp",
637 "third_party/gif/SkGifImageReader.cpp",
644 "src/fonts/SkFontMgr_indirect.cpp",
645 "src/ports/SkDebug_win.cpp",
646 "src/ports/SkFontMgr_win_dw.cpp",
647 "src/ports/SkImageEncoder_WIC.cpp",
648 "src/ports/SkImageGeneratorWIC.cpp",
649 "src/ports/SkOSFile_win.cpp",
650 "src/ports/SkOSLibrary_win.cpp",
651 "src/ports/SkScalerContext_win_dw.cpp",
652 "src/ports/SkTLS_win.cpp",
653 "src/ports/SkTypeface_win_dw.cpp",
656 sources += [ "src/ports/SkFontHost_win.cpp" ]
659 sources += [ "src/ports/SkFontMgr_win_gdi_factory.cpp" ]
665 sources += [ "src/ports/SkFontMgr_win_dw_factory.cpp" ]
668 [ get_path_info("src/utils/SkThreadUtils_pthread.cpp", "abspath") ]
677 "src/ports/SkOSFile_posix.cpp",
678 "src/ports/SkOSLibrary_posix.cpp",
679 "src/ports/SkTLS_pthread.cpp",
685 get_path_info("src/utils/win/SkWGL.h", "abspath"),
686 get_path_info("src/utils/win/SkWGL_win.cpp", "abspath"),
691 deps += [ "//third_party/expat" ]
692 if (defined(ndk) && ndk != "") {
693 deps += [ "//third_party/cpu-features" ]
695 sources += [ "src/ports/SkDebug_android.cpp" ]
704 sources += [ "src/ports/SkDebug_stdio.cpp" ]
709 "src/ports/SkDebug_stdio.cpp",
710 "src/ports/SkFontHost_mac.cpp",
711 "src/ports/SkImageEncoder_CG.cpp",
712 "src/ports/SkImageGeneratorCG.cpp",
715 # AppKit symbols NSFontWeightXXX may be dlsym'ed.
717 "ApplicationServices.framework",
724 "src/ports/SkDebug_stdio.cpp",
725 "src/ports/SkFontHost_mac.cpp",
726 "src/ports/SkImageEncoder_CG.cpp",
727 "src/ports/SkImageGeneratorCG.cpp",
730 "CoreFoundation.framework",
731 "CoreGraphics.framework",
732 "CoreText.framework",
734 "MobileCoreServices.framework",
736 # UIKit symbols UIFontWeightXXX may be dlsym'ed.
742 sources += [ "src/ports/SkDebug_stdio.cpp" ]
746 # Targets guarded by skia_enable_tools may use //third_party freely.
747 if (skia_enable_tools) {
748 # Used by gn_to_bp.py to list our public include dirs.
749 source_set("public") {
750 configs += [ ":skia_public" ]
753 config("skia.h_config") {
754 include_dirs = [ "$target_gen_dir" ]
757 public_configs = [ ":skia.h_config" ]
758 skia_h = "$target_gen_dir/skia.h"
759 script = "gn/find_headers.py"
760 args = [ rebase_path(skia_h, root_build_dir) ] +
761 rebase_path(skia_public_includes) +
762 [ rebase_path("third_party/vulkan") ]
763 depfile = "$skia_h.deps"
769 if (skia_enable_gpu && target_cpu == "x64") {
770 # Our bots only have 64-bit libOSMesa installed.
771 # TODO: worth fixing?
772 executable("fiddle") {
779 "tools/fiddle/draw.cpp",
780 "tools/fiddle/fiddle_main.cpp",
791 if (skia_enable_gpu) {
792 source_set("public_headers_warnings_check") {
794 "tools/public_headers_warnings_check.cpp",
796 configs -= [ "//gn:warnings_except_public_headers" ]
804 template("test_lib") {
805 config(target_name + "_config") {
806 include_dirs = invoker.public_include_dirs
807 if (defined(invoker.public_defines)) {
808 defines = invoker.public_defines
811 source_set(target_name) {
812 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
814 ":" + target_name + "_config",
818 if (!defined(deps)) {
826 template("test_app") {
827 if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
828 shared_library("lib" + target_name) {
829 forward_variables_from(invoker, "*", [ "is_shared_library" ])
833 _executable = target_name
834 executable(_executable) {
835 forward_variables_from(invoker, "*", [ "is_shared_library" ])
839 if (is_android && skia_android_serial != "" && defined(_executable)) {
840 action("push_" + target_name) {
841 script = "gn/push_to_android.py"
845 _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
850 rebase_path("$root_build_dir/$_executable"),
859 test_lib("gpu_tool_utils") {
860 public_include_dirs = []
861 if (skia_enable_gpu) {
863 public_include_dirs += [ "tools/gpu" ]
867 "tools/gpu/GrContextFactory.cpp",
868 "tools/gpu/GrTest.cpp",
869 "tools/gpu/TestContext.cpp",
870 "tools/gpu/gl/GLTestContext.cpp",
871 "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp",
872 "tools/gpu/gl/debug/DebugGLTestContext.cpp",
873 "tools/gpu/gl/debug/GrBufferObj.cpp",
874 "tools/gpu/gl/debug/GrFrameBufferObj.cpp",
875 "tools/gpu/gl/debug/GrProgramObj.cpp",
876 "tools/gpu/gl/debug/GrShaderObj.cpp",
877 "tools/gpu/gl/debug/GrTextureObj.cpp",
878 "tools/gpu/gl/debug/GrTextureUnitObj.cpp",
879 "tools/gpu/gl/null/NullGLTestContext.cpp",
883 if (is_android || skia_use_egl) {
884 sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
886 sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
887 libs += [ "OpenGLES.framework" ]
888 } else if (is_linux) {
889 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
892 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
894 sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
901 if (skia_use_angle) {
902 deps += [ "//third_party/angle2" ]
903 sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
906 public_defines += [ "SK_MESA" ]
907 sources += [ "tools/gpu/gl/mesa/GLTestContext_mesa.cpp" ]
910 if (skia_use_vulkan) {
911 sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
913 libs += [ "vulkan-1.lib" ]
922 public_include_dirs = [ "tools/flags" ]
924 "tools/flags/SkCommandLineFlags.cpp",
927 test_lib("common_flags") {
928 public_include_dirs = [ "tools/flags" ]
930 "tools/flags/SkCommonFlags.cpp",
931 "tools/flags/SkCommonFlagsConfig.cpp",
939 test_lib("tool_utils") {
940 public_include_dirs = [
946 "tools/AndroidSkDebugToStdOut.cpp",
947 "tools/CrashHandler.cpp",
948 "tools/LsanSuppressions.cpp",
949 "tools/ProcStats.cpp",
950 "tools/Resources.cpp",
951 "tools/ThermalManager.cpp",
952 "tools/UrlDataManager.cpp",
953 "tools/debugger/SkDebugCanvas.cpp",
954 "tools/debugger/SkDrawCommand.cpp",
955 "tools/debugger/SkJsonWriteBuffer.cpp",
956 "tools/debugger/SkObjectParser.cpp",
957 "tools/picture_utils.cpp",
958 "tools/random_parse_path.cpp",
959 "tools/sk_tool_utils.cpp",
960 "tools/sk_tool_utils_font.cpp",
961 "tools/timer/Timer.cpp",
965 sources += [ "tools/ios_utils.m" ]
966 libs += [ "Foundation.framework" ]
971 "//third_party/libpng",
974 "//third_party/jsoncpp",
980 public_include_dirs = [ "gm" ]
990 import("gn/tests.gni")
992 public_include_dirs = [ "tests" ]
993 sources = tests_sources + pathops_tests_sources
994 if (!fontmgr_android_enabled) {
995 sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ]
998 ":experimental_svg_model",
1002 "//third_party/libpng",
1003 "//third_party/zlib",
1006 ":gpu_tool_utils", # Test.h #includes headers from this target.
1010 import("gn/bench.gni")
1012 public_include_dirs = [ "bench" ]
1013 sources = bench_sources
1023 test_lib("experimental_svg_model") {
1024 public_include_dirs = [ "experimental/svg/model" ]
1026 "experimental/svg/model/SkSVGAttribute.cpp",
1027 "experimental/svg/model/SkSVGAttributeParser.cpp",
1028 "experimental/svg/model/SkSVGCircle.cpp",
1029 "experimental/svg/model/SkSVGClipPath.cpp",
1030 "experimental/svg/model/SkSVGContainer.cpp",
1031 "experimental/svg/model/SkSVGDOM.cpp",
1032 "experimental/svg/model/SkSVGEllipse.cpp",
1033 "experimental/svg/model/SkSVGLine.cpp",
1034 "experimental/svg/model/SkSVGLinearGradient.cpp",
1035 "experimental/svg/model/SkSVGNode.cpp",
1036 "experimental/svg/model/SkSVGPath.cpp",
1037 "experimental/svg/model/SkSVGPoly.cpp",
1038 "experimental/svg/model/SkSVGRect.cpp",
1039 "experimental/svg/model/SkSVGRenderContext.cpp",
1040 "experimental/svg/model/SkSVGSVG.cpp",
1041 "experimental/svg/model/SkSVGShape.cpp",
1042 "experimental/svg/model/SkSVGStop.cpp",
1043 "experimental/svg/model/SkSVGTransformableNode.cpp",
1044 "experimental/svg/model/SkSVGValue.cpp",
1052 public_include_dirs = [ "include/views" ]
1054 "src/views/SkEvent.cpp",
1055 "src/views/SkEventSink.cpp",
1056 "src/views/SkOSMenu.cpp",
1057 "src/views/SkTagList.cpp",
1058 "src/views/SkTouchGesture.cpp",
1059 "src/views/SkView.cpp",
1060 "src/views/SkViewPriv.cpp",
1065 sources += [ "src/views/SkWindow.cpp" ]
1068 public_include_dirs += [ "src/views/unix" ]
1070 "src/views/unix/SkOSWindow_Unix.cpp",
1071 "src/views/unix/keysym2ucs.c",
1077 } else if (is_mac) {
1079 "src/views/mac/SkEventNotifier.mm",
1080 "src/views/mac/SkNSView.mm",
1081 "src/views/mac/SkOSWindow_Mac.mm",
1082 "src/views/mac/SkTextFieldCell.m",
1085 "QuartzCore.framework",
1087 "Foundation.framework",
1089 } else if (is_win) {
1090 sources += [ "src/views/win/SkOSWindow_win.cpp" ]
1092 if (skia_use_angle) {
1093 deps += [ "//third_party/angle2" ]
1099 public_include_dirs = []
1101 "src/utils/SkLua.cpp",
1102 "src/utils/SkLuaCanvas.cpp",
1105 "//third_party/lua",
1109 test_app("lua_app") {
1111 "tools/lua/lua_app.cpp",
1116 "//third_party/lua",
1120 test_app("lua_pictures") {
1122 "tools/lua/lua_pictures.cpp",
1129 "//third_party/lua",
1134 import("gn/samples.gni")
1135 test_lib("samples") {
1136 public_include_dirs = [ "samplecode" ]
1137 include_dirs = [ "experimental" ]
1138 sources = samples_sources + [
1139 "experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp",
1140 "experimental/SkSetPoly3To3.cpp",
1141 "experimental/SkSetPoly3To3_A.cpp",
1142 "experimental/SkSetPoly3To3_D.cpp",
1145 ":experimental_svg_model",
1154 sources += [ "samplecode/SampleLua.cpp" ]
1157 "//third_party/lua",
1165 "dm/DMJsonWriter.cpp",
1168 include_dirs = [ "tests" ]
1171 ":experimental_svg_model",
1178 "//third_party/jsoncpp",
1179 "//third_party/libpng",
1186 "tools/ok_dsts.cpp",
1187 "tools/ok_srcs.cpp",
1188 "tools/ok_test.cpp",
1189 "tools/ok_vias.cpp",
1199 if (!is_debug) { # I've benchmarked debug code once too many times...
1200 test_app("monobench") {
1202 "tools/monobench.cpp",
1211 test_app("nanobench") {
1213 "bench/nanobench.cpp",
1218 ":experimental_svg_model",
1224 "//third_party/jsoncpp",
1228 test_app("skpinfo") {
1230 "tools/skpinfo.cpp",
1238 if (is_linux || is_win || is_mac) {
1239 test_app("SampleApp") {
1241 "samplecode/SampleApp.cpp",
1242 "samplecode/SamplePictFile.cpp",
1245 sources += [ "src/views/mac/skia_mac.mm" ]
1246 } else if (is_win) {
1247 sources += [ "src/views/win/skia_win.cpp" ]
1248 } else if (is_linux) {
1249 sources += [ "src/views/unix/skia_unix.cpp" ]
1260 if (skia_use_angle) {
1261 deps += [ "//third_party/angle2" ]
1266 if (skia_enable_gpu) {
1267 test_app("skpbench") {
1269 "tools/skpbench/skpbench.cpp",
1280 # We can't yet build ICU on iOS or Windows.
1281 if (!is_ios && !is_win) {
1282 test_app("sktexttopdf-hb") {
1284 "tools/SkShaper_harfbuzz.cpp",
1285 "tools/using_skia_and_harfbuzz.cpp",
1289 "//third_party/harfbuzz",
1293 test_app("sktexttopdf") {
1295 "tools/SkShaper_primitive.cpp",
1296 "tools/using_skia_and_harfbuzz.cpp",
1303 test_app("create_flutter_test_images") {
1305 "tools/create_flutter_test_images.cpp",
1313 test_app("get_images_from_skps") {
1315 "tools/get_images_from_skps.cpp",
1320 "//third_party/jsoncpp",
1324 test_app("colorspaceinfo") {
1326 "tools/colorspaceinfo.cpp",
1336 test_app("skiaserve") {
1338 "tools/skiaserve/Request.cpp",
1339 "tools/skiaserve/Response.cpp",
1340 "tools/skiaserve/skiaserve.cpp",
1341 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
1342 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
1343 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
1344 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
1345 "tools/skiaserve/urlhandlers/DataHandler.cpp",
1346 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
1347 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
1348 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
1349 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
1350 "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
1351 "tools/skiaserve/urlhandlers/OpsHandler.cpp",
1352 "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
1353 "tools/skiaserve/urlhandlers/PostHandler.cpp",
1354 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
1355 "tools/skiaserve/urlhandlers/RootHandler.cpp",
1362 "//third_party/jsoncpp",
1363 "//third_party/libmicrohttpd",
1364 "//third_party/libpng",
1371 "fuzz/FilterFuzz.cpp",
1372 "fuzz/FuzzCanvas.cpp",
1373 "fuzz/FuzzDrawFunctions.cpp",
1374 "fuzz/FuzzGradients.cpp",
1375 "fuzz/FuzzParsePath.cpp",
1376 "fuzz/FuzzPathop.cpp",
1377 "fuzz/FuzzScaleToSides.cpp",
1388 test_app("pathops_unittest") {
1389 sources = pathops_tests_sources + [
1390 rebase_path("tests/skia_test.cpp"),
1391 rebase_path("tests/Test.cpp"),
1401 test_app("dump_record") {
1403 "tools/DumpRecord.cpp",
1404 "tools/dump_record.cpp",
1412 test_app("skdiff") {
1414 "tools/skdiff/skdiff.cpp",
1415 "tools/skdiff/skdiff_html.cpp",
1416 "tools/skdiff/skdiff_main.cpp",
1417 "tools/skdiff/skdiff_utils.cpp",
1425 test_app("skp_parser") {
1427 "tools/skp_parser.cpp",
1432 "//third_party/jsoncpp",
1436 if (skia_enable_gpu && (is_android || is_linux || is_win || is_mac)) {
1437 test_app("viewer") {
1438 is_shared_library = is_android
1440 "tools/viewer/GMSlide.cpp",
1441 "tools/viewer/ImageSlide.cpp",
1442 "tools/viewer/SKPSlide.cpp",
1443 "tools/viewer/SampleSlide.cpp",
1444 "tools/viewer/Viewer.cpp",
1445 "tools/viewer/sk_app/CommandSet.cpp",
1446 "tools/viewer/sk_app/GLWindowContext.cpp",
1447 "tools/viewer/sk_app/Window.cpp",
1453 "tools/viewer/sk_app/android/GLWindowContext_android.cpp",
1454 "tools/viewer/sk_app/android/RasterWindowContext_android.cpp",
1455 "tools/viewer/sk_app/android/Window_android.cpp",
1456 "tools/viewer/sk_app/android/main_android.cpp",
1457 "tools/viewer/sk_app/android/surface_glue_android.cpp",
1459 libs += [ "android" ]
1460 } else if (is_linux) {
1462 "tools/viewer/sk_app/unix/GLWindowContext_unix.cpp",
1463 "tools/viewer/sk_app/unix/RasterWindowContext_unix.cpp",
1464 "tools/viewer/sk_app/unix/Window_unix.cpp",
1465 "tools/viewer/sk_app/unix/main_unix.cpp",
1467 } else if (is_win) {
1469 "tools/viewer/sk_app/win/GLWindowContext_win.cpp",
1470 "tools/viewer/sk_app/win/RasterWindowContext_win.cpp",
1471 "tools/viewer/sk_app/win/Window_win.cpp",
1472 "tools/viewer/sk_app/win/main_win.cpp",
1474 } else if (is_mac) {
1476 "tools/viewer/sk_app/mac/GLWindowContext_mac.cpp",
1477 "tools/viewer/sk_app/mac/RasterWindowContext_mac.cpp",
1478 "tools/viewer/sk_app/mac/Window_mac.cpp",
1479 "tools/viewer/sk_app/mac/main_mac.cpp",
1483 if (skia_use_vulkan) {
1484 sources += [ "tools/viewer/sk_app/VulkanWindowContext.cpp" ]
1487 [ "tools/viewer/sk_app/android/VulkanWindowContext_android.cpp" ]
1488 } else if (is_linux) {
1489 sources += [ "tools/viewer/sk_app/unix/VulkanWindowContext_unix.cpp" ]
1490 libs += [ "X11-xcb" ]
1491 } else if (is_win) {
1492 sources += [ "tools/viewer/sk_app/win/VulkanWindowContext_win.cpp" ]
1505 "//third_party/imgui",
1506 "//third_party/jsoncpp",
1509 deps += [ "//third_party/native_app_glue" ]
1510 } else if (is_mac) {
1511 deps += [ "//third_party/libsdl" ]
1516 if (is_android && defined(ndk) && ndk != "") {
1519 "$ndk/$ndk_gdbserver",
1522 "$root_out_dir/gdbserver",
1527 if (skia_enable_gpu) {
1529 defines = [ "SKSL_STANDALONE" ]
1531 "src/sksl/SkSLMain.cpp",
1533 sources += skia_sksl_sources
1534 include_dirs = [ "src/sksl" ]