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")
9 if (!defined(is_skia_standalone)) {
10 is_skia_standalone = false
14 skia_use_angle = false
16 skia_use_fontconfig = is_linux
17 skia_use_freetype = is_android || is_fuchsia || is_linux
19 skia_use_icu = !is_fuchsia && !is_ios && !is_win # TODO: Windows
20 skia_use_libjpeg_turbo = true
21 skia_use_libpng = true
22 skia_use_libwebp = !is_fuchsia
25 skia_use_piex = !is_win
28 skia_android_serial = ""
29 skia_enable_android_framework_defines = false
30 skia_enable_discrete_gpu = true
31 skia_enable_effects = true
32 skia_enable_jumper = is_skia_standalone && !is_tvos # jumper does not yet support bitcode
33 skia_enable_gpu = true
34 skia_enable_pdf = true
35 skia_enable_tools = is_skia_standalone
36 skia_enable_vulkan_debug_layers = is_skia_standalone && is_debug
37 skia_vulkan_sdk = getenv("VULKAN_SDK")
41 !is_fuchsia && !is_win && skia_use_libjpeg_turbo && skia_use_zlib
42 skia_use_sfntly = skia_use_icu
45 skia_use_vulkan = defined(ndk_api) && ndk_api >= 24
47 skia_use_vulkan = skia_vulkan_sdk != ""
51 # Our tools require static linking (they use non-exported symbols).
52 skia_enable_tools = skia_enable_tools && !is_component_build
54 fontmgr_android_enabled = skia_use_expat && skia_use_freetype
56 skia_public_includes = [
72 # Skia public API, generally provided by :skia.
73 config("skia_public") {
74 include_dirs = skia_public_includes
76 if (is_component_build) {
77 defines += [ "SKIA_DLL" ]
79 if (is_fuchsia || is_linux) {
80 defines += [ "SK_SAMPLES_FOR_X" ]
82 if (skia_enable_android_framework_defines) {
83 defines += android_framework_defines
85 if (!skia_enable_gpu) {
86 defines += [ "SK_SUPPORT_GPU=0" ]
90 # Skia internal APIs, used by Skia itself and a few test tools.
91 config("skia_private") {
100 "src/effects/gradients",
119 "SK_GAMMA_APPLY_TO_A8",
124 "SK_GAMMA_EXPONENT=1.4",
125 "SK_GAMMA_CONTRAST=0.0",
128 if (is_official_build || is_android) {
129 # TODO(bsalomon): it'd be nice to make Android normal.
130 defines += [ "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0" ]
134 if (skia_use_vulkan) {
135 if (skia_vulkan_sdk != "" && !is_android) {
137 include_dirs += [ "$skia_vulkan_sdk/Include/" ]
138 lib_dirs += [ "$skia_vulkan_sdk/Bin" ]
140 include_dirs += [ "$skia_vulkan_sdk/include/" ]
141 lib_dirs += [ "$skia_vulkan_sdk/lib/" ]
145 libs += [ "vulkan-1.lib" ]
150 if (skia_enable_gpu) {
151 include_dirs += [ "src/gpu" ]
153 if (skia_use_angle) {
154 defines += [ "SK_ANGLE" ]
156 if (skia_enable_discrete_gpu) {
157 defines += [ "SK_ENABLE_DISCRETE_GPU" ]
161 # Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
162 config("skia_library") {
163 visibility = [ ":*" ]
164 defines = [ "SKIA_IMPLEMENTATION=1" ]
167 skia_library_configs = [
173 # Use for CPU-specific Skia code that needs particular compiler flags.
175 if (invoker.enabled) {
176 source_set(target_name) {
177 forward_variables_from(invoker, "*")
178 configs += skia_library_configs
181 # If not enabled, a phony empty target that swallows all otherwise unused variables.
182 source_set(target_name) {
183 forward_variables_from(invoker,
193 is_x86 = current_cpu == "x64" || current_cpu == "x86"
196 enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64"
197 sources = skia_opts.none_sources
202 enabled = current_cpu == "arm"
203 sources = skia_opts.armv7_sources
205 sources += skia_opts.neon_sources
211 enabled = current_cpu == "arm64"
212 sources = skia_opts.arm64_sources
217 enabled = current_cpu == "arm64"
218 sources = skia_opts.crc32_sources
219 cflags = [ "-march=armv8-a+crc" ]
224 sources = skia_opts.sse2_sources
226 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ]
228 cflags = [ "-msse2" ]
234 sources = skia_opts.ssse3_sources
236 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ]
238 cflags = [ "-mssse3" ]
244 sources = skia_opts.sse41_sources
246 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ]
248 cflags = [ "-msse4.1" ]
254 sources = skia_opts.sse42_sources
256 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ]
258 cflags = [ "-msse4.2" ]
264 sources = skia_opts.avx_sources
266 cflags = [ "/arch:AVX" ]
274 sources = skia_opts.hsw_sources
276 cflags = [ "/arch:AVX2" ]
288 # Any feature of Skia that requires third-party code should be optional and use this template.
289 template("optional") {
290 if (invoker.enabled) {
291 config(target_name + "_public") {
292 if (defined(invoker.public_defines)) {
293 defines = invoker.public_defines
296 source_set(target_name) {
297 forward_variables_from(invoker,
301 "sources_when_disabled",
304 all_dependent_configs = [ ":" + target_name + "_public" ]
305 configs += skia_library_configs
306 if (defined(invoker.configs_to_remove)) {
307 configs -= invoker.configs_to_remove
311 source_set(target_name) {
312 forward_variables_from(invoker,
319 "sources_when_disabled",
322 if (defined(invoker.sources_when_disabled)) {
323 sources = invoker.sources_when_disabled
325 configs += skia_library_configs
330 optional("effects") {
331 enabled = skia_enable_effects
333 skia_effects_sources + [ "src/ports/SkGlobalInitialization_default.cpp" ]
334 sources_when_disabled = [ "src/ports/SkGlobalInitialization_none.cpp" ]
337 optional("fontmgr_android") {
338 enabled = fontmgr_android_enabled
341 ":typeface_freetype",
342 "//third_party/expat",
345 "src/ports/SkFontMgr_android.cpp",
346 "src/ports/SkFontMgr_android_factory.cpp",
347 "src/ports/SkFontMgr_android_parser.cpp",
351 optional("fontmgr_custom") {
352 enabled = is_linux && skia_use_freetype && !skia_use_fontconfig
355 ":typeface_freetype",
358 "src/ports/SkFontMgr_custom.cpp",
359 "src/ports/SkFontMgr_custom.h",
360 "src/ports/SkFontMgr_custom_directory.cpp",
361 "src/ports/SkFontMgr_custom_directory_factory.cpp",
362 "src/ports/SkFontMgr_custom_embedded.cpp",
363 "src/ports/SkFontMgr_custom_empty.cpp",
367 optional("fontmgr_fontconfig") {
368 enabled = skia_use_freetype && skia_use_fontconfig
371 ":typeface_freetype",
372 "//third_party:fontconfig",
375 "src/ports/SkFontConfigInterface.cpp",
376 "src/ports/SkFontConfigInterface_direct.cpp",
377 "src/ports/SkFontConfigInterface_direct_factory.cpp",
378 "src/ports/SkFontMgr_FontConfigInterface.cpp",
379 "src/ports/SkFontMgr_fontconfig.cpp",
380 "src/ports/SkFontMgr_fontconfig_factory.cpp",
384 optional("fontmgr_fuchsia") {
385 enabled = is_fuchsia && skia_use_freetype
388 ":typeface_freetype",
391 "src/ports/SkFontMgr_custom.cpp",
392 "src/ports/SkFontMgr_custom_empty.cpp",
393 "src/ports/SkFontMgr_custom_empty_factory.cpp",
398 enabled = skia_enable_gpu
401 sources = skia_gpu_sources + skia_sksl_sources +
402 [ "src/gpu/gl/GrGLDefaultInterface_native.cpp" ]
404 # These paths need to be absolute to match the ones produced by shared_sources.gni.
405 sources -= get_path_info([
406 "src/gpu/gl/GrGLCreateNativeInterface_none.cpp",
407 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
412 sources += [ "src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp" ]
413 } else if (is_linux) {
414 sources += [ "src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp" ]
420 sources += [ "src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp" ]
422 sources += [ "src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp" ]
423 } else if (is_win && !is_winrt) {
424 sources += [ "src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp" ]
425 libs += [ "OpenGL32.lib" ]
427 sources += [ "src/gpu/gl/GrGLCreateNativeInterface_none.cpp" ]
430 if (skia_use_vulkan) {
431 public_defines += [ "SK_VULKAN" ]
432 sources += skia_vk_sources
433 if (skia_enable_vulkan_debug_layers) {
434 public_defines += [ "SK_ENABLE_VK_LAYERS" ]
440 enabled = skia_use_libjpeg_turbo
441 public_defines = [ "SK_HAS_JPEG_LIBRARY" ]
444 "//third_party/libjpeg-turbo:libjpeg",
447 "src/codec/SkJpegCodec.cpp",
448 "src/codec/SkJpegDecoderMgr.cpp",
449 "src/codec/SkJpegUtility.cpp",
450 "src/images/SkJPEGImageEncoder.cpp",
451 "src/images/SkJPEGWriteUtility.cpp",
456 enabled = skia_use_zlib && skia_enable_pdf
457 public_defines = [ "SK_SUPPORT_PDF" ]
460 "//third_party/zlib",
462 sources = skia_pdf_sources
463 sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
465 if (skia_use_sfntly) {
466 deps += [ "//third_party/sfntly" ]
467 public_defines += [ "SK_PDF_USE_SFNTLY" ]
472 enabled = skia_use_libpng
473 public_defines = [ "SK_HAS_PNG_LIBRARY" ]
476 "//third_party/libpng",
479 "src/codec/SkIcoCodec.cpp",
480 "src/codec/SkPngCodec.cpp",
481 "src/images/SkPNGImageEncoder.cpp",
486 enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo && skia_use_piex
487 public_defines = [ "SK_CODEC_DECODES_RAW" ]
490 "//third_party/dng_sdk",
491 "//third_party/libjpeg-turbo:libjpeg",
492 "//third_party/piex",
495 # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
497 configs_to_remove = [ "//gn:no_exceptions" ]
500 "src/codec/SkRawAdapterCodec.cpp",
501 "src/codec/SkRawCodec.cpp",
506 enabled = skia_enable_jumper
507 public_defines = [ "SK_JUMPER" ]
509 "src/jumper/SkJumper.cpp",
510 "src/jumper/SkJumper_stages.cpp",
512 if (is_win && target_cpu == "x64") {
513 sources += [ "src/jumper/SkJumper_generated_win.S" ]
514 } else if (!is_win) {
515 sources += [ "src/jumper/SkJumper_generated.S" ]
519 optional("typeface_freetype") {
520 enabled = skia_use_freetype
523 "//third_party/freetype2",
526 "src/ports/SkFontHost_FreeType.cpp",
527 "src/ports/SkFontHost_FreeType_common.cpp",
532 enabled = skia_use_libwebp
533 public_defines = [ "SK_HAS_WEBP_LIBRARY" ]
536 "//third_party/libwebp",
539 "src/codec/SkWebpAdapterCodec.cpp",
540 "src/codec/SkWebpCodec.cpp",
541 "src/images/SkWEBPImageEncoder.cpp",
546 enabled = skia_use_expat
547 public_defines = [ "SK_XML" ]
550 "//third_party/expat",
553 "src/svg/SkSVGCanvas.cpp",
554 "src/svg/SkSVGDevice.cpp",
556 "src/xml/SkXMLParser.cpp",
557 "src/xml/SkXMLWriter.cpp",
562 public_configs = [ ":skia_public" ]
563 configs += skia_library_configs
573 ":fontmgr_fontconfig",
591 # This file (and all GN files in Skia) are designed to work with an
592 # empty sources assignment filter; we handle all that explicitly.
593 # We clear the filter here for clients who may have set up a global filter.
594 set_sources_assignment_filter([])
597 sources += skia_core_sources
598 sources += skia_utils_sources
599 sources += skia_xps_sources
601 "src/android/SkBitmapRegionCodec.cpp",
602 "src/android/SkBitmapRegionDecoder.cpp",
603 "src/codec/SkAndroidCodec.cpp",
604 "src/codec/SkBmpCodec.cpp",
605 "src/codec/SkBmpMaskCodec.cpp",
606 "src/codec/SkBmpRLECodec.cpp",
607 "src/codec/SkBmpStandardCodec.cpp",
608 "src/codec/SkCodec.cpp",
609 "src/codec/SkCodecImageGenerator.cpp",
610 "src/codec/SkGifCodec.cpp",
611 "src/codec/SkMaskSwizzler.cpp",
612 "src/codec/SkMasks.cpp",
613 "src/codec/SkSampledCodec.cpp",
614 "src/codec/SkSampler.cpp",
615 "src/codec/SkStreamBuffer.cpp",
616 "src/codec/SkSwizzler.cpp",
617 "src/codec/SkWbmpCodec.cpp",
618 "src/images/SkImageEncoder.cpp",
619 "src/ports/SkDiscardableMemory_none.cpp",
620 "src/ports/SkImageGenerator_skia.cpp",
621 "src/ports/SkMemory_malloc.cpp",
622 "src/ports/SkOSFile_stdio.cpp",
623 "src/sfnt/SkOTTable_name.cpp",
624 "src/sfnt/SkOTUtils.cpp",
625 "src/utils/mac/SkStream_mac.cpp",
626 "third_party/etc1/etc1.cpp",
627 "third_party/gif/SkGifImageReader.cpp",
634 "src/fonts/SkFontMgr_indirect.cpp",
635 "src/ports/SkDebug_win.cpp",
636 "src/ports/SkFontMgr_win_dw.cpp",
637 "src/ports/SkImageEncoder_WIC.cpp",
638 "src/ports/SkImageGeneratorWIC.cpp",
639 "src/ports/SkOSFile_win.cpp",
640 "src/ports/SkOSLibrary_win.cpp",
641 "src/ports/SkScalerContext_win_dw.cpp",
642 "src/ports/SkTLS_win.cpp",
643 "src/ports/SkTypeface_win_dw.cpp",
646 sources += [ "src/ports/SkFontHost_win.cpp" ]
649 sources += [ "src/ports/SkFontMgr_win_gdi_factory.cpp" ]
655 sources += [ "src/ports/SkFontMgr_win_dw_factory.cpp" ]
658 [ get_path_info("src/utils/SkThreadUtils_pthread.cpp", "abspath") ]
667 "src/ports/SkOSFile_posix.cpp",
668 "src/ports/SkOSLibrary_posix.cpp",
669 "src/ports/SkTLS_pthread.cpp",
675 get_path_info("src/utils/win/SkWGL.h", "abspath"),
676 get_path_info("src/utils/win/SkWGL_win.cpp", "abspath"),
681 deps += [ "//third_party/expat" ]
682 if (is_skia_standalone && ndk != "") {
683 deps += [ "//third_party/cpu-features" ]
685 sources += [ "src/ports/SkDebug_android.cpp" ]
694 sources += [ "src/ports/SkDebug_stdio.cpp" ]
699 "src/ports/SkDebug_stdio.cpp",
700 "src/ports/SkFontHost_mac.cpp",
701 "src/ports/SkImageEncoder_CG.cpp",
702 "src/ports/SkImageGeneratorCG.cpp",
705 "ApplicationServices.framework",
712 "src/ports/SkDebug_stdio.cpp",
713 "src/ports/SkFontHost_mac.cpp",
714 "src/ports/SkImageEncoder_CG.cpp",
715 "src/ports/SkImageGeneratorCG.cpp",
718 "CoreFoundation.framework",
719 "CoreGraphics.framework",
720 "CoreText.framework",
722 "MobileCoreServices.framework",
727 sources += [ "src/ports/SkDebug_stdio.cpp" ]
731 # Targets guarded by skia_enable_tools may use //third_party freely.
732 if (skia_enable_tools) {
733 # Used by gn_to_bp.py to list our public include dirs.
734 source_set("public") {
735 configs += [ ":skia_public" ]
738 config("skia.h_config") {
739 include_dirs = [ "$target_gen_dir" ]
742 public_configs = [ ":skia.h_config" ]
743 skia_h = "$target_gen_dir/skia.h"
744 script = "gn/find_headers.py"
745 args = [ rebase_path(skia_h, root_build_dir) ] +
746 rebase_path(skia_public_includes)
747 depfile = "$skia_h.deps"
753 if (skia_enable_gpu && target_cpu == "x64") {
754 # Our bots only have 64-bit libOSMesa installed.
755 # TODO: worth fixing?
756 executable("fiddle") {
763 "tools/fiddle/draw.cpp",
764 "tools/fiddle/fiddle_main.cpp",
773 if (skia_enable_gpu) {
774 source_set("public_headers_warnings_check") {
776 "tools/public_headers_warnings_check.cpp",
778 configs -= [ "//gn:warnings_except_public_headers" ]
786 template("test_lib") {
787 config(target_name + "_config") {
788 include_dirs = invoker.public_include_dirs
789 if (defined(invoker.public_defines)) {
790 defines = invoker.public_defines
793 source_set(target_name) {
794 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
796 ":" + target_name + "_config",
800 if (!defined(deps)) {
808 template("test_app") {
809 if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
810 shared_library("lib" + target_name) {
811 forward_variables_from(invoker, "*", [ "is_shared_library" ])
815 _executable = target_name
816 executable(_executable) {
817 forward_variables_from(invoker, "*", [ "is_shared_library" ])
821 if (is_android && skia_android_serial != "" && defined(_executable)) {
822 action("push_" + target_name) {
823 script = "gn/push_to_android.py"
827 _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
832 rebase_path("$root_build_dir/$_executable"),
841 test_lib("gpu_tool_utils") {
842 public_include_dirs = []
843 if (skia_enable_gpu) {
845 public_include_dirs += [ "tools/gpu" ]
849 "tools/gpu/GrContextFactory.cpp",
850 "tools/gpu/GrTest.cpp",
851 "tools/gpu/TestContext.cpp",
852 "tools/gpu/gl/GLTestContext.cpp",
853 "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp",
854 "tools/gpu/gl/debug/DebugGLTestContext.cpp",
855 "tools/gpu/gl/debug/GrBufferObj.cpp",
856 "tools/gpu/gl/debug/GrFrameBufferObj.cpp",
857 "tools/gpu/gl/debug/GrProgramObj.cpp",
858 "tools/gpu/gl/debug/GrShaderObj.cpp",
859 "tools/gpu/gl/debug/GrTextureObj.cpp",
860 "tools/gpu/gl/debug/GrTextureUnitObj.cpp",
861 "tools/gpu/gl/null/NullGLTestContext.cpp",
866 sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
868 sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
869 libs += [ "OpenGLES.framework" ]
870 } else if (is_linux) {
871 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
874 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
876 sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
883 if (skia_use_angle) {
884 deps += [ "//third_party/angle2" ]
885 sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
888 public_defines += [ "SK_MESA" ]
889 sources += [ "tools/gpu/gl/mesa/GLTestContext_mesa.cpp" ]
892 if (skia_use_vulkan) {
893 sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
899 public_include_dirs = [ "tools/flags" ]
901 "tools/flags/SkCommandLineFlags.cpp",
904 test_lib("common_flags") {
905 public_include_dirs = [ "tools/flags" ]
907 "tools/flags/SkCommonFlags.cpp",
908 "tools/flags/SkCommonFlagsConfig.cpp",
916 test_lib("tool_utils") {
917 public_include_dirs = [
923 "src/utils/SkMultiPictureDocumentReader.cpp", # TODO(halcanary): move to tools?
924 "tools/AndroidSkDebugToStdOut.cpp",
925 "tools/CrashHandler.cpp",
926 "tools/LsanSuppressions.cpp",
927 "tools/ProcStats.cpp",
928 "tools/Resources.cpp",
929 "tools/ThermalManager.cpp",
930 "tools/UrlDataManager.cpp",
931 "tools/debugger/SkDebugCanvas.cpp",
932 "tools/debugger/SkDrawCommand.cpp",
933 "tools/debugger/SkJsonWriteBuffer.cpp",
934 "tools/debugger/SkObjectParser.cpp",
935 "tools/picture_utils.cpp",
936 "tools/random_parse_path.cpp",
937 "tools/sk_tool_utils.cpp",
938 "tools/sk_tool_utils_font.cpp",
939 "tools/timer/Timer.cpp",
943 sources += [ "tools/ios_utils.m" ]
944 libs += [ "Foundation.framework" ]
949 "//third_party/libpng",
952 "//third_party/jsoncpp",
958 public_include_dirs = [ "gm" ]
968 import("gn/tests.gni")
970 public_include_dirs = [ "tests" ]
971 sources = tests_sources + pathops_tests_sources
972 if (!fontmgr_android_enabled) {
973 sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ]
976 ":experimental_svg_model",
981 "//third_party/libpng",
982 "//third_party/zlib",
986 import("gn/bench.gni")
988 public_include_dirs = [ "bench" ]
989 sources = bench_sources
999 test_lib("experimental_svg_model") {
1000 public_include_dirs = [ "experimental/svg/model" ]
1002 "experimental/svg/model/SkSVGAttribute.cpp",
1003 "experimental/svg/model/SkSVGAttributeParser.cpp",
1004 "experimental/svg/model/SkSVGCircle.cpp",
1005 "experimental/svg/model/SkSVGClipPath.cpp",
1006 "experimental/svg/model/SkSVGContainer.cpp",
1007 "experimental/svg/model/SkSVGDOM.cpp",
1008 "experimental/svg/model/SkSVGEllipse.cpp",
1009 "experimental/svg/model/SkSVGLine.cpp",
1010 "experimental/svg/model/SkSVGLinearGradient.cpp",
1011 "experimental/svg/model/SkSVGNode.cpp",
1012 "experimental/svg/model/SkSVGPath.cpp",
1013 "experimental/svg/model/SkSVGPoly.cpp",
1014 "experimental/svg/model/SkSVGRect.cpp",
1015 "experimental/svg/model/SkSVGRenderContext.cpp",
1016 "experimental/svg/model/SkSVGSVG.cpp",
1017 "experimental/svg/model/SkSVGShape.cpp",
1018 "experimental/svg/model/SkSVGStop.cpp",
1019 "experimental/svg/model/SkSVGTransformableNode.cpp",
1020 "experimental/svg/model/SkSVGValue.cpp",
1028 public_include_dirs = [ "include/views" ]
1030 "src/views/SkEvent.cpp",
1031 "src/views/SkEventSink.cpp",
1032 "src/views/SkOSMenu.cpp",
1033 "src/views/SkTagList.cpp",
1034 "src/views/SkTouchGesture.cpp",
1035 "src/views/SkView.cpp",
1036 "src/views/SkViewPriv.cpp",
1041 sources += [ "src/views/SkWindow.cpp" ]
1044 public_include_dirs += [ "src/views/unix" ]
1046 "src/views/unix/SkOSWindow_Unix.cpp",
1047 "src/views/unix/keysym2ucs.c",
1053 } else if (is_mac) {
1055 "src/views/mac/SkEventNotifier.mm",
1056 "src/views/mac/SkNSView.mm",
1057 "src/views/mac/SkOSWindow_Mac.mm",
1058 "src/views/mac/SkTextFieldCell.m",
1061 "QuartzCore.framework",
1063 "Foundation.framework",
1065 } else if (is_win) {
1066 sources += [ "src/views/win/SkOSWindow_win.cpp" ]
1068 if (skia_use_angle) {
1069 deps += [ "//third_party/angle2" ]
1075 public_include_dirs = []
1077 "src/utils/SkLua.cpp",
1078 "src/utils/SkLuaCanvas.cpp",
1081 "//third_party/lua",
1085 test_app("lua_app") {
1087 "tools/lua/lua_app.cpp",
1092 "//third_party/lua",
1096 test_app("lua_pictures") {
1098 "tools/lua/lua_pictures.cpp",
1105 "//third_party/lua",
1110 import("gn/samples.gni")
1111 test_lib("samples") {
1112 public_include_dirs = [ "samplecode" ]
1113 include_dirs = [ "experimental" ]
1114 sources = samples_sources + [
1115 "experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp",
1116 "experimental/SkSetPoly3To3.cpp",
1117 "experimental/SkSetPoly3To3_A.cpp",
1118 "experimental/SkSetPoly3To3_D.cpp",
1121 ":experimental_svg_model",
1129 sources += [ "samplecode/SampleLua.cpp" ]
1132 "//third_party/lua",
1140 "dm/DMJsonWriter.cpp",
1143 include_dirs = [ "tests" ]
1146 ":experimental_svg_model",
1153 "//third_party/jsoncpp",
1154 "//third_party/libpng",
1158 if (!is_debug) { # I've benchmarked debug code once too many times...
1159 test_app("monobench") {
1161 "tools/monobench.cpp",
1170 test_app("nanobench") {
1172 "bench/nanobench.cpp",
1177 ":experimental_svg_model",
1183 "//third_party/jsoncpp",
1187 test_app("skpinfo") {
1189 "tools/skpinfo.cpp",
1197 if (is_linux || is_win || is_mac) {
1198 test_app("SampleApp") {
1200 "samplecode/SampleApp.cpp",
1201 "samplecode/SamplePictFile.cpp",
1204 sources += [ "src/views/mac/skia_mac.mm" ]
1205 } else if (is_win) {
1206 sources += [ "src/views/win/skia_win.cpp" ]
1207 } else if (is_linux) {
1208 sources += [ "src/views/unix/skia_unix.cpp" ]
1219 if (skia_use_angle) {
1220 deps += [ "//third_party/angle2" ]
1225 if (skia_enable_gpu) {
1226 test_app("skpbench") {
1228 "tools/skpbench/skpbench.cpp",
1239 # We can't yet build ICU on iOS or Windows.
1240 if (!is_ios && !is_win) {
1241 test_app("sktexttopdf-hb") {
1243 "tools/SkShaper_harfbuzz.cpp",
1244 "tools/using_skia_and_harfbuzz.cpp",
1248 "//third_party/harfbuzz",
1252 test_app("sktexttopdf") {
1254 "tools/SkShaper_primitive.cpp",
1255 "tools/using_skia_and_harfbuzz.cpp",
1262 test_app("get_images_from_skps") {
1264 "tools/get_images_from_skps.cpp",
1269 "//third_party/jsoncpp",
1273 test_app("colorspaceinfo") {
1275 "tools/colorspaceinfo.cpp",
1285 test_app("skiaserve") {
1287 "tools/skiaserve/Request.cpp",
1288 "tools/skiaserve/Response.cpp",
1289 "tools/skiaserve/skiaserve.cpp",
1290 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
1291 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
1292 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
1293 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
1294 "tools/skiaserve/urlhandlers/DataHandler.cpp",
1295 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
1296 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
1297 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
1298 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
1299 "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
1300 "tools/skiaserve/urlhandlers/OpsHandler.cpp",
1301 "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
1302 "tools/skiaserve/urlhandlers/PostHandler.cpp",
1303 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
1304 "tools/skiaserve/urlhandlers/RootHandler.cpp",
1311 "//third_party/jsoncpp",
1312 "//third_party/libmicrohttpd",
1313 "//third_party/libpng",
1320 "fuzz/FilterFuzz.cpp",
1321 "fuzz/FuzzCanvas.cpp",
1322 "fuzz/FuzzDrawFunctions.cpp",
1323 "fuzz/FuzzGradients.cpp",
1324 "fuzz/FuzzParsePath.cpp",
1325 "fuzz/FuzzPathop.cpp",
1326 "fuzz/FuzzScaleToSides.cpp",
1336 test_app("pathops_unittest") {
1337 sources = pathops_tests_sources + [
1338 rebase_path("tests/skia_test.cpp"),
1339 rebase_path("tests/Test.cpp"),
1349 test_app("dump_record") {
1351 "tools/DumpRecord.cpp",
1352 "tools/dump_record.cpp",
1360 test_app("skdiff") {
1362 "tools/skdiff/skdiff.cpp",
1363 "tools/skdiff/skdiff_html.cpp",
1364 "tools/skdiff/skdiff_main.cpp",
1365 "tools/skdiff/skdiff_utils.cpp",
1373 test_app("skp_parser") {
1375 "tools/skp_parser.cpp",
1380 "//third_party/jsoncpp",
1384 if (skia_enable_gpu && (is_android || is_linux || is_win || is_mac)) {
1385 test_app("viewer") {
1386 is_shared_library = is_android
1388 "tools/viewer/GMSlide.cpp",
1389 "tools/viewer/ImageSlide.cpp",
1390 "tools/viewer/SKPSlide.cpp",
1391 "tools/viewer/SampleSlide.cpp",
1392 "tools/viewer/Viewer.cpp",
1393 "tools/viewer/sk_app/CommandSet.cpp",
1394 "tools/viewer/sk_app/GLWindowContext.cpp",
1395 "tools/viewer/sk_app/Window.cpp",
1401 "tools/viewer/sk_app/android/GLWindowContext_android.cpp",
1402 "tools/viewer/sk_app/android/RasterWindowContext_android.cpp",
1403 "tools/viewer/sk_app/android/Window_android.cpp",
1404 "tools/viewer/sk_app/android/main_android.cpp",
1405 "tools/viewer/sk_app/android/surface_glue_android.cpp",
1407 libs += [ "android" ]
1408 } else if (is_linux) {
1410 "tools/viewer/sk_app/unix/GLWindowContext_unix.cpp",
1411 "tools/viewer/sk_app/unix/RasterWindowContext_unix.cpp",
1412 "tools/viewer/sk_app/unix/Window_unix.cpp",
1413 "tools/viewer/sk_app/unix/main_unix.cpp",
1415 } else if (is_win) {
1417 "tools/viewer/sk_app/win/GLWindowContext_win.cpp",
1418 "tools/viewer/sk_app/win/RasterWindowContext_win.cpp",
1419 "tools/viewer/sk_app/win/Window_win.cpp",
1420 "tools/viewer/sk_app/win/main_win.cpp",
1422 } else if (is_mac) {
1424 "tools/viewer/sk_app/mac/GLWindowContext_mac.cpp",
1425 "tools/viewer/sk_app/mac/RasterWindowContext_mac.cpp",
1426 "tools/viewer/sk_app/mac/Window_mac.cpp",
1427 "tools/viewer/sk_app/mac/main_mac.cpp",
1431 if (skia_use_vulkan) {
1432 sources += [ "tools/viewer/sk_app/VulkanWindowContext.cpp" ]
1435 [ "tools/viewer/sk_app/android/VulkanWindowContext_android.cpp" ]
1436 } else if (is_linux) {
1437 sources += [ "tools/viewer/sk_app/unix/VulkanWindowContext_unix.cpp" ]
1438 libs += [ "X11-xcb" ]
1439 } else if (is_win) {
1440 sources += [ "tools/viewer/sk_app/win/VulkanWindowContext_win.cpp" ]
1453 "//third_party/imgui",
1454 "//third_party/jsoncpp",
1457 deps += [ "//third_party/native_app_glue" ]
1458 } else if (is_mac) {
1459 deps += [ "//third_party/libsdl" ]
1464 if (is_android && is_skia_standalone && ndk != "") {
1467 "$ndk/$ndk_gdbserver",
1470 "$root_out_dir/gdbserver",
1473 if (ndk_simpleperf != "") {
1474 copy("simpleperf") {
1476 "$ndk/$ndk_simpleperf",
1477 "$ndk/simpleperf/simpleperf_report.py",
1480 "$root_out_dir/{{source_file_part}}",
1486 if (skia_enable_gpu) {
1489 "src/sksl/SkSLMain.cpp",