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
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 + skia_opts.neon_sources
208 enabled = current_cpu == "arm64"
209 sources = skia_opts.arm64_sources
214 enabled = current_cpu == "arm64"
215 sources = skia_opts.crc32_sources
216 cflags = [ "-march=armv8-a+crc" ]
221 sources = skia_opts.sse2_sources
223 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ]
225 cflags = [ "-msse2" ]
231 sources = skia_opts.ssse3_sources
233 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ]
235 cflags = [ "-mssse3" ]
241 sources = skia_opts.sse41_sources
243 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ]
245 cflags = [ "-msse4.1" ]
251 sources = skia_opts.sse42_sources
253 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ]
255 cflags = [ "-msse4.2" ]
261 sources = skia_opts.avx_sources
263 cflags = [ "/arch:AVX" ]
271 sources = skia_opts.hsw_sources
273 cflags = [ "/arch:AVX2" ]
285 # Any feature of Skia that requires third-party code should be optional and use this template.
286 template("optional") {
287 if (invoker.enabled) {
288 config(target_name + "_public") {
289 if (defined(invoker.public_defines)) {
290 defines = invoker.public_defines
293 source_set(target_name) {
294 forward_variables_from(invoker,
298 "sources_when_disabled",
301 all_dependent_configs = [ ":" + target_name + "_public" ]
302 configs += skia_library_configs
303 if (defined(invoker.configs_to_remove)) {
304 configs -= invoker.configs_to_remove
308 source_set(target_name) {
309 forward_variables_from(invoker,
316 "sources_when_disabled",
319 if (defined(invoker.sources_when_disabled)) {
320 sources = invoker.sources_when_disabled
322 configs += skia_library_configs
327 optional("effects") {
328 enabled = skia_enable_effects
330 skia_effects_sources + [ "src/ports/SkGlobalInitialization_default.cpp" ]
331 sources_when_disabled = [ "src/ports/SkGlobalInitialization_none.cpp" ]
334 optional("fontmgr_android") {
335 enabled = fontmgr_android_enabled
338 ":typeface_freetype",
339 "//third_party/expat",
342 "src/ports/SkFontMgr_android.cpp",
343 "src/ports/SkFontMgr_android_factory.cpp",
344 "src/ports/SkFontMgr_android_parser.cpp",
348 optional("fontmgr_custom") {
349 enabled = is_linux && skia_use_freetype && !skia_use_fontconfig
352 ":typeface_freetype",
355 "src/ports/SkFontMgr_custom.cpp",
356 "src/ports/SkFontMgr_custom.h",
357 "src/ports/SkFontMgr_custom_directory.cpp",
358 "src/ports/SkFontMgr_custom_directory_factory.cpp",
359 "src/ports/SkFontMgr_custom_embedded.cpp",
360 "src/ports/SkFontMgr_custom_empty.cpp",
364 optional("fontmgr_fontconfig") {
365 enabled = skia_use_freetype && skia_use_fontconfig
368 ":typeface_freetype",
369 "//third_party:fontconfig",
372 "src/ports/SkFontConfigInterface.cpp",
373 "src/ports/SkFontConfigInterface_direct.cpp",
374 "src/ports/SkFontConfigInterface_direct_factory.cpp",
375 "src/ports/SkFontMgr_FontConfigInterface.cpp",
376 "src/ports/SkFontMgr_fontconfig.cpp",
377 "src/ports/SkFontMgr_fontconfig_factory.cpp",
381 optional("fontmgr_fuchsia") {
382 enabled = is_fuchsia && skia_use_freetype
385 ":typeface_freetype",
388 "src/ports/SkFontMgr_custom.cpp",
389 "src/ports/SkFontMgr_custom_empty.cpp",
390 "src/ports/SkFontMgr_custom_empty_factory.cpp",
395 enabled = skia_enable_gpu
398 sources = skia_gpu_sources + skia_sksl_sources +
399 [ "src/gpu/gl/GrGLDefaultInterface_native.cpp" ]
401 # These paths need to be absolute to match the ones produced by shared_sources.gni.
402 sources -= get_path_info([
403 "src/gpu/gl/GrGLCreateNativeInterface_none.cpp",
404 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
409 sources += [ "src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp" ]
410 } else if (is_linux) {
411 sources += [ "src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp" ]
417 sources += [ "src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp" ]
419 sources += [ "src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp" ]
421 sources += [ "src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp" ]
422 libs += [ "OpenGL32.lib" ]
424 sources += [ "src/gpu/gl/GrGLCreateNativeInterface_none.cpp" ]
427 if (skia_use_vulkan) {
428 public_defines += [ "SK_VULKAN" ]
429 sources += skia_vk_sources
430 if (skia_enable_vulkan_debug_layers) {
431 public_defines += [ "SK_ENABLE_VK_LAYERS" ]
437 enabled = skia_use_libjpeg_turbo
438 public_defines = [ "SK_HAS_JPEG_LIBRARY" ]
441 "//third_party/libjpeg-turbo:libjpeg",
444 "src/codec/SkJpegCodec.cpp",
445 "src/codec/SkJpegDecoderMgr.cpp",
446 "src/codec/SkJpegUtility.cpp",
447 "src/images/SkJPEGImageEncoder.cpp",
448 "src/images/SkJPEGWriteUtility.cpp",
453 enabled = skia_use_zlib && skia_enable_pdf
454 public_defines = [ "SK_SUPPORT_PDF" ]
457 "//third_party/zlib",
459 sources = skia_pdf_sources
460 sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
462 if (skia_use_sfntly) {
463 deps += [ "//third_party/sfntly" ]
464 public_defines += [ "SK_PDF_USE_SFNTLY" ]
469 enabled = skia_use_libpng
470 public_defines = [ "SK_HAS_PNG_LIBRARY" ]
473 "//third_party/libpng",
476 "src/codec/SkIcoCodec.cpp",
477 "src/codec/SkPngCodec.cpp",
478 "src/images/SkPNGImageEncoder.cpp",
483 enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo && skia_use_piex
484 public_defines = [ "SK_CODEC_DECODES_RAW" ]
487 "//third_party/dng_sdk",
488 "//third_party/libjpeg-turbo:libjpeg",
489 "//third_party/piex",
492 # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
494 configs_to_remove = [ "//gn:no_exceptions" ]
497 "src/codec/SkRawAdapterCodec.cpp",
498 "src/codec/SkRawCodec.cpp",
503 enabled = skia_enable_jumper
504 public_defines = [ "SK_JUMPER" ]
506 "src/jumper/SkJumper.cpp",
507 "src/jumper/SkJumper_stages.cpp",
509 if (is_win && target_cpu == "x64") {
510 sources += [ "src/jumper/SkJumper_generated_win.S" ]
511 } else if (!is_win) {
512 sources += [ "src/jumper/SkJumper_generated.S" ]
516 optional("typeface_freetype") {
517 enabled = skia_use_freetype
520 "//third_party/freetype2",
523 "src/ports/SkFontHost_FreeType.cpp",
524 "src/ports/SkFontHost_FreeType_common.cpp",
529 enabled = skia_use_libwebp
530 public_defines = [ "SK_HAS_WEBP_LIBRARY" ]
533 "//third_party/libwebp",
536 "src/codec/SkWebpAdapterCodec.cpp",
537 "src/codec/SkWebpCodec.cpp",
538 "src/images/SkWEBPImageEncoder.cpp",
543 enabled = skia_use_expat
544 public_defines = [ "SK_XML" ]
547 "//third_party/expat",
550 "src/svg/SkSVGCanvas.cpp",
551 "src/svg/SkSVGDevice.cpp",
553 "src/xml/SkXMLParser.cpp",
554 "src/xml/SkXMLWriter.cpp",
559 public_configs = [ ":skia_public" ]
560 configs += skia_library_configs
570 ":fontmgr_fontconfig",
588 # This file (and all GN files in Skia) are designed to work with an
589 # empty sources assignment filter; we handle all that explicitly.
590 # We clear the filter here for clients who may have set up a global filter.
591 set_sources_assignment_filter([])
594 sources += skia_core_sources
595 sources += skia_utils_sources
596 sources += skia_xps_sources
598 "src/android/SkBitmapRegionCodec.cpp",
599 "src/android/SkBitmapRegionDecoder.cpp",
600 "src/codec/SkAndroidCodec.cpp",
601 "src/codec/SkBmpCodec.cpp",
602 "src/codec/SkBmpMaskCodec.cpp",
603 "src/codec/SkBmpRLECodec.cpp",
604 "src/codec/SkBmpStandardCodec.cpp",
605 "src/codec/SkCodec.cpp",
606 "src/codec/SkCodecImageGenerator.cpp",
607 "src/codec/SkGifCodec.cpp",
608 "src/codec/SkMaskSwizzler.cpp",
609 "src/codec/SkMasks.cpp",
610 "src/codec/SkSampledCodec.cpp",
611 "src/codec/SkSampler.cpp",
612 "src/codec/SkStreamBuffer.cpp",
613 "src/codec/SkSwizzler.cpp",
614 "src/codec/SkWbmpCodec.cpp",
615 "src/images/SkImageEncoder.cpp",
616 "src/ports/SkDiscardableMemory_none.cpp",
617 "src/ports/SkImageGenerator_skia.cpp",
618 "src/ports/SkMemory_malloc.cpp",
619 "src/ports/SkOSFile_stdio.cpp",
620 "src/sfnt/SkOTTable_name.cpp",
621 "src/sfnt/SkOTUtils.cpp",
622 "src/utils/mac/SkStream_mac.cpp",
623 "third_party/etc1/etc1.cpp",
624 "third_party/gif/SkGifImageReader.cpp",
631 "src/fonts/SkFontMgr_indirect.cpp",
632 "src/ports/SkDebug_win.cpp",
633 "src/ports/SkFontHost_win.cpp",
634 "src/ports/SkFontMgr_win_dw.cpp",
635 "src/ports/SkImageEncoder_WIC.cpp",
636 "src/ports/SkImageGeneratorWIC.cpp",
637 "src/ports/SkOSFile_win.cpp",
638 "src/ports/SkOSLibrary_win.cpp",
639 "src/ports/SkScalerContext_win_dw.cpp",
640 "src/ports/SkTLS_win.cpp",
641 "src/ports/SkTypeface_win_dw.cpp",
644 sources += [ "src/ports/SkFontMgr_win_gdi_factory.cpp" ]
650 sources += [ "src/ports/SkFontMgr_win_dw_factory.cpp" ]
653 [ get_path_info("src/utils/SkThreadUtils_pthread.cpp", "abspath") ]
662 "src/ports/SkOSFile_posix.cpp",
663 "src/ports/SkOSLibrary_posix.cpp",
664 "src/ports/SkTLS_pthread.cpp",
669 deps += [ "//third_party/expat" ]
670 if (is_skia_standalone && ndk != "") {
671 deps += [ "//third_party/cpu-features" ]
673 sources += [ "src/ports/SkDebug_android.cpp" ]
682 sources += [ "src/ports/SkDebug_stdio.cpp" ]
687 "src/ports/SkDebug_stdio.cpp",
688 "src/ports/SkFontHost_mac.cpp",
689 "src/ports/SkImageEncoder_CG.cpp",
690 "src/ports/SkImageGeneratorCG.cpp",
693 "ApplicationServices.framework",
700 "src/ports/SkDebug_stdio.cpp",
701 "src/ports/SkFontHost_mac.cpp",
702 "src/ports/SkImageEncoder_CG.cpp",
703 "src/ports/SkImageGeneratorCG.cpp",
706 "CoreFoundation.framework",
707 "CoreGraphics.framework",
708 "CoreText.framework",
710 "MobileCoreServices.framework",
715 sources += [ "src/ports/SkDebug_stdio.cpp" ]
719 # Targets guarded by skia_enable_tools may use //third_party freely.
720 if (skia_enable_tools) {
721 # Used by gn_to_bp.py to list our public include dirs.
722 source_set("public") {
723 configs += [ ":skia_public" ]
726 config("skia.h_config") {
727 include_dirs = [ "$target_gen_dir" ]
730 public_configs = [ ":skia.h_config" ]
731 skia_h = "$target_gen_dir/skia.h"
732 script = "gn/find_headers.py"
733 args = [ rebase_path(skia_h, root_build_dir) ] +
734 rebase_path(skia_public_includes)
735 depfile = "$skia_h.deps"
741 if (skia_enable_gpu && target_cpu == "x64") {
742 # Our bots only have 64-bit libOSMesa installed.
743 # TODO: worth fixing?
744 executable("fiddle") {
751 "tools/fiddle/draw.cpp",
752 "tools/fiddle/fiddle_main.cpp",
761 if (skia_enable_gpu) {
762 source_set("public_headers_warnings_check") {
764 "tools/public_headers_warnings_check.cpp",
766 configs -= [ "//gn:warnings_except_public_headers" ]
774 template("test_lib") {
775 config(target_name + "_config") {
776 include_dirs = invoker.public_include_dirs
777 if (defined(invoker.public_defines)) {
778 defines = invoker.public_defines
781 source_set(target_name) {
782 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
784 ":" + target_name + "_config",
788 if (!defined(deps)) {
796 template("test_app") {
797 if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
798 shared_library("lib" + target_name) {
799 forward_variables_from(invoker, "*", [ "is_shared_library" ])
803 _executable = target_name
804 executable(_executable) {
805 forward_variables_from(invoker, "*", [ "is_shared_library" ])
809 if (is_android && skia_android_serial != "" && defined(_executable)) {
810 action("push_" + target_name) {
811 script = "gn/push_to_android.py"
815 _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
820 rebase_path("$root_build_dir/$_executable"),
829 test_lib("gpu_tool_utils") {
830 public_include_dirs = []
831 if (skia_enable_gpu) {
833 public_include_dirs += [ "tools/gpu" ]
837 "tools/gpu/GrContextFactory.cpp",
838 "tools/gpu/GrTest.cpp",
839 "tools/gpu/TestContext.cpp",
840 "tools/gpu/gl/GLTestContext.cpp",
841 "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp",
842 "tools/gpu/gl/debug/DebugGLTestContext.cpp",
843 "tools/gpu/gl/debug/GrBufferObj.cpp",
844 "tools/gpu/gl/debug/GrFrameBufferObj.cpp",
845 "tools/gpu/gl/debug/GrProgramObj.cpp",
846 "tools/gpu/gl/debug/GrShaderObj.cpp",
847 "tools/gpu/gl/debug/GrTextureObj.cpp",
848 "tools/gpu/gl/debug/GrTextureUnitObj.cpp",
849 "tools/gpu/gl/null/NullGLTestContext.cpp",
854 sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
856 sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
857 libs += [ "OpenGLES.framework" ]
858 } else if (is_linux) {
859 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
862 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
864 sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
871 if (skia_use_angle) {
872 deps += [ "//third_party/angle2" ]
873 sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
876 public_defines += [ "SK_MESA" ]
877 sources += [ "tools/gpu/gl/mesa/GLTestContext_mesa.cpp" ]
880 if (skia_use_vulkan) {
881 sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
887 public_include_dirs = [ "tools/flags" ]
889 "tools/flags/SkCommandLineFlags.cpp",
892 test_lib("common_flags") {
893 public_include_dirs = [ "tools/flags" ]
895 "tools/flags/SkCommonFlags.cpp",
896 "tools/flags/SkCommonFlagsConfig.cpp",
904 test_lib("tool_utils") {
905 public_include_dirs = [
911 "src/utils/SkMultiPictureDocumentReader.cpp", # TODO(halcanary): move to tools?
912 "tools/AndroidSkDebugToStdOut.cpp",
913 "tools/CrashHandler.cpp",
914 "tools/LsanSuppressions.cpp",
915 "tools/ProcStats.cpp",
916 "tools/Resources.cpp",
917 "tools/ThermalManager.cpp",
918 "tools/UrlDataManager.cpp",
919 "tools/debugger/SkDebugCanvas.cpp",
920 "tools/debugger/SkDrawCommand.cpp",
921 "tools/debugger/SkJsonWriteBuffer.cpp",
922 "tools/debugger/SkObjectParser.cpp",
923 "tools/picture_utils.cpp",
924 "tools/random_parse_path.cpp",
925 "tools/sk_tool_utils.cpp",
926 "tools/sk_tool_utils_font.cpp",
927 "tools/timer/Timer.cpp",
931 sources += [ "tools/ios_utils.m" ]
932 libs += [ "Foundation.framework" ]
937 "//third_party/libpng",
940 "//third_party/jsoncpp",
946 public_include_dirs = [ "gm" ]
956 import("gn/tests.gni")
958 public_include_dirs = [ "tests" ]
959 sources = tests_sources + pathops_tests_sources
960 if (!fontmgr_android_enabled) {
961 sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ]
964 ":experimental_svg_model",
969 "//third_party/libpng",
970 "//third_party/zlib",
974 import("gn/bench.gni")
976 public_include_dirs = [ "bench" ]
977 sources = bench_sources
987 test_lib("experimental_svg_model") {
988 public_include_dirs = [ "experimental/svg/model" ]
990 "experimental/svg/model/SkSVGAttribute.cpp",
991 "experimental/svg/model/SkSVGAttributeParser.cpp",
992 "experimental/svg/model/SkSVGCircle.cpp",
993 "experimental/svg/model/SkSVGClipPath.cpp",
994 "experimental/svg/model/SkSVGContainer.cpp",
995 "experimental/svg/model/SkSVGDOM.cpp",
996 "experimental/svg/model/SkSVGEllipse.cpp",
997 "experimental/svg/model/SkSVGLine.cpp",
998 "experimental/svg/model/SkSVGLinearGradient.cpp",
999 "experimental/svg/model/SkSVGNode.cpp",
1000 "experimental/svg/model/SkSVGPath.cpp",
1001 "experimental/svg/model/SkSVGPoly.cpp",
1002 "experimental/svg/model/SkSVGRect.cpp",
1003 "experimental/svg/model/SkSVGRenderContext.cpp",
1004 "experimental/svg/model/SkSVGSVG.cpp",
1005 "experimental/svg/model/SkSVGShape.cpp",
1006 "experimental/svg/model/SkSVGStop.cpp",
1007 "experimental/svg/model/SkSVGTransformableNode.cpp",
1008 "experimental/svg/model/SkSVGValue.cpp",
1016 public_include_dirs = [ "include/views" ]
1018 "src/views/SkEvent.cpp",
1019 "src/views/SkEventSink.cpp",
1020 "src/views/SkOSMenu.cpp",
1021 "src/views/SkTagList.cpp",
1022 "src/views/SkTouchGesture.cpp",
1023 "src/views/SkView.cpp",
1024 "src/views/SkViewPriv.cpp",
1029 sources += [ "src/views/SkWindow.cpp" ]
1032 public_include_dirs += [ "src/views/unix" ]
1034 "src/views/unix/SkOSWindow_Unix.cpp",
1035 "src/views/unix/keysym2ucs.c",
1041 } else if (is_mac) {
1043 "src/views/mac/SkEventNotifier.mm",
1044 "src/views/mac/SkNSView.mm",
1045 "src/views/mac/SkOSWindow_Mac.mm",
1046 "src/views/mac/SkTextFieldCell.m",
1049 "QuartzCore.framework",
1051 "Foundation.framework",
1053 } else if (is_win) {
1054 sources += [ "src/views/win/SkOSWindow_win.cpp" ]
1056 if (skia_use_angle) {
1057 deps += [ "//third_party/angle2" ]
1063 public_include_dirs = []
1065 "src/utils/SkLua.cpp",
1066 "src/utils/SkLuaCanvas.cpp",
1069 "//third_party/lua",
1073 test_app("lua_app") {
1075 "tools/lua/lua_app.cpp",
1080 "//third_party/lua",
1084 test_app("lua_pictures") {
1086 "tools/lua/lua_pictures.cpp",
1093 "//third_party/lua",
1098 import("gn/samples.gni")
1099 test_lib("samples") {
1100 public_include_dirs = [ "samplecode" ]
1101 include_dirs = [ "experimental" ]
1102 sources = samples_sources + [
1103 "experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp",
1104 "experimental/SkSetPoly3To3.cpp",
1105 "experimental/SkSetPoly3To3_A.cpp",
1106 "experimental/SkSetPoly3To3_D.cpp",
1109 ":experimental_svg_model",
1117 sources += [ "samplecode/SampleLua.cpp" ]
1120 "//third_party/lua",
1128 "dm/DMJsonWriter.cpp",
1131 include_dirs = [ "tests" ]
1134 ":experimental_svg_model",
1141 "//third_party/jsoncpp",
1142 "//third_party/libpng",
1146 if (!is_debug) { # I've benchmarked debug code once too many times...
1147 test_app("monobench") {
1149 "tools/monobench.cpp",
1158 test_app("nanobench") {
1160 "bench/nanobench.cpp",
1165 ":experimental_svg_model",
1171 "//third_party/jsoncpp",
1175 test_app("skpinfo") {
1177 "tools/skpinfo.cpp",
1185 if (is_linux || is_win || is_mac) {
1186 test_app("SampleApp") {
1188 "samplecode/SampleApp.cpp",
1189 "samplecode/SamplePictFile.cpp",
1192 sources += [ "src/views/mac/skia_mac.mm" ]
1193 } else if (is_win) {
1194 sources += [ "src/views/win/skia_win.cpp" ]
1195 } else if (is_linux) {
1196 sources += [ "src/views/unix/skia_unix.cpp" ]
1207 if (skia_use_angle) {
1208 deps += [ "//third_party/angle2" ]
1213 if (skia_enable_gpu) {
1214 test_app("skpbench") {
1216 "tools/skpbench/skpbench.cpp",
1227 # We can't yet build ICU on iOS or Windows.
1228 if (!is_ios && !is_win) {
1229 test_app("sktexttopdf-hb") {
1231 "tools/SkShaper_harfbuzz.cpp",
1232 "tools/using_skia_and_harfbuzz.cpp",
1236 "//third_party/harfbuzz",
1240 test_app("sktexttopdf") {
1242 "tools/SkShaper_primitive.cpp",
1243 "tools/using_skia_and_harfbuzz.cpp",
1250 test_app("get_images_from_skps") {
1252 "tools/get_images_from_skps.cpp",
1257 "//third_party/jsoncpp",
1261 test_app("colorspaceinfo") {
1263 "tools/colorspaceinfo.cpp",
1273 test_app("skiaserve") {
1275 "tools/skiaserve/Request.cpp",
1276 "tools/skiaserve/Response.cpp",
1277 "tools/skiaserve/skiaserve.cpp",
1278 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
1279 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
1280 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
1281 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
1282 "tools/skiaserve/urlhandlers/DataHandler.cpp",
1283 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
1284 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
1285 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
1286 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
1287 "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
1288 "tools/skiaserve/urlhandlers/OpsHandler.cpp",
1289 "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
1290 "tools/skiaserve/urlhandlers/PostHandler.cpp",
1291 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
1292 "tools/skiaserve/urlhandlers/RootHandler.cpp",
1299 "//third_party/jsoncpp",
1300 "//third_party/libmicrohttpd",
1301 "//third_party/libpng",
1308 "fuzz/FilterFuzz.cpp",
1309 "fuzz/FuzzDrawFunctions.cpp",
1310 "fuzz/FuzzGradients.cpp",
1311 "fuzz/FuzzParsePath.cpp",
1312 "fuzz/FuzzPathop.cpp",
1313 "fuzz/FuzzScaleToSides.cpp",
1323 test_app("pathops_unittest") {
1324 sources = pathops_tests_sources + [
1325 rebase_path("tests/skia_test.cpp"),
1326 rebase_path("tests/Test.cpp"),
1336 test_app("dump_record") {
1338 "tools/DumpRecord.cpp",
1339 "tools/dump_record.cpp",
1347 test_app("skdiff") {
1349 "tools/skdiff/skdiff.cpp",
1350 "tools/skdiff/skdiff_html.cpp",
1351 "tools/skdiff/skdiff_main.cpp",
1352 "tools/skdiff/skdiff_utils.cpp",
1360 test_app("skp_parser") {
1362 "tools/skp_parser.cpp",
1367 "//third_party/jsoncpp",
1371 if (skia_enable_gpu && (is_android || is_linux || is_win || is_mac)) {
1372 test_app("viewer") {
1373 is_shared_library = is_android
1375 "tools/viewer/GMSlide.cpp",
1376 "tools/viewer/ImageSlide.cpp",
1377 "tools/viewer/SKPSlide.cpp",
1378 "tools/viewer/SampleSlide.cpp",
1379 "tools/viewer/Viewer.cpp",
1380 "tools/viewer/sk_app/CommandSet.cpp",
1381 "tools/viewer/sk_app/GLWindowContext.cpp",
1382 "tools/viewer/sk_app/Window.cpp",
1388 "tools/viewer/sk_app/android/GLWindowContext_android.cpp",
1389 "tools/viewer/sk_app/android/RasterWindowContext_android.cpp",
1390 "tools/viewer/sk_app/android/Window_android.cpp",
1391 "tools/viewer/sk_app/android/main_android.cpp",
1392 "tools/viewer/sk_app/android/surface_glue_android.cpp",
1394 libs += [ "android" ]
1395 } else if (is_linux) {
1397 "tools/viewer/sk_app/unix/GLWindowContext_unix.cpp",
1398 "tools/viewer/sk_app/unix/RasterWindowContext_unix.cpp",
1399 "tools/viewer/sk_app/unix/Window_unix.cpp",
1400 "tools/viewer/sk_app/unix/main_unix.cpp",
1402 } else if (is_win) {
1404 "tools/viewer/sk_app/win/GLWindowContext_win.cpp",
1405 "tools/viewer/sk_app/win/RasterWindowContext_win.cpp",
1406 "tools/viewer/sk_app/win/Window_win.cpp",
1407 "tools/viewer/sk_app/win/main_win.cpp",
1409 } else if (is_mac) {
1411 "tools/viewer/sk_app/mac/GLWindowContext_mac.cpp",
1412 "tools/viewer/sk_app/mac/RasterWindowContext_mac.cpp",
1413 "tools/viewer/sk_app/mac/Window_mac.cpp",
1414 "tools/viewer/sk_app/mac/main_mac.cpp",
1418 if (skia_use_vulkan) {
1419 sources += [ "tools/viewer/sk_app/VulkanWindowContext.cpp" ]
1422 [ "tools/viewer/sk_app/android/VulkanWindowContext_android.cpp" ]
1423 } else if (is_linux) {
1424 sources += [ "tools/viewer/sk_app/unix/VulkanWindowContext_unix.cpp" ]
1425 libs += [ "X11-xcb" ]
1426 } else if (is_win) {
1427 sources += [ "tools/viewer/sk_app/win/VulkanWindowContext_win.cpp" ]
1440 "//third_party/imgui",
1441 "//third_party/jsoncpp",
1444 deps += [ "//third_party/native_app_glue" ]
1445 } else if (is_mac) {
1446 deps += [ "//third_party/libsdl" ]
1451 if (is_android && is_skia_standalone && ndk != "") {
1454 "$ndk/$ndk_gdbserver",
1457 "$root_out_dir/gdbserver",
1460 if (ndk_simpleperf != "") {
1461 copy("simpleperf") {
1463 "$ndk/$ndk_simpleperf",
1464 "$ndk/simpleperf/simpleperf_report.py",
1467 "$root_out_dir/{{source_file_part}}",
1473 if (skia_enable_gpu) {
1476 "src/sksl/SkSLMain.cpp",