skia2/BUILD.gn

2514 lines
62 KiB
Plaintext
Raw Normal View History

# Copyright 2016 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("gn/flutter_defines.gni")
import("gn/fuchsia_defines.gni")
import("gn/shared_sources.gni")
import("gn/skia.gni")
if (is_fuchsia) {
import("//build/vulkan/config.gni")
}
declare_args() {
skia_enable_flutter_defines = false
}
declare_args() {
skia_use_angle = false
skia_use_egl = false
skia_use_expat = true
skia_use_fontconfig = is_linux
skia_use_fonthost_mac = is_mac
skia_use_freetype = is_android || is_fuchsia || is_linux
Generate Android Framework host-side Skia (linux) Bug: b/118742766 Update gn_to_bp to write an Android.bp file that will build a host-side Skia library. Switch some methods from SK_BUILD_FOR_ANDROID to SK_BUILD_FOR_ANDROID_FRAMEWORK. Prior reviews were done at ag/5482397. gn_to_bp.py: - Run GN twice - once for android and once for linux - Disable GPU (depends on a to-be-written host side GL target) and HEIF (which relies on Android hardware) on linux - TODO: Turn on GPU on linux - Split sources into everywhere, android-only, and linux-only. It seems that Android.bp does not allow using the same cpp file in multiple targets. - note that we currently *only* divide out the sources. The cflags are the same (except for a couple manual ones) and include directories are mostly the same (again, except for manual ones). Android has a "gpu" include directory, which I don't expect to make a difference to the linux build, which isn't using GPU (yet). - Use the same "custom empty" font manager on the host as on Android - Write separate SkUserConfig files; one for android and one for linux. This allows libskia to force libraries that use it to use the right defines by setting export_include_dirs. - Add extra checks to SkUserConfig.h to ensure we have only the appropriate SK_BUILD_FOR macro defined - Add host_supported: true for libskia gn_to_bp_utils.py: - Switch SkUserConfig.h from include guards to pragma once so it is easier to append to the end. This matches how Android generally includes headers. BUILD.gn: - Add skia_use_fixed_gamma_text so host build can use the same SK_GAMMA defines as the device. SkPreConfig.h: - Stop making SK_BUILD_FOR_ANDROID_FRAMEWORK imply SK_BUILD_FOR_ANDROID. The host build needs the former defined but not the latter. SkRegion.cpp/.h: - Make toString() SK_BUILD_FOR_ANDROID_FRAMEWORK so it can be called on the host. SkCamera.h/.cpp: - Switch methods to SK_BUILD_FOR_ANDROID_FRAMEWORK so they can be called on the host. - Make getCameraLocation*() const. They are logically const, and this allows removing a const_cast + TODO in hwui. Change-Id: I771f825d06380e01c0488fd1c00df1d8a2454dc0 Reviewed-on: https://skia-review.googlesource.com/c/171231 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-11-15 20:54:59 +00:00
skia_use_fixed_gamma_text = is_android
skia_use_libjpeg_turbo = true
skia_use_libpng = true
skia_use_libwebp = !is_fuchsia
skia_use_lua = is_skia_dev_build && !is_ios
skia_use_opencl = false
skia_use_piex = !is_win
skia_use_wuffs = false
skia_use_zlib = true
skia_use_metal = false
skia_use_libheif = is_skia_dev_build
skia_use_x11 = is_linux
skia_use_xps = true
skia_android_serial = ""
skia_enable_ccpr = true
skia_enable_nvpr = !skia_enable_flutter_defines
skia_enable_discrete_gpu = true
skia_enable_nima = false
skia_enable_pdf = true
skia_enable_spirv_validation = is_skia_dev_build && is_debug
skia_enable_skpicture = true
skia_enable_vulkan_debug_layers = is_skia_dev_build && is_debug
skia_qt_path = getenv("QT_PATH")
skia_compile_processors = false
skia_generate_workarounds = false
skia_lex = false
skia_skqp_global_error_tolerance = 0
skia_llvm_path = ""
skia_llvm_lib = "LLVM"
skia_tools_require_resources = false
}
declare_args() {
skia_use_dng_sdk = !is_fuchsia && skia_use_libjpeg_turbo && skia_use_zlib
skia_use_sfntly = skia_use_icu
skia_enable_atlas_text = is_skia_dev_build && skia_enable_gpu
skia_enable_fontmgr_empty = false
skia_enable_fontmgr_custom =
is_linux && skia_use_freetype && !skia_use_fontconfig
skia_enable_fontmgr_custom_empty = is_fuchsia && skia_use_freetype
skia_enable_fontmgr_android = skia_use_expat && skia_use_freetype
skia_enable_fontmgr_fuchsia = is_fuchsia
skia_enable_fontmgr_win = is_win
skia_enable_fontmgr_win_gdi = is_win
if (is_android) {
skia_use_vulkan = defined(ndk_api) && ndk_api >= 24
} else if (is_fuchsia) {
skia_use_vulkan = fuchsia_use_vulkan
} else {
skia_use_vulkan = defined(skia_moltenvk_path) && skia_moltenvk_path != ""
}
if (is_ios) {
skia_ios_identity = ".*Google.*"
skia_ios_profile = "Google Development"
}
}
if (defined(skia_settings)) {
import(skia_settings)
}
skia_public_includes = [
"include/android",
"include/c",
"include/codec",
"include/config",
"include/core",
"include/docs",
"include/effects",
"include/encode",
"include/gpu",
"include/atlastext",
"include/pathops",
"include/ports",
"include/svg",
"include/utils",
"include/utils/mac",
]
if (skia_enable_atlas_text) {
skia_public_includes += [ "include/atlastext" ]
}
Revert "Revert "Update skia to use ifdefs for Vulkan code instead of dummy header"" This reverts commit fad9e3f54112ea8c8bb6bb72384f47b9759578f5. Reason for revert: Can't find the error message anymore (?!?) Let's try again shall we Original change's description: > Revert "Update skia to use ifdefs for Vulkan code instead of dummy header" > > This reverts commit c0f8e426c59eec6c720b8e1329dcb966cf1b6800. > > Reason for revert: Experiment to see if this will unblock the Android roll > > Original change's description: > > Update skia to use ifdefs for Vulkan code instead of dummy header > > > > Bug: skia:6721 > > Change-Id: I80a4c9f2acc09c174497f625c50ed12a8bb76505 > > Reviewed-on: https://skia-review.googlesource.com/19547 > > Reviewed-by: Mike Klein <mtklein@google.com> > > Commit-Queue: Greg Daniel <egdaniel@google.com> > > TBR=egdaniel@google.com,mtklein@google.com,bsalomon@google.com > > Change-Id: Ib51c1672570f2071a17b6fbde692a5174b0358ce > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:6721 > Reviewed-on: https://skia-review.googlesource.com/19724 > Reviewed-by: Robert Phillips <robertphillips@google.com> > Commit-Queue: Robert Phillips <robertphillips@google.com> TBR=egdaniel@google.com,mtklein@google.com,bsalomon@google.com,robertphillips@google.com Change-Id: Iecef7ddcfe31d82938336120a4193525ac6693be No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:6721 Reviewed-on: https://skia-review.googlesource.com/19782 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-06-14 01:43:29 +00:00
# Skia public API, generally provided by :skia.
config("skia_public") {
include_dirs = skia_public_includes
defines = []
if (is_component_build) {
defines += [ "SKIA_DLL" ]
}
if (is_fuchsia || is_linux) {
defines += [ "SK_SAMPLES_FOR_X" ]
}
if (skia_enable_flutter_defines) {
defines += flutter_defines
}
if (!skia_enable_gpu) {
defines += [ "SK_SUPPORT_GPU=0" ]
}
if (skia_enable_atlas_text) {
defines += [ "SK_SUPPORT_ATLAS_TEXT=1" ]
}
if (is_fuchsia) {
defines += fuchsia_defines
}
}
# Skia internal APIs, used by Skia itself and a few test tools.
config("skia_private") {
visibility = [ ":*" ]
include_dirs = [
"include/private",
"src/c",
"src/codec",
"src/core",
"src/effects",
"src/fonts",
"src/image",
"src/images",
"src/lazy",
"src/opts",
"src/pathops",
"src/pdf",
"src/ports",
"src/sfnt",
"src/shaders",
"src/shaders/gradients",
"src/sksl",
"src/utils",
"src/utils/win",
"src/xml",
"third_party/etc1",
Add support for multiple frames in SkCodec Add an interface to decode frames beyond the first in SkCodec, and add an implementation for SkGifCodec. Add getFrameData to SkCodec. This method reads ahead in the stream to return a vector containing meta data about each frame in the image. This is not required in order to decode frames beyond the first, but it allows a client to learn extra information: - how long the frame should be displayed - whether a frame should be blended with a prior frame, allowing the client to provide the prior frame to speed up decoding Add a new fields to SkCodec::Options: - fFrameIndex - fHasPriorFrame The API is designed so that SkCodec never caches frames. If a client wants a frame beyond the first, they specify the frame in Options.fFrameIndex. If the client does not have the frame's required frame (the frame that this frame must be blended on top of) cached, they pass false for Options.fHasPriorFrame. Unless the frame is independent, the codec will then recursively decode all frames necessary to decode fFrameIndex. If the client has the required frame cached, they can put it in the dst they pass to the codec, and the codec will only draw fFrameIndex onto it. Replace SkGifCodec's scanline decoding support with progressive decoding, and update the tests accordingly. Implement new APIs in SkGifCodec. Instead of using gif_lib, use GIFImageReader, imported from Chromium (along with its copyright headers) with the following changes: - SkGifCodec is now the client - Replace blink types - Combine GIFColorMap::buildTable and ::getTable into a method that creates and returns an SkColorTable - Input comes from an SkStream, instead of a SegmentReader. Add SkStreamBuffer, which buffers the (potentially partial) stream in order to decode progressively. (FIXME: This requires copying data that previously was read directly from the SegmentReader. Does this hurt performance? If so, can we fix it?) - Remove UMA code - Instead of reporting screen width and height to the client, allow the client to query for it - Fail earlier if the first frame AND screen have size of zero - Compute required previous frame when adding a new one - Move GIFParseQuery from GIFImageDecoder to GIFImageReader - Allow parsing up to a specific frame (to skip parsing the rest of the stream if a client only wants the first frame) - Compute whether the first frame has alpha and supports index 8, to create the SkImageInfo. This happens before reporting that the size has been decoded. Add GIFImageDecoder::haveDecodedRow to SkGifCodec, imported from Chromium (along with its copyright header), with the following changes: - Add support for sampling - Use the swizzler - Keep track of the rows decoded - Do *not* keep track of whether we've seen alpha Remove SkCodec::kOutOfOrder_SkScanlineOrder, which was only used by GIF scanline decoding. Call onRewind even if there is no stream (SkGifCodec needs to clear its decoded state so it will decode from the beginning). Add a method to SkSwizzler to access the offset into the dst, taking subsetting into account. Add a GM that animates a GIF. Add tests for the new APIs. *** Behavior changes: * Previously, we reported that an image with a subset frame and no transparent index was opaque and used the background index (if present) to fill the background. This is necessary in order to support index 8, but it does not match viewers/browsers I have seen. Examples: - Chromium and Gimp render the background transparent - Firefox, Safari, Linux Image Viewer, Safari Preview clip to the frame (for a single frame image) This CL matches Chromium's behavior and renders the background transparent. This allows us to have consistent behavior across products and simplifies the code (relative to what we would have to do to continue the old behavior on Android). It also means that we will no longer support index 8 for some GIFs. * Stop checking for GIFSTAMP - all GIFs should be either 89a or 87a. This matches Chromium. I suspect that bugs would have been reported if valid GIFs started with "GIFVER" instead of "GIF89a" or "GIF87a" (but did not decode in Chromium). *** Future work not included in this CL: * Move some checks out of haveDecodedRow, since they are the same for the entire frame e.g. - intersecting the frameRect with the full image size - whether there is a color table * Change when we write transparent pixels - In some cases, Chromium deemed this unnecessary, but I suspect it is slower than the fallback case. There will continue to be cases where we should *not* write them, but for e.g. the first pass where we have already cleared to transparent (which we may also be able to skip) writing the transparent pixels will not make anything incorrect. * Report color type and alpha type per frame - Depending on alpha values, disposal methods, frame rects, etc, subsequent frames may have different properties than the first. * Skip copies of the encoded data - We copy the encoded data in case the stream is one that cannot be rewound, so we can parse and then decode (possibly not immediately). For some input streams, this is unnecessary. - I was concerned this cause a performance regression, but on average the new code is faster than the old for the images I tested [1]. - It may cause a performance regression for Chromium, though, where we can always move back in the stream, so this should be addressed. Design doc: https://docs.google.com/a/google.com/document/d/12Qhf9T92MWfdWujQwCIjhCO3sw6pTJB5pJBwDM1T7Kc/ [1] https://docs.google.com/a/google.com/spreadsheets/d/19V-t9BfbFw5eiwBTKA1qOBkZbchjlTC5EIz6HFy-6RI/ GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=2045293002 Review-Url: https://codereview.chromium.org/2045293002
2016-10-24 16:03:26 +00:00
"third_party/gif",
]
defines = [ "SK_GAMMA_APPLY_TO_A8" ]
Generate Android Framework host-side Skia (linux) Bug: b/118742766 Update gn_to_bp to write an Android.bp file that will build a host-side Skia library. Switch some methods from SK_BUILD_FOR_ANDROID to SK_BUILD_FOR_ANDROID_FRAMEWORK. Prior reviews were done at ag/5482397. gn_to_bp.py: - Run GN twice - once for android and once for linux - Disable GPU (depends on a to-be-written host side GL target) and HEIF (which relies on Android hardware) on linux - TODO: Turn on GPU on linux - Split sources into everywhere, android-only, and linux-only. It seems that Android.bp does not allow using the same cpp file in multiple targets. - note that we currently *only* divide out the sources. The cflags are the same (except for a couple manual ones) and include directories are mostly the same (again, except for manual ones). Android has a "gpu" include directory, which I don't expect to make a difference to the linux build, which isn't using GPU (yet). - Use the same "custom empty" font manager on the host as on Android - Write separate SkUserConfig files; one for android and one for linux. This allows libskia to force libraries that use it to use the right defines by setting export_include_dirs. - Add extra checks to SkUserConfig.h to ensure we have only the appropriate SK_BUILD_FOR macro defined - Add host_supported: true for libskia gn_to_bp_utils.py: - Switch SkUserConfig.h from include guards to pragma once so it is easier to append to the end. This matches how Android generally includes headers. BUILD.gn: - Add skia_use_fixed_gamma_text so host build can use the same SK_GAMMA defines as the device. SkPreConfig.h: - Stop making SK_BUILD_FOR_ANDROID_FRAMEWORK imply SK_BUILD_FOR_ANDROID. The host build needs the former defined but not the latter. SkRegion.cpp/.h: - Make toString() SK_BUILD_FOR_ANDROID_FRAMEWORK so it can be called on the host. SkCamera.h/.cpp: - Switch methods to SK_BUILD_FOR_ANDROID_FRAMEWORK so they can be called on the host. - Make getCameraLocation*() const. They are logically const, and this allows removing a const_cast + TODO in hwui. Change-Id: I771f825d06380e01c0488fd1c00df1d8a2454dc0 Reviewed-on: https://skia-review.googlesource.com/c/171231 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-11-15 20:54:59 +00:00
if (skia_use_fixed_gamma_text) {
defines += [
"SK_GAMMA_EXPONENT=1.4",
"SK_GAMMA_CONTRAST=0.0",
]
}
if (is_official_build || is_android) {
# TODO(bsalomon): it'd be nice to make Android normal.
defines += [ "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0" ]
}
libs = []
lib_dirs = []
if (skia_enable_gpu) {
include_dirs += [ "src/gpu" ]
if (is_skia_dev_build && skia_use_vulkan) {
include_dirs += [ "tools/gpu/vk" ]
}
}
if (skia_use_angle) {
defines += [ "SK_ANGLE" ]
}
if (skia_enable_discrete_gpu) {
defines += [ "SK_ENABLE_DISCRETE_GPU" ]
}
if (!is_official_build) {
defines += [ "GR_TEST_UTILS=1" ]
}
if (skia_llvm_path != "") {
defines += [ "SK_LLVM_AVAILABLE" ]
include_dirs += [ "$skia_llvm_path/include" ]
libs += [ skia_llvm_lib ]
lib_dirs += [ "$skia_llvm_path/lib/" ]
}
}
# Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
config("skia_library") {
visibility = [ ":*" ]
defines = [ "SKIA_IMPLEMENTATION=1" ]
}
skia_library_configs = [
":skia_public",
":skia_private",
":skia_library",
]
# Use for CPU-specific Skia code that needs particular compiler flags.
template("opts") {
visibility = [ ":*" ]
if (invoker.enabled) {
source_set(target_name) {
check_includes = false
forward_variables_from(invoker, "*")
configs += skia_library_configs
}
} else {
# If not enabled, a phony empty target that swallows all otherwise unused variables.
source_set(target_name) {
check_includes = false
forward_variables_from(invoker,
"*",
[
"sources",
"cflags",
])
}
}
}
is_x86 = current_cpu == "x64" || current_cpu == "x86"
opts("none") {
enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64"
sources = skia_opts.none_sources
cflags = []
}
opts("armv7") {
enabled = current_cpu == "arm"
sources = skia_opts.armv7_sources + skia_opts.neon_sources
cflags = []
}
opts("arm64") {
enabled = current_cpu == "arm64"
sources = skia_opts.arm64_sources
cflags = []
}
opts("crc32") {
enabled = current_cpu == "arm64"
sources = skia_opts.crc32_sources
cflags = [ "-march=armv8-a+crc" ]
}
opts("sse2") {
enabled = is_x86
sources = skia_opts.sse2_sources
if (!is_clang && is_win) {
defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ]
} else {
cflags = [ "-msse2" ]
}
}
opts("ssse3") {
enabled = is_x86
sources = skia_opts.ssse3_sources
if (!is_clang && is_win) {
defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ]
} else {
cflags = [ "-mssse3" ]
}
}
opts("sse41") {
enabled = is_x86
sources = skia_opts.sse41_sources
if (!is_clang && is_win) {
defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ]
} else {
cflags = [ "-msse4.1" ]
}
}
opts("sse42") {
enabled = is_x86
sources = skia_opts.sse42_sources
if (!is_clang && is_win) {
defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ]
} else {
cflags = [ "-msse4.2" ]
}
}
opts("avx") {
enabled = is_x86
sources = skia_opts.avx_sources
if (is_win) {
cflags = [ "/arch:AVX" ]
} else {
cflags = [ "-mavx" ]
}
}
Reland "Reland "make SkJumper stages normal Skia code"" This is a reland of 78cb579f33943421afc8423a39867fcfd69fed44 This time, lowp stages are controlled by !defined(JUMPER_IS_SCALAR), not by defined(__clang__). The two are usually the same, except when we opt Clang builds into JUMPER_IS_SCALAR artificially. Some Google3 builds use compilers old enough that they barf when compiling our NEON code. It's conceivably also possible to define JUMPER_IS_SCALAR yourself, but I don't think anyone does that. Original change's description: > Reland "make SkJumper stages normal Skia code" > > This is a reland of 22e536e3a1a09405d1c0e6f071717a726d86e8d4 > > Now with fixed #include paths in SkRasterPipeline_opts.h, > and -ffp-contract=fast for the :hsw target to minimize > diffs on non-Windows Clang AVX2/AVX-512 bots. > > Original change's description: > > make SkJumper stages normal Skia code > > > > Enough clients are using Clang now that we can say, use Clang to build > > if you want these software pipeline stages to go fast. > > > > This lets us drop the offline build aspect of SkJumper stages, instead > > building as part of Skia using the SkOpts framework. > > > > I think everything should work, except I've (temporarily) removed > > AVX-512 support. I will put this back in a follow up. > > > > I have had to drop Windows down to __vectorcall and our narrower > > stage calling convention that keeps the d-registers on the stack. > > I tried forcing sysv_abi, but that crashed Clang. :/ > > > > Added a TODO to up the same narrower stage calling convention > > for lowp stages... we just *don't* today, for no good reason. > > > > Change-Id: Iaaa792ffe4deab3508d2dc5d0008c163c24b3383 > > Reviewed-on: https://skia-review.googlesource.com/110641 > > Commit-Queue: Mike Klein <mtklein@chromium.org> > > Reviewed-by: Herb Derby <herb@google.com> > > Reviewed-by: Florin Malita <fmalita@chromium.org> > > Change-Id: I44f2c03d33958e3807747e40904b6351957dd448 > Reviewed-on: https://skia-review.googlesource.com/112742 > Reviewed-by: Mike Klein <mtklein@chromium.org> Change-Id: I3d71197d4bbb19ca4a94961a97fa2e54d5cbfb0d Reviewed-on: https://skia-review.googlesource.com/112744 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
2018-02-27 15:37:40 +00:00
opts("hsw") {
enabled = is_x86
sources = skia_opts.hsw_sources
if (is_win) {
Reland "Reland "make SkJumper stages normal Skia code"" This is a reland of 78cb579f33943421afc8423a39867fcfd69fed44 This time, lowp stages are controlled by !defined(JUMPER_IS_SCALAR), not by defined(__clang__). The two are usually the same, except when we opt Clang builds into JUMPER_IS_SCALAR artificially. Some Google3 builds use compilers old enough that they barf when compiling our NEON code. It's conceivably also possible to define JUMPER_IS_SCALAR yourself, but I don't think anyone does that. Original change's description: > Reland "make SkJumper stages normal Skia code" > > This is a reland of 22e536e3a1a09405d1c0e6f071717a726d86e8d4 > > Now with fixed #include paths in SkRasterPipeline_opts.h, > and -ffp-contract=fast for the :hsw target to minimize > diffs on non-Windows Clang AVX2/AVX-512 bots. > > Original change's description: > > make SkJumper stages normal Skia code > > > > Enough clients are using Clang now that we can say, use Clang to build > > if you want these software pipeline stages to go fast. > > > > This lets us drop the offline build aspect of SkJumper stages, instead > > building as part of Skia using the SkOpts framework. > > > > I think everything should work, except I've (temporarily) removed > > AVX-512 support. I will put this back in a follow up. > > > > I have had to drop Windows down to __vectorcall and our narrower > > stage calling convention that keeps the d-registers on the stack. > > I tried forcing sysv_abi, but that crashed Clang. :/ > > > > Added a TODO to up the same narrower stage calling convention > > for lowp stages... we just *don't* today, for no good reason. > > > > Change-Id: Iaaa792ffe4deab3508d2dc5d0008c163c24b3383 > > Reviewed-on: https://skia-review.googlesource.com/110641 > > Commit-Queue: Mike Klein <mtklein@chromium.org> > > Reviewed-by: Herb Derby <herb@google.com> > > Reviewed-by: Florin Malita <fmalita@chromium.org> > > Change-Id: I44f2c03d33958e3807747e40904b6351957dd448 > Reviewed-on: https://skia-review.googlesource.com/112742 > Reviewed-by: Mike Klein <mtklein@chromium.org> Change-Id: I3d71197d4bbb19ca4a94961a97fa2e54d5cbfb0d Reviewed-on: https://skia-review.googlesource.com/112744 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
2018-02-27 15:37:40 +00:00
cflags = [ "/arch:AVX2" ]
} else {
cflags = [ "-march=haswell" ]
Reland "Reland "make SkJumper stages normal Skia code"" This is a reland of 78cb579f33943421afc8423a39867fcfd69fed44 This time, lowp stages are controlled by !defined(JUMPER_IS_SCALAR), not by defined(__clang__). The two are usually the same, except when we opt Clang builds into JUMPER_IS_SCALAR artificially. Some Google3 builds use compilers old enough that they barf when compiling our NEON code. It's conceivably also possible to define JUMPER_IS_SCALAR yourself, but I don't think anyone does that. Original change's description: > Reland "make SkJumper stages normal Skia code" > > This is a reland of 22e536e3a1a09405d1c0e6f071717a726d86e8d4 > > Now with fixed #include paths in SkRasterPipeline_opts.h, > and -ffp-contract=fast for the :hsw target to minimize > diffs on non-Windows Clang AVX2/AVX-512 bots. > > Original change's description: > > make SkJumper stages normal Skia code > > > > Enough clients are using Clang now that we can say, use Clang to build > > if you want these software pipeline stages to go fast. > > > > This lets us drop the offline build aspect of SkJumper stages, instead > > building as part of Skia using the SkOpts framework. > > > > I think everything should work, except I've (temporarily) removed > > AVX-512 support. I will put this back in a follow up. > > > > I have had to drop Windows down to __vectorcall and our narrower > > stage calling convention that keeps the d-registers on the stack. > > I tried forcing sysv_abi, but that crashed Clang. :/ > > > > Added a TODO to up the same narrower stage calling convention > > for lowp stages... we just *don't* today, for no good reason. > > > > Change-Id: Iaaa792ffe4deab3508d2dc5d0008c163c24b3383 > > Reviewed-on: https://skia-review.googlesource.com/110641 > > Commit-Queue: Mike Klein <mtklein@chromium.org> > > Reviewed-by: Herb Derby <herb@google.com> > > Reviewed-by: Florin Malita <fmalita@chromium.org> > > Change-Id: I44f2c03d33958e3807747e40904b6351957dd448 > Reviewed-on: https://skia-review.googlesource.com/112742 > Reviewed-by: Mike Klein <mtklein@chromium.org> Change-Id: I3d71197d4bbb19ca4a94961a97fa2e54d5cbfb0d Reviewed-on: https://skia-review.googlesource.com/112744 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
2018-02-27 15:37:40 +00:00
}
# Oddly, clang-cl doesn't recognize this as a valid flag.
# If it ever does, it'd nice to move this up with -mavx2 and co.
if (is_clang && !is_win) {
# This flag lets Clang generate FMAs when it sees a mul-then-add. It's optional,
# but nice to have, generating slightly better code for paths without explicit FMAs.
cflags += [ "-ffp-contract=fast" ]
}
}
# Any feature of Skia that requires third-party code should be optional and use this template.
template("optional") {
visibility = [ ":*" ]
if (invoker.enabled) {
config(target_name + "_public") {
if (defined(invoker.public_defines)) {
defines = invoker.public_defines
}
if (defined(invoker.public_configs)) {
configs = invoker.public_configs
}
}
source_set(target_name) {
check_includes = false
forward_variables_from(invoker,
"*",
[
"public_defines",
"sources_when_disabled",
"configs_to_remove",
])
all_dependent_configs = [ ":" + target_name + "_public" ]
configs += skia_library_configs
if (defined(invoker.configs_to_remove)) {
configs -= invoker.configs_to_remove
}
}
} else {
source_set(target_name) {
forward_variables_from(invoker,
"*",
[
"public_defines",
Reland "Move gn setup for vulkan library/headers into their own third_party directory." This reverts commit 2c2a119f945eedaced4bf081347a53f05cf0c39c. Reason for revert: Relanding with fixes Original change's description: > Revert "Move gn setup for vulkan library/headers into their own third_party directory." > > This reverts commit 477094250cd55a38d4d796ab6c50eb57bdba65e1. > > Reason for revert: > I think we know this broke the MoltenVK bots. It also appears to have broken the Fuchsia roll: https://logs.chromium.org/v/?s=fuchsia%2Fbuildbucket%2Fcr-buildbucket.appspot.com%2F8945885190914943680%2F%2B%2Fsteps%2Fbuild%2F0%2Fsteps%2Fbuild_fuchsia%2F0%2Fsteps%2Fgn_gen%2F0%2Fstdout > > Original change's description: > > Move gn setup for vulkan library/headers into their own third_party directory. > > > > Bug: skia: > > Change-Id: I4605f0d962271efb77bf3c17f1b0daaaddfb51c8 > > Reviewed-on: https://skia-review.googlesource.com/128540 > > Commit-Queue: Greg Daniel <egdaniel@google.com> > > Reviewed-by: Mike Klein <mtklein@google.com> > > Reviewed-by: Ben Wagner <bungeman@google.com> > > TBR=egdaniel@google.com,mtklein@google.com,bungeman@google.com > > Change-Id: I6e41d98e39883eff34424a2f352b0c8adec178db > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/129444 > Reviewed-by: Mike Klein <mtklein@google.com> > Commit-Queue: Mike Klein <mtklein@google.com> Bug: skia: Change-Id: I26b4b1f7196dd1bd8bf2e7641ef741c90c742c81 Reviewed-on: https://skia-review.googlesource.com/129445 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-05-22 17:25:15 +00:00
"public_deps",
"deps",
"libs",
"sources",
"sources_when_disabled",
"configs_to_remove",
])
if (defined(invoker.sources_when_disabled)) {
sources = invoker.sources_when_disabled
}
configs += skia_library_configs
}
}
}
optional("fontmgr_android") {
enabled = skia_enable_fontmgr_android
deps = [
":typeface_freetype",
"//third_party/expat",
]
sources = [
"src/ports/SkFontMgr_android.cpp",
"src/ports/SkFontMgr_android_factory.cpp",
"src/ports/SkFontMgr_android_parser.cpp",
]
}
optional("fontmgr_custom") {
enabled = skia_enable_fontmgr_custom
deps = [
":typeface_freetype",
]
sources = [
"src/ports/SkFontMgr_custom.cpp",
"src/ports/SkFontMgr_custom.h",
"src/ports/SkFontMgr_custom_directory.cpp",
"src/ports/SkFontMgr_custom_directory_factory.cpp",
"src/ports/SkFontMgr_custom_embedded.cpp",
"src/ports/SkFontMgr_custom_empty.cpp",
]
}
optional("fontmgr_custom_empty") {
enabled = skia_enable_fontmgr_custom_empty
deps = [
":typeface_freetype",
]
sources = [
"src/ports/SkFontMgr_custom.cpp",
"src/ports/SkFontMgr_custom_empty.cpp",
"src/ports/SkFontMgr_custom_empty_factory.cpp",
]
}
optional("fontmgr_empty") {
enabled = skia_enable_fontmgr_empty
sources = [
"src/ports/SkFontMgr_empty_factory.cpp",
]
}
optional("fontmgr_fontconfig") {
enabled = skia_use_freetype && skia_use_fontconfig
deps = [
":typeface_freetype",
"//third_party:fontconfig",
]
sources = [
"src/ports/SkFontConfigInterface.cpp",
"src/ports/SkFontConfigInterface_direct.cpp",
"src/ports/SkFontConfigInterface_direct_factory.cpp",
"src/ports/SkFontMgr_FontConfigInterface.cpp",
"src/ports/SkFontMgr_fontconfig.cpp",
"src/ports/SkFontMgr_fontconfig_factory.cpp",
]
}
optional("fontmgr_fuchsia") {
enabled = skia_enable_fontmgr_fuchsia
deps = [
"//sdk/fidl/fuchsia.fonts",
]
sources = [
"src/ports/SkFontMgr_fuchsia.cpp",
"src/ports/SkFontMgr_fuchsia.h",
]
}
optional("fontmgr_wasm") {
enabled = target_cpu == "wasm"
deps = [
":typeface_freetype",
]
sources = [
"src/ports/SkFontMgr_custom.cpp",
"src/ports/SkFontMgr_custom.h",
"src/ports/SkFontMgr_custom_embedded.cpp",
"src/ports/SkFontMgr_custom_embedded_factory.cpp",
]
}
optional("fontmgr_win") {
enabled = skia_enable_fontmgr_win
sources = [
"src/fonts/SkFontMgr_indirect.cpp",
"src/ports/SkFontMgr_win_dw.cpp",
"src/ports/SkFontMgr_win_dw_factory.cpp",
"src/ports/SkScalerContext_win_dw.cpp",
"src/ports/SkTypeface_win_dw.cpp",
]
}
optional("fontmgr_win_gdi") {
enabled = skia_enable_fontmgr_win_gdi
sources = [
"src/ports/SkFontHost_win.cpp",
]
libs = [ "Gdi32.lib" ]
}
if (skia_lex) {
executable("sksllex") {
sources = [
"src/sksl/lex/Main.cpp",
"src/sksl/lex/NFA.cpp",
"src/sksl/lex/RegexNode.cpp",
"src/sksl/lex/RegexParser.cpp",
]
include_dirs = [ "src/sksl/lex" ]
}
action("run_sksllex") {
script = "gn/run_sksllex.py"
deps = [
":sksllex(//gn/toolchain:$host_toolchain)",
]
sources = [
"src/sksl/lex/sksl.lex",
]
# GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
# path that starts with target_out_dir and then uses ".." to back up into the src dir.
outputs = [
"$target_out_dir/" +
rebase_path("src/sksl/lex/SkSLLexer.h", target_out_dir),
# the script also modifies the corresponding .cpp file, but if we tell GN that it gets
# confused due to the same file being named by two different paths
]
sksllex_path = "$root_out_dir/"
sksllex_path += "sksllex"
if (host_os == "win") {
sksllex_path += ".exe"
}
args = [
rebase_path(sksllex_path),
rebase_path("bin/clang-format"),
rebase_path("src"),
]
}
} else {
group("run_sksllex") {
}
}
if (skia_compile_processors) {
executable("skslc") {
defines = [ "SKSL_STANDALONE" ]
sources = [
"src/sksl/SkSLMain.cpp",
]
sources += skia_sksl_sources
include_dirs = [
"src/gpu",
"src/sksl",
]
deps = [
":run_sksllex",
"//third_party/spirv-tools",
]
}
skia_gpu_processor_outputs = []
foreach(src, skia_gpu_processor_sources) {
dir = get_path_info(src, "dir")
name = get_path_info(src, "name")
# GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
# path that starts with target_out_dir and then uses ".." to back up into the src dir.
skia_gpu_processor_outputs += [
"$target_out_dir/" + rebase_path("$dir/$name.h", target_out_dir),
# the script also modifies the corresponding .cpp file, but if we tell GN that it gets
# confused due to the same file being named by two different paths
]
}
action("create_sksl_enums") {
script = "gn/create_sksl_enums.py"
sources = [
"include/private/GrSharedEnums.h",
]
outputs = [
"$target_out_dir/" +
rebase_path("src/sksl/sksl_enums.inc", target_out_dir),
]
args = [
rebase_path(sources[0]),
rebase_path(outputs[0]),
]
}
action("compile_processors") {
script = "gn/compile_processors.py"
deps = [
":create_sksl_enums",
":skslc(//gn/toolchain:$host_toolchain)",
]
sources = skia_gpu_processor_sources
outputs = skia_gpu_processor_outputs
skslc_path = "$root_out_dir/"
if (host_toolchain != default_toolchain_name) {
skslc_path += "$host_toolchain/"
}
skslc_path += "skslc"
if (host_os == "win") {
skslc_path += ".exe"
}
args = [
rebase_path(skslc_path),
rebase_path("bin/clang-format"),
]
args += rebase_path(skia_gpu_processor_sources)
}
} else {
skia_gpu_processor_outputs = []
group("compile_processors") {
}
}
optional("gpu") {
enabled = skia_enable_gpu
deps = [
":compile_processors",
":run_sksllex",
]
if (skia_generate_workarounds) {
deps += [ ":workaround_list" ]
}
public_defines = []
public_configs = []
Reland "Move gn setup for vulkan library/headers into their own third_party directory." This reverts commit 2c2a119f945eedaced4bf081347a53f05cf0c39c. Reason for revert: Relanding with fixes Original change's description: > Revert "Move gn setup for vulkan library/headers into their own third_party directory." > > This reverts commit 477094250cd55a38d4d796ab6c50eb57bdba65e1. > > Reason for revert: > I think we know this broke the MoltenVK bots. It also appears to have broken the Fuchsia roll: https://logs.chromium.org/v/?s=fuchsia%2Fbuildbucket%2Fcr-buildbucket.appspot.com%2F8945885190914943680%2F%2B%2Fsteps%2Fbuild%2F0%2Fsteps%2Fbuild_fuchsia%2F0%2Fsteps%2Fgn_gen%2F0%2Fstdout > > Original change's description: > > Move gn setup for vulkan library/headers into their own third_party directory. > > > > Bug: skia: > > Change-Id: I4605f0d962271efb77bf3c17f1b0daaaddfb51c8 > > Reviewed-on: https://skia-review.googlesource.com/128540 > > Commit-Queue: Greg Daniel <egdaniel@google.com> > > Reviewed-by: Mike Klein <mtklein@google.com> > > Reviewed-by: Ben Wagner <bungeman@google.com> > > TBR=egdaniel@google.com,mtklein@google.com,bungeman@google.com > > Change-Id: I6e41d98e39883eff34424a2f352b0c8adec178db > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/129444 > Reviewed-by: Mike Klein <mtklein@google.com> > Commit-Queue: Mike Klein <mtklein@google.com> Bug: skia: Change-Id: I26b4b1f7196dd1bd8bf2e7641ef741c90c742c81 Reviewed-on: https://skia-review.googlesource.com/129445 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-05-22 17:25:15 +00:00
public_deps = []
sources = skia_gpu_sources + skia_sksl_sources + skia_gpu_processor_outputs
if (!skia_enable_ccpr) {
sources -= skia_ccpr_sources
sources += [ "src/gpu/ccpr/GrCoverageCountingPathRenderer_none.cpp" ]
}
if (!skia_enable_nvpr) {
sources -= skia_nvpr_sources
sources += [ "src/gpu/GrPathRendering_none.cpp" ]
}
# These paths need to be absolute to match the ones produced by shared_sources.gni.
sources -= get_path_info([ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ],
"abspath")
libs = []
if (is_android) {
sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
# this lib is required to link against AHardwareBuffer
if (defined(ndk_api) && ndk_api >= 26) {
libs += [ "android" ]
}
} else if (skia_use_egl) {
sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
libs += [ "EGL" ]
} else if (is_linux && skia_use_x11) {
sources += [ "src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp" ]
libs += [ "GL" ]
} else if (is_mac) {
sources += [ "src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp" ]
} else if (is_ios) {
sources += [ "src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp" ]
} else if (is_win) {
sources += [ "src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp" ]
if (target_cpu != "arm64") {
libs += [ "OpenGL32.lib" ]
}
} else {
sources += [ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ]
}
if (skia_use_vulkan) {
public_defines += [ "SK_VULKAN" ]
deps += [ "third_party/vulkanmemoryallocator" ]
sources += skia_vk_sources
if (skia_enable_vulkan_debug_layers) {
public_defines += [ "SK_ENABLE_VK_LAYERS" ]
}
if (is_fuchsia) {
public_deps +=
[ "//third_party/vulkan_loader_and_validation_layers:vulkan" ]
}
}
Reland "Move gn setup for vulkan library/headers into their own third_party directory." This reverts commit 2c2a119f945eedaced4bf081347a53f05cf0c39c. Reason for revert: Relanding with fixes Original change's description: > Revert "Move gn setup for vulkan library/headers into their own third_party directory." > > This reverts commit 477094250cd55a38d4d796ab6c50eb57bdba65e1. > > Reason for revert: > I think we know this broke the MoltenVK bots. It also appears to have broken the Fuchsia roll: https://logs.chromium.org/v/?s=fuchsia%2Fbuildbucket%2Fcr-buildbucket.appspot.com%2F8945885190914943680%2F%2B%2Fsteps%2Fbuild%2F0%2Fsteps%2Fbuild_fuchsia%2F0%2Fsteps%2Fgn_gen%2F0%2Fstdout > > Original change's description: > > Move gn setup for vulkan library/headers into their own third_party directory. > > > > Bug: skia: > > Change-Id: I4605f0d962271efb77bf3c17f1b0daaaddfb51c8 > > Reviewed-on: https://skia-review.googlesource.com/128540 > > Commit-Queue: Greg Daniel <egdaniel@google.com> > > Reviewed-by: Mike Klein <mtklein@google.com> > > Reviewed-by: Ben Wagner <bungeman@google.com> > > TBR=egdaniel@google.com,mtklein@google.com,bungeman@google.com > > Change-Id: I6e41d98e39883eff34424a2f352b0c8adec178db > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/129444 > Reviewed-by: Mike Klein <mtklein@google.com> > Commit-Queue: Mike Klein <mtklein@google.com> Bug: skia: Change-Id: I26b4b1f7196dd1bd8bf2e7641ef741c90c742c81 Reviewed-on: https://skia-review.googlesource.com/129445 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-05-22 17:25:15 +00:00
if (skia_enable_spirv_validation) {
deps += [ "//third_party/spirv-tools" ]
public_defines += [ "SK_ENABLE_SPIRV_VALIDATION" ]
}
cflags_objcc = []
if (skia_use_metal) {
public_defines += [ "SK_METAL" ]
sources += skia_metal_sources
libs += [ "Metal.framework" ]
libs += [ "Foundation.framework" ]
cflags_objcc += [ "-fobjc-arc" ]
}
if (skia_enable_atlas_text) {
sources += skia_atlas_text_sources
}
if (is_debug) {
public_defines += [ "SK_ENABLE_DUMP_GPU" ]
}
}
optional("gif") {
enabled = !skia_use_wuffs
sources = [
"src/codec/SkGifCodec.cpp",
"third_party/gif/SkGifImageReader.cpp",
]
}
optional("heif") {
enabled = skia_use_libheif
public_defines = [ "SK_HAS_HEIF_LIBRARY" ]
deps = []
sources = [
"src/codec/SkHeifCodec.cpp",
]
}
optional("jpeg") {
enabled = skia_use_libjpeg_turbo
public_defines = [ "SK_HAS_JPEG_LIBRARY" ]
deps = [
"//third_party/libjpeg-turbo:libjpeg",
]
public = [
"include/encode/SkJpegEncoder.h",
]
sources = [
"src/codec/SkJpegCodec.cpp",
"src/codec/SkJpegDecoderMgr.cpp",
"src/codec/SkJpegUtility.cpp",
"src/images/SkJPEGWriteUtility.cpp",
"src/images/SkJpegEncoder.cpp",
]
}
optional("pdf") {
enabled = skia_use_zlib && skia_enable_pdf
public_defines = [ "SK_SUPPORT_PDF" ]
deps = [
"//third_party/zlib",
]
if (skia_use_libjpeg_turbo) {
deps += [ ":jpeg" ]
}
sources = skia_pdf_sources
sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
if (skia_use_icu && skia_use_harfbuzz && skia_pdf_subset_harfbuzz) {
deps += [ "//third_party/harfbuzz" ]
defines = [ "SK_PDF_USE_HARFBUZZ_SUBSET" ]
} else if (skia_use_icu && skia_use_sfntly) {
deps += [ "//third_party/sfntly" ]
defines = [ "SK_PDF_USE_SFNTLY" ]
}
}
optional("png") {
enabled = skia_use_libpng
public_defines = [ "SK_HAS_PNG_LIBRARY" ]
deps = [
"//third_party/libpng",
]
sources = [
"src/codec/SkIcoCodec.cpp",
"src/codec/SkPngCodec.cpp",
"src/images/SkPngEncoder.cpp",
]
}
optional("raw") {
enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo && skia_use_piex
public_defines = [ "SK_CODEC_DECODES_RAW" ]
deps = [
"//third_party/dng_sdk",
"//third_party/libjpeg-turbo:libjpeg",
"//third_party/piex",
]
# SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
# Skia.
configs_to_remove = [ "//gn:no_exceptions" ]
sources = [
"src/codec/SkRawCodec.cpp",
]
}
import("third_party/skcms/skcms.gni")
source_set("skcms") {
cflags = []
if (!is_win || is_clang) {
cflags += [
"-w",
"-std=c11",
]
}
public = [
"third_party/skcms/skcms.h",
]
sources = rebase_path(skcms_sources, ".", "third_party/skcms")
}
optional("typeface_freetype") {
enabled = skia_use_freetype
deps = [
"//third_party/freetype2",
]
sources = [
"src/ports/SkFontHost_FreeType.cpp",
"src/ports/SkFontHost_FreeType_common.cpp",
]
}
optional("webp") {
enabled = skia_use_libwebp
public_defines = [ "SK_HAS_WEBP_LIBRARY" ]
deps = [
"//third_party/libwebp",
]
sources = [
"src/codec/SkWebpCodec.cpp",
"src/images/SkWebpEncoder.cpp",
]
}
optional("wuffs") {
enabled = skia_use_wuffs
public_defines = [ "SK_HAS_WUFFS_LIBRARY" ]
deps = [
"//third_party/wuffs",
]
sources = [
"src/codec/SkWuffsCodec.cpp",
]
}
optional("xml") {
enabled = skia_use_expat
Revert "Revert "GN: define SK_XML to indicate :xml is enabled."" This reverts commit 7e8f80a08444f534376a25d45194c92f948c9594. Reason for revert: the SVG DM flakiness should be fixed by now. Original change's description: > Revert "GN: define SK_XML to indicate :xml is enabled." > > This reverts commit 7234448c11b0493a072723acd185dae986103df6. > > Reason for revert: this enabled tests which are making the bots flaky. > > Original change's description: > > GN: define SK_XML to indicate :xml is enabled. > > > > Without this, nothing ever defines SK_XML for dm/DM.cpp, dm/DMSrcSink.cpp, tests/SkDOMTest.cpp or tests/SkPEGTest.cpp. > > > > GYP does something similiar in gyp/xml.gyp. > > > > BUG=skia: > > > > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4500 > > > > Change-Id: I93322722d6d86f5802495d7a2edad2f82ba36f69 > > Reviewed-on: https://skia-review.googlesource.com/4500 > > Reviewed-by: Hal Canary <halcanary@google.com> > > Commit-Queue: Eric Boren <borenet@google.com> > > Commit-Queue: Mike Klein <mtklein@chromium.org> > > > > TBR=mtklein@chromium.org,borenet@google.com,halcanary@google.com > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > > Change-Id: I46c198f4985f6e7f96c07b3100a3877ba46fdb18 > Reviewed-on: https://skia-review.googlesource.com/4526 > Commit-Queue: Mike Klein <mtklein@chromium.org> > Reviewed-by: Mike Klein <mtklein@chromium.org> > TBR=mtklein@chromium.org,borenet@google.com,halcanary@google.com,fmalita@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Ic3225f119dff3c6949a3b559ac60707d36bc3792 Reviewed-on: https://skia-review.googlesource.com/4544 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org>
2016-11-08 16:07:52 +00:00
public_defines = [ "SK_XML" ]
deps = [
"//third_party/expat",
]
sources = [
"src/svg/SkSVGCanvas.cpp",
"src/svg/SkSVGDevice.cpp",
"src/xml/SkDOM.cpp",
"src/xml/SkXMLParser.cpp",
"src/xml/SkXMLWriter.cpp",
]
}
if (skia_enable_gpu && skia_generate_workarounds) {
action("workaround_list") {
script = "tools/build_workaround_header.py"
inputs = [
"src/gpu/gpu_workaround_list.txt",
]
# see comments in skia_compile_processors about out dir path shenanigans.
output_file =
rebase_path("include/gpu/GrDriverBugWorkaroundsAutogen.h", root_out_dir)
outputs = [
"$root_out_dir/$output_file",
]
args = [
"--output-file",
"$output_file",
]
foreach(file, inputs) {
args += [ rebase_path(file, root_build_dir) ]
}
}
}
component("skia") {
public_configs = [ ":skia_public" ]
configs += skia_library_configs
public_deps = [
":gpu",
":pdf",
":skcms",
]
deps = [
":arm64",
":armv7",
":avx",
Reland "simplify disabling effect deserialization" This reverts commit 34d7a163a4a749d6e91cf768d0f1767e8da6ceb2. Reason for revert: ok now? Original change's description: > Revert "simplify disabling effect deserialization" > > This reverts commit 5bbf790b5beeb2ed74f04551502259b54ac5556f. > > Reason for revert: flutter GN needs some love > > Original change's description: > > simplify disabling effect deserialization > > > > Switch to a simple #define instead of conditional build targets. > > > > No one changes skia_enable_effects or skia_enable_effects_imagefilters, > > so we can merge all that together back into :skia. > > > > Change-Id: I2985f95ee89149ddc687dc31f4c6bf35cb3a93c7 > > Reviewed-on: https://skia-review.googlesource.com/c/169220 > > Reviewed-by: Kevin Lubick <kjlubick@google.com> > > Commit-Queue: Mike Klein <mtklein@google.com> > > TBR=mtklein@google.com,kjlubick@google.com > > Change-Id: I3b818418d303dbc6d2a926a19df64a68499f0ec3 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://skia-review.googlesource.com/c/169222 > Reviewed-by: Mike Klein <mtklein@google.com> > Commit-Queue: Mike Klein <mtklein@google.com> TBR=mtklein@google.com,kjlubick@google.com Cq-Include-Trybots: skia.primary:Build-Debian9-Clang-arm-Release-Flutter_Android Change-Id: I534346c3ef3561a871f1af6df976bfee0b48014a No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/c/169640 Commit-Queue: Mike Klein <mtklein@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
2018-11-08 12:08:05 +00:00
":compile_processors",
":crc32",
":fontmgr_android",
":fontmgr_custom",
":fontmgr_custom_empty",
":fontmgr_empty",
":fontmgr_fontconfig",
":fontmgr_fuchsia",
":fontmgr_wasm",
":fontmgr_win",
":fontmgr_win_gdi",
":gif",
":heif",
Reland "Reland "make SkJumper stages normal Skia code"" This is a reland of 78cb579f33943421afc8423a39867fcfd69fed44 This time, lowp stages are controlled by !defined(JUMPER_IS_SCALAR), not by defined(__clang__). The two are usually the same, except when we opt Clang builds into JUMPER_IS_SCALAR artificially. Some Google3 builds use compilers old enough that they barf when compiling our NEON code. It's conceivably also possible to define JUMPER_IS_SCALAR yourself, but I don't think anyone does that. Original change's description: > Reland "make SkJumper stages normal Skia code" > > This is a reland of 22e536e3a1a09405d1c0e6f071717a726d86e8d4 > > Now with fixed #include paths in SkRasterPipeline_opts.h, > and -ffp-contract=fast for the :hsw target to minimize > diffs on non-Windows Clang AVX2/AVX-512 bots. > > Original change's description: > > make SkJumper stages normal Skia code > > > > Enough clients are using Clang now that we can say, use Clang to build > > if you want these software pipeline stages to go fast. > > > > This lets us drop the offline build aspect of SkJumper stages, instead > > building as part of Skia using the SkOpts framework. > > > > I think everything should work, except I've (temporarily) removed > > AVX-512 support. I will put this back in a follow up. > > > > I have had to drop Windows down to __vectorcall and our narrower > > stage calling convention that keeps the d-registers on the stack. > > I tried forcing sysv_abi, but that crashed Clang. :/ > > > > Added a TODO to up the same narrower stage calling convention > > for lowp stages... we just *don't* today, for no good reason. > > > > Change-Id: Iaaa792ffe4deab3508d2dc5d0008c163c24b3383 > > Reviewed-on: https://skia-review.googlesource.com/110641 > > Commit-Queue: Mike Klein <mtklein@chromium.org> > > Reviewed-by: Herb Derby <herb@google.com> > > Reviewed-by: Florin Malita <fmalita@chromium.org> > > Change-Id: I44f2c03d33958e3807747e40904b6351957dd448 > Reviewed-on: https://skia-review.googlesource.com/112742 > Reviewed-by: Mike Klein <mtklein@chromium.org> Change-Id: I3d71197d4bbb19ca4a94961a97fa2e54d5cbfb0d Reviewed-on: https://skia-review.googlesource.com/112744 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
2018-02-27 15:37:40 +00:00
":hsw",
":jpeg",
":none",
":png",
":raw",
":sse2",
":sse41",
":sse42",
":ssse3",
":webp",
":wuffs",
":xml",
]
if (skia_enable_nima) {
deps += [ "//third_party/Nima-Cpp" ]
}
# This file (and all GN files in Skia) are designed to work with an
# empty sources assignment filter; we handle all that explicitly.
# We clear the filter here for clients who may have set up a global filter.
set_sources_assignment_filter([])
public = skia_core_public
public += skia_utils_public
public += skia_effects_public
public += skia_effects_imagefilter_public
public += skia_xps_public
sources = []
sources += skia_core_sources
sources += skia_utils_sources
if (skia_use_xps) {
sources += skia_xps_sources
}
Reland "simplify disabling effect deserialization" This reverts commit 34d7a163a4a749d6e91cf768d0f1767e8da6ceb2. Reason for revert: ok now? Original change's description: > Revert "simplify disabling effect deserialization" > > This reverts commit 5bbf790b5beeb2ed74f04551502259b54ac5556f. > > Reason for revert: flutter GN needs some love > > Original change's description: > > simplify disabling effect deserialization > > > > Switch to a simple #define instead of conditional build targets. > > > > No one changes skia_enable_effects or skia_enable_effects_imagefilters, > > so we can merge all that together back into :skia. > > > > Change-Id: I2985f95ee89149ddc687dc31f4c6bf35cb3a93c7 > > Reviewed-on: https://skia-review.googlesource.com/c/169220 > > Reviewed-by: Kevin Lubick <kjlubick@google.com> > > Commit-Queue: Mike Klein <mtklein@google.com> > > TBR=mtklein@google.com,kjlubick@google.com > > Change-Id: I3b818418d303dbc6d2a926a19df64a68499f0ec3 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://skia-review.googlesource.com/c/169222 > Reviewed-by: Mike Klein <mtklein@google.com> > Commit-Queue: Mike Klein <mtklein@google.com> TBR=mtklein@google.com,kjlubick@google.com Cq-Include-Trybots: skia.primary:Build-Debian9-Clang-arm-Release-Flutter_Android Change-Id: I534346c3ef3561a871f1af6df976bfee0b48014a No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/c/169640 Commit-Queue: Mike Klein <mtklein@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
2018-11-08 12:08:05 +00:00
sources += skia_effects_sources
sources += skia_effects_imagefilter_sources
sources += [
"src/android/SkAndroidFrameworkUtils.cpp",
"src/android/SkAnimatedImage.cpp",
"src/android/SkBitmapRegionCodec.cpp",
"src/android/SkBitmapRegionDecoder.cpp",
"src/codec/SkAndroidCodec.cpp",
"src/codec/SkAndroidCodecAdapter.cpp",
"src/codec/SkBmpBaseCodec.cpp",
"src/codec/SkBmpCodec.cpp",
"src/codec/SkBmpMaskCodec.cpp",
"src/codec/SkBmpRLECodec.cpp",
"src/codec/SkBmpStandardCodec.cpp",
"src/codec/SkCodec.cpp",
"src/codec/SkCodecImageGenerator.cpp",
"src/codec/SkColorTable.cpp",
"src/codec/SkEncodedInfo.cpp",
"src/codec/SkMaskSwizzler.cpp",
"src/codec/SkMasks.cpp",
"src/codec/SkSampledCodec.cpp",
"src/codec/SkSampler.cpp",
Add support for multiple frames in SkCodec Add an interface to decode frames beyond the first in SkCodec, and add an implementation for SkGifCodec. Add getFrameData to SkCodec. This method reads ahead in the stream to return a vector containing meta data about each frame in the image. This is not required in order to decode frames beyond the first, but it allows a client to learn extra information: - how long the frame should be displayed - whether a frame should be blended with a prior frame, allowing the client to provide the prior frame to speed up decoding Add a new fields to SkCodec::Options: - fFrameIndex - fHasPriorFrame The API is designed so that SkCodec never caches frames. If a client wants a frame beyond the first, they specify the frame in Options.fFrameIndex. If the client does not have the frame's required frame (the frame that this frame must be blended on top of) cached, they pass false for Options.fHasPriorFrame. Unless the frame is independent, the codec will then recursively decode all frames necessary to decode fFrameIndex. If the client has the required frame cached, they can put it in the dst they pass to the codec, and the codec will only draw fFrameIndex onto it. Replace SkGifCodec's scanline decoding support with progressive decoding, and update the tests accordingly. Implement new APIs in SkGifCodec. Instead of using gif_lib, use GIFImageReader, imported from Chromium (along with its copyright headers) with the following changes: - SkGifCodec is now the client - Replace blink types - Combine GIFColorMap::buildTable and ::getTable into a method that creates and returns an SkColorTable - Input comes from an SkStream, instead of a SegmentReader. Add SkStreamBuffer, which buffers the (potentially partial) stream in order to decode progressively. (FIXME: This requires copying data that previously was read directly from the SegmentReader. Does this hurt performance? If so, can we fix it?) - Remove UMA code - Instead of reporting screen width and height to the client, allow the client to query for it - Fail earlier if the first frame AND screen have size of zero - Compute required previous frame when adding a new one - Move GIFParseQuery from GIFImageDecoder to GIFImageReader - Allow parsing up to a specific frame (to skip parsing the rest of the stream if a client only wants the first frame) - Compute whether the first frame has alpha and supports index 8, to create the SkImageInfo. This happens before reporting that the size has been decoded. Add GIFImageDecoder::haveDecodedRow to SkGifCodec, imported from Chromium (along with its copyright header), with the following changes: - Add support for sampling - Use the swizzler - Keep track of the rows decoded - Do *not* keep track of whether we've seen alpha Remove SkCodec::kOutOfOrder_SkScanlineOrder, which was only used by GIF scanline decoding. Call onRewind even if there is no stream (SkGifCodec needs to clear its decoded state so it will decode from the beginning). Add a method to SkSwizzler to access the offset into the dst, taking subsetting into account. Add a GM that animates a GIF. Add tests for the new APIs. *** Behavior changes: * Previously, we reported that an image with a subset frame and no transparent index was opaque and used the background index (if present) to fill the background. This is necessary in order to support index 8, but it does not match viewers/browsers I have seen. Examples: - Chromium and Gimp render the background transparent - Firefox, Safari, Linux Image Viewer, Safari Preview clip to the frame (for a single frame image) This CL matches Chromium's behavior and renders the background transparent. This allows us to have consistent behavior across products and simplifies the code (relative to what we would have to do to continue the old behavior on Android). It also means that we will no longer support index 8 for some GIFs. * Stop checking for GIFSTAMP - all GIFs should be either 89a or 87a. This matches Chromium. I suspect that bugs would have been reported if valid GIFs started with "GIFVER" instead of "GIF89a" or "GIF87a" (but did not decode in Chromium). *** Future work not included in this CL: * Move some checks out of haveDecodedRow, since they are the same for the entire frame e.g. - intersecting the frameRect with the full image size - whether there is a color table * Change when we write transparent pixels - In some cases, Chromium deemed this unnecessary, but I suspect it is slower than the fallback case. There will continue to be cases where we should *not* write them, but for e.g. the first pass where we have already cleared to transparent (which we may also be able to skip) writing the transparent pixels will not make anything incorrect. * Report color type and alpha type per frame - Depending on alpha values, disposal methods, frame rects, etc, subsequent frames may have different properties than the first. * Skip copies of the encoded data - We copy the encoded data in case the stream is one that cannot be rewound, so we can parse and then decode (possibly not immediately). For some input streams, this is unnecessary. - I was concerned this cause a performance regression, but on average the new code is faster than the old for the images I tested [1]. - It may cause a performance regression for Chromium, though, where we can always move back in the stream, so this should be addressed. Design doc: https://docs.google.com/a/google.com/document/d/12Qhf9T92MWfdWujQwCIjhCO3sw6pTJB5pJBwDM1T7Kc/ [1] https://docs.google.com/a/google.com/spreadsheets/d/19V-t9BfbFw5eiwBTKA1qOBkZbchjlTC5EIz6HFy-6RI/ GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=2045293002 Review-Url: https://codereview.chromium.org/2045293002
2016-10-24 16:03:26 +00:00
"src/codec/SkStreamBuffer.cpp",
"src/codec/SkSwizzler.cpp",
"src/codec/SkWbmpCodec.cpp",
"src/images/SkImageEncoder.cpp",
"src/ports/SkDiscardableMemory_none.cpp",
Reland "simplify disabling effect deserialization" This reverts commit 34d7a163a4a749d6e91cf768d0f1767e8da6ceb2. Reason for revert: ok now? Original change's description: > Revert "simplify disabling effect deserialization" > > This reverts commit 5bbf790b5beeb2ed74f04551502259b54ac5556f. > > Reason for revert: flutter GN needs some love > > Original change's description: > > simplify disabling effect deserialization > > > > Switch to a simple #define instead of conditional build targets. > > > > No one changes skia_enable_effects or skia_enable_effects_imagefilters, > > so we can merge all that together back into :skia. > > > > Change-Id: I2985f95ee89149ddc687dc31f4c6bf35cb3a93c7 > > Reviewed-on: https://skia-review.googlesource.com/c/169220 > > Reviewed-by: Kevin Lubick <kjlubick@google.com> > > Commit-Queue: Mike Klein <mtklein@google.com> > > TBR=mtklein@google.com,kjlubick@google.com > > Change-Id: I3b818418d303dbc6d2a926a19df64a68499f0ec3 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://skia-review.googlesource.com/c/169222 > Reviewed-by: Mike Klein <mtklein@google.com> > Commit-Queue: Mike Klein <mtklein@google.com> TBR=mtklein@google.com,kjlubick@google.com Cq-Include-Trybots: skia.primary:Build-Debian9-Clang-arm-Release-Flutter_Android Change-Id: I534346c3ef3561a871f1af6df976bfee0b48014a No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/c/169640 Commit-Queue: Mike Klein <mtklein@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
2018-11-08 12:08:05 +00:00
"src/ports/SkGlobalInitialization_default.cpp",
"src/ports/SkImageGenerator_skia.cpp",
"src/ports/SkMemory_malloc.cpp",
"src/ports/SkOSFile_stdio.cpp",
"src/sfnt/SkOTTable_name.cpp",
"src/sfnt/SkOTUtils.cpp",
"src/utils/mac/SkStream_mac.cpp",
"third_party/etc1/etc1.cpp",
]
defines = []
if (!skia_enable_skpicture) {
defines = [ "SK_DISABLE_SKPICTURE" ]
public -= skia_skpicture_public
sources -= skia_skpicture_sources
Reland "simplify disabling effect deserialization" This reverts commit 34d7a163a4a749d6e91cf768d0f1767e8da6ceb2. Reason for revert: ok now? Original change's description: > Revert "simplify disabling effect deserialization" > > This reverts commit 5bbf790b5beeb2ed74f04551502259b54ac5556f. > > Reason for revert: flutter GN needs some love > > Original change's description: > > simplify disabling effect deserialization > > > > Switch to a simple #define instead of conditional build targets. > > > > No one changes skia_enable_effects or skia_enable_effects_imagefilters, > > so we can merge all that together back into :skia. > > > > Change-Id: I2985f95ee89149ddc687dc31f4c6bf35cb3a93c7 > > Reviewed-on: https://skia-review.googlesource.com/c/169220 > > Reviewed-by: Kevin Lubick <kjlubick@google.com> > > Commit-Queue: Mike Klein <mtklein@google.com> > > TBR=mtklein@google.com,kjlubick@google.com > > Change-Id: I3b818418d303dbc6d2a926a19df64a68499f0ec3 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://skia-review.googlesource.com/c/169222 > Reviewed-by: Mike Klein <mtklein@google.com> > Commit-Queue: Mike Klein <mtklein@google.com> TBR=mtklein@google.com,kjlubick@google.com Cq-Include-Trybots: skia.primary:Build-Debian9-Clang-arm-Release-Flutter_Android Change-Id: I534346c3ef3561a871f1af6df976bfee0b48014a No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/c/169640 Commit-Queue: Mike Klein <mtklein@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
2018-11-08 12:08:05 +00:00
sources -= [ "//src/effects/imagefilters/SkPictureImageFilter.cpp" ]
sources += [ "src/core/SkPicture_none.cpp" ]
}
libs = []
if (is_win) {
sources += [
"src/ports/SkDebug_win.cpp",
"src/ports/SkImageEncoder_WIC.cpp",
"src/ports/SkImageGeneratorWIC.cpp",
"src/ports/SkOSFile_win.cpp",
"src/ports/SkOSLibrary_win.cpp",
"src/ports/SkTLS_win.cpp",
]
libs += [
"FontSub.lib",
"Ole32.lib",
"OleAut32.lib",
"User32.lib",
"Usp10.lib",
]
} else {
sources += [
"src/ports/SkOSFile_posix.cpp",
"src/ports/SkOSLibrary_posix.cpp",
"src/ports/SkTLS_pthread.cpp",
]
libs += [ "dl" ]
}
if (is_android) {
deps += [ "//third_party/expat" ]
Strengthen is_official_build, update docs. This makes is_official_build turn off all development targets and features in Skia, including building third-party dependencies from source. This will intentionally break some external users, who will find themselves no longer able to find third-party headers or link against third-party libraries. These users have been building with our testing third-party dependencies unknowingly. They'll need to either explicitly turn back on building each dependency from source (skia_use_system_foo=false) or disable that dependency entirely (skia_use_foo=false). is_skia_standalone is now basically !is_official_build, so I've propagated that through, removing is_skia_standalone. In a few places we were using it as a stand-in for defined(ndk), so I've just written defined(ndk) there. Duh. gn_to_bp: is_offical_build's new strength also makes gn_to_bp.py simpler to write. In spirit, Android builds are official Skia builds that also build DM and nanobench. It seems that SkJumper (src/jumper/*) is (unintentionally) enabled on Android. Switching to an is_official_build would have disabled that. But as that accidental launch seems to have gone fine, I've kept it explicitly enabled. In the end, no changes to Android.bp or its SkUserConfig.h. The -Mini builder no longer needs to explicitly disable tools. CQ_INCLUDE_TRYBOTS=skia.primary:Build-Ubuntu-Clang-x86_64-Release-Mini Change-Id: Id06e53268a5caf55c6046ada354a0863c3031c73 Reviewed-on: https://skia-review.googlesource.com/9190 Reviewed-by: Leon Scroggins <scroggo@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-03-03 14:21:30 +00:00
if (defined(ndk) && ndk != "") {
deps += [ "//third_party/cpu-features" ]
}
sources += [ "src/ports/SkDebug_android.cpp" ]
libs += [
"EGL",
"GLESv2",
"log",
]
}
if (is_linux || target_cpu == "wasm") {
sources += [ "src/ports/SkDebug_stdio.cpp" ]
if (skia_use_egl) {
libs += [ "GLESv2" ]
}
}
if (skia_use_fonthost_mac) {
sources += [ "src/ports/SkFontHost_mac.cpp" ]
}
if (is_mac) {
sources += [
"src/ports/SkDebug_stdio.cpp",
"src/ports/SkImageEncoder_CG.cpp",
"src/ports/SkImageGeneratorCG.cpp",
]
libs += [
# AppKit symbols NSFontWeightXXX may be dlsym'ed.
"AppKit.framework",
"ApplicationServices.framework",
"OpenGL.framework",
]
}
if (is_ios) {
sources += [
"src/ports/SkDebug_stdio.cpp",
"src/ports/SkFontHost_mac.cpp",
"src/ports/SkImageEncoder_CG.cpp",
"src/ports/SkImageGeneratorCG.cpp",
]
libs += [
"CoreFoundation.framework",
"CoreGraphics.framework",
"CoreText.framework",
"ImageIO.framework",
"MobileCoreServices.framework",
# UIKit symbols UIFontWeightXXX may be dlsym'ed.
"UIKit.framework",
]
}
if (is_fuchsia) {
sources += [ "src/ports/SkDebug_stdio.cpp" ]
}
}
# DebugCanvas used in experimental/wasm-skp-debugger
if (target_cpu == "wasm") {
static_library("debugcanvas") {
public_configs = [ ":skia_public" ]
include_dirs = [
"include/gpu",
"include/private",
"src/gpu",
"src/core",
"src/shaders",
"src/utils",
"tools",
"tools/debugger",
]
sources = [
"tools/UrlDataManager.cpp",
"tools/debugger/SkDebugCanvas.cpp",
"tools/debugger/SkDrawCommand.cpp",
"tools/debugger/SkJsonWriteBuffer.cpp",
]
deps = [
":fontmgr_wasm",
]
}
}
static_library("pathkit") {
check_includes = false
public_configs = [ ":skia_public" ]
configs += skia_library_configs
deps = [
":arm64",
":armv7",
":avx",
":crc32",
":hsw",
":none",
":sse2",
":sse41",
":sse42",
":ssse3",
]
# This file (and all GN files in Skia) are designed to work with an
# empty sources assignment filter; we handle all that explicitly.
# We clear the filter here for clients who may have set up a global filter.
set_sources_assignment_filter([])
sources = []
sources += skia_pathops_sources
sources += skia_pathops_public
sources += [
"src/core/SkAnalyticEdge.cpp",
"src/core/SkArenaAlloc.cpp",
"src/core/SkContourMeasure.cpp",
"src/core/SkCubicMap.cpp",
"src/core/SkEdge.cpp",
"src/core/SkEdgeBuilder.cpp",
"src/core/SkEdgeClipper.cpp",
"src/core/SkGeometry.cpp",
"src/core/SkLineClipper.cpp",
"src/core/SkMallocPixelRef.cpp",
"src/core/SkMath.cpp",
"src/core/SkMatrix.cpp",
"src/core/SkOpts.cpp",
"src/core/SkPaint.cpp",
"src/core/SkPath.cpp",
"src/core/SkPathEffect.cpp",
"src/core/SkPathMeasure.cpp",
"src/core/SkPathRef.cpp",
"src/core/SkPoint.cpp",
"src/core/SkRRect.cpp",
"src/core/SkRect.cpp",
"src/core/SkSemaphore.cpp",
"src/core/SkStream.cpp",
"src/core/SkString.cpp",
"src/core/SkStringUtils.cpp",
"src/core/SkStroke.cpp",
"src/core/SkStrokeRec.cpp",
"src/core/SkStrokerPriv.cpp",
"src/core/SkThreadID.cpp",
"src/core/SkUtils.cpp",
"src/effects/SkDashPathEffect.cpp",
"src/effects/SkTrimPathEffect.cpp",
"src/ports/SkDebug_stdio.cpp",
"src/ports/SkMemory_malloc.cpp",
"src/utils/SkDashPath.cpp",
"src/utils/SkParse.cpp",
"src/utils/SkParsePath.cpp",
"src/utils/SkUTF.cpp",
]
}
group("modules") {
deps = [
"modules/particles",
"modules/skottie",
"modules/skshaper",
]
}
# Targets guarded by skia_enable_tools may use //third_party freely.
if (skia_enable_tools) {
# Used by gn_to_bp.py to list our public include dirs.
source_set("public") {
configs += [ ":skia_public" ]
}
config("skia.h_config") {
include_dirs = [ "$target_gen_dir" ]
}
action("skia.h") {
public_configs = [ ":skia.h_config" ]
skia_h = "$target_gen_dir/skia.h"
script = "gn/find_headers.py"
# TODO: would be cool to not hard-code these here, but how?
module_public_includes = [
"modules/sksg/include",
"modules/skottie/include",
]
args =
[ rebase_path("//bin/gn") ] + [ rebase_path("//") ] +
[ rebase_path(skia_h, root_build_dir) ] +
rebase_path(skia_public_includes) + rebase_path(module_public_includes)
depfile = "$skia_h.deps"
outputs = [
skia_h,
]
}
if (target_cpu == "x64") {
executable("fiddle") {
check_includes = false
libs = []
sources = [
"tools/fiddle/draw.cpp",
"tools/fiddle/fiddle_main.cpp",
]
if (skia_use_egl) {
sources += [ "tools/fiddle/egl_context.cpp" ]
} else {
sources += [ "tools/fiddle/null_context.cpp" ]
}
testonly = true
deps = [
":flags",
":gpu_tool_utils",
":skia",
":skia.h",
"modules/skottie",
]
}
}
source_set("public_headers_warnings_check") {
sources = [
"tools/public_headers_warnings_check.cpp",
]
configs -= [ "//gn:warnings_except_public_headers" ]
deps = [
":skia",
":skia.h",
"modules/skottie",
]
# We add this directory to simulate the client already have
# vulkan/vulkan_core.h on their path.
include_dirs = [ "include/third_party/vulkan" ]
}
template("test_lib") {
config(target_name + "_config") {
include_dirs = invoker.public_include_dirs
if (defined(invoker.public_defines)) {
defines = invoker.public_defines
}
}
source_set(target_name) {
forward_variables_from(invoker, "*", [ "public_include_dirs" ])
check_includes = false
public_configs = [
":" + target_name + "_config",
":skia_private",
]
if (!defined(deps)) {
deps = []
}
deps += [ ":skia" ]
testonly = true
}
}
template("test_app") {
if (is_ios) {
app_name = target_name
gen_path = target_gen_dir
action("${app_name}_generate_info_plist") {
script = "//gn/gen_plist_ios.py"
outputs = [
"$gen_path/${app_name}_Info.plist",
]
args = [ rebase_path("$gen_path/$app_name", root_build_dir) ]
}
bundle_data("${app_name}_bundle_info_plist") {
public_deps = [
":${app_name}_generate_info_plist",
]
sources = [
"$gen_path/${app_name}_Info.plist",
]
outputs = [
"{{bundle_root_dir}}/Info.plist",
]
}
bundle_ios_data =
defined(invoker.bundle_ios_data) && invoker.bundle_ios_data
if (bundle_ios_data) {
has_skps =
"True" == exec_script("//gn/checkdir.py",
[ rebase_path("skps", root_build_dir) ],
"trim string")
bundle_data("${app_name}_bundle_resources") {
sources = [
"resources",
]
outputs = [
# iOS reserves the folders 'Resources' and 'resources' so store one level deeper
"{{bundle_resources_dir}}/data/resources",
]
}
if (has_skps) {
bundle_data("${app_name}_bundle_skps") {
sources = [
"skps",
]
outputs = [
# Store in same folder as resources
"{{bundle_resources_dir}}/data/skps",
]
}
}
}
executable("${app_name}_generate_executable") {
forward_variables_from(invoker,
"*",
[
"output_name",
"visibility",
"is_shared_library",
])
configs += [ ":skia_private" ]
testonly = true
output_name = rebase_path("$gen_path/$app_name", root_build_dir)
}
bundle_data("${app_name}_bundle_executable") {
public_deps = [
":${app_name}_generate_executable",
]
sources = [
"$gen_path/$app_name",
]
outputs = [
"{{bundle_executable_dir}}/$app_name",
]
testonly = true
}
create_bundle("$app_name") {
product_type = "com.apple.product-type.application"
testonly = true
bundle_root_dir = "${root_build_dir}/${target_name}.app"
bundle_resources_dir = bundle_root_dir
bundle_executable_dir = bundle_root_dir
bundle_plugins_dir = bundle_root_dir + "/Plugins"
deps = [
":${app_name}_bundle_executable",
":${app_name}_bundle_info_plist",
]
if (bundle_ios_data) {
deps += [ ":${app_name}_bundle_resources" ]
if (has_skps) {
deps += [ ":${app_name}_bundle_skps" ]
}
}
# should only code sign when running on a device, not the simulator
if (target_cpu != "x64") {
code_signing_script = "//gn/codesign_ios.py"
code_signing_sources = [ "$target_gen_dir/$app_name" ]
code_signing_outputs = [
"$bundle_root_dir/_CodeSignature/CodeResources",
"$bundle_root_dir/embedded.mobileprovision",
]
code_signing_args = [
rebase_path("$bundle_root_dir", root_build_dir),
skia_ios_identity,
skia_ios_profile,
]
}
}
} else {
# !is_ios
if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
shared_library("lib" + target_name) {
forward_variables_from(invoker, "*", [ "is_shared_library" ])
configs += [ ":skia_private" ]
testonly = true
}
} else {
_executable = target_name
executable(_executable) {
check_includes = false
forward_variables_from(invoker, "*", [ "is_shared_library" ])
configs += [ ":skia_private" ]
testonly = true
}
}
if (is_android && skia_android_serial != "" && defined(_executable)) {
action("push_" + target_name) {
script = "gn/push_to_android.py"
deps = [
":" + _executable,
]
_stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
outputs = [
_stamp,
]
args = [
rebase_path("$root_build_dir/$_executable"),
skia_android_serial,
rebase_path(_stamp),
]
testonly = true
}
}
}
}
config("moltenvk_config") {
if (defined(skia_moltenvk_path) && skia_moltenvk_path != "") {
if (is_ios) {
moltenvk_framework_path = "$skia_moltenvk_path/MoltenVK/iOS"
} else {
moltenvk_framework_path = "$skia_moltenvk_path/MoltenVK/macOS"
}
cflags = [ "-F$moltenvk_framework_path" ]
ldflags = [ "-F$moltenvk_framework_path" ]
libs = [
"MoltenVK.framework",
"Metal.framework",
"IOSurface.framework",
"QuartzCore.framework",
"Foundation.framework",
]
if (is_ios) {
libs += [ "UIKit.framework" ]
} else {
libs += [ "IOKit.framework" ]
}
defines = [ "SK_MOLTENVK" ]
}
}
source_set("moltenvk") {
public_configs = [ ":moltenvk_config" ]
}
test_lib("gpu_tool_utils") {
public_include_dirs = []
public_defines = []
public_include_dirs += [ "tools/gpu" ]
deps = []
public_deps = []
sources = [
"tools/gpu/GrContextFactory.cpp",
"tools/gpu/GrTest.cpp",
"tools/gpu/MemoryCache.cpp",
"tools/gpu/MemoryCache.h",
"tools/gpu/ProxyUtils.cpp",
"tools/gpu/TestContext.cpp",
"tools/gpu/atlastext/GLTestAtlasTextRenderer.cpp",
"tools/gpu/gl/GLTestContext.cpp",
"tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp",
"tools/gpu/gl/null/NullGLTestContext.cpp",
"tools/gpu/mock/MockTestContext.cpp",
]
libs = []
if (is_android || skia_use_egl) {
sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
} else if (is_ios) {
sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
libs += [ "OpenGLES.framework" ]
} else if (is_linux) {
sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
libs += [
"GLU",
"X11",
]
} else if (is_mac) {
sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
} else if (is_win) {
sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
libs += [ "Gdi32.lib" ]
if (target_cpu != "arm64") {
libs += [ "OpenGL32.lib" ]
}
}
cflags_objcc = [ "-fobjc-arc" ]
if (skia_use_angle) {
deps += [ "//third_party/angle2" ]
sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
}
public_include_dirs += [ "include/third_party/vulkan" ]
if (skia_use_vulkan) {
sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
sources += [ "tools/gpu/vk/VkTestUtils.cpp" ]
if (defined(skia_moltenvk_path) && skia_moltenvk_path != "") {
public_deps += [ ":moltenvk" ]
}
}
if (skia_use_metal) {
sources += [ "tools/gpu/mtl/MtlTestContext.mm" ]
}
}
test_lib("flags") {
public_include_dirs = [ "tools/flags" ]
sources = [
"tools/flags/CommandLineFlags.cpp",
]
}
test_lib("common_flags") {
public_include_dirs = [ "tools/flags" ]
sources = [
"tools/flags/CommonFlags.cpp",
"tools/flags/CommonFlagsConfig.cpp",
]
deps = [
":flags",
]
public_deps = [
":gpu_tool_utils",
]
}
test_lib("tool_utils") {
public_include_dirs = [
"tools",
"tools/debugger",
"tools/fonts",
"tools/timer",
"tools/trace",
]
sources = [
"tools/AndroidSkDebugToStdOut.cpp",
"tools/CrashHandler.cpp",
"tools/DDLPromiseImageHelper.cpp",
"tools/DDLTileHelper.cpp",
"tools/LsanSuppressions.cpp",
"tools/ProcStats.cpp",
"tools/Resources.cpp",
"tools/ToolUtils.cpp",
"tools/UrlDataManager.cpp",
"tools/debugger/SkDebugCanvas.cpp",
"tools/debugger/SkDrawCommand.cpp",
"tools/debugger/SkJsonWriteBuffer.cpp",
"tools/fonts/RandomScalerContext.cpp",
"tools/fonts/TestEmptyTypeface.h",
"tools/fonts/TestFontMgr.cpp",
"tools/fonts/TestFontMgr.h",
"tools/fonts/TestSVGTypeface.cpp",
"tools/fonts/TestSVGTypeface.h",
"tools/fonts/TestTypeface.cpp",
"tools/fonts/TestTypeface.h",
"tools/fonts/ToolUtilsFont.cpp",
"tools/random_parse_path.cpp",
"tools/timer/AnimTimer.h",
"tools/timer/Timer.cpp",
"tools/trace/SkChromeTracingTracer.cpp",
"tools/trace/SkChromeTracingTracer.h",
"tools/trace/SkDebugfTracer.cpp",
"tools/trace/SkDebugfTracer.h",
"tools/trace/SkEventTracingPriv.cpp",
"tools/trace/SkEventTracingPriv.h",
]
libs = []
if (is_ios) {
sources += [ "tools/ios_utils.m" ]
libs += [ "Foundation.framework" ]
}
defines = []
if (skia_tools_require_resources) {
defines += [ "SK_TOOLS_REQUIRE_RESOURCES" ]
}
deps = [
":experimental_svg_model",
":flags",
"//third_party/libpng",
]
public_deps = [
":common_flags",
]
}
import("gn/gm.gni")
test_lib("gm") {
public_include_dirs = [ "gm" ]
sources = gm_sources
deps = [
Add support for multiple frames in SkCodec Add an interface to decode frames beyond the first in SkCodec, and add an implementation for SkGifCodec. Add getFrameData to SkCodec. This method reads ahead in the stream to return a vector containing meta data about each frame in the image. This is not required in order to decode frames beyond the first, but it allows a client to learn extra information: - how long the frame should be displayed - whether a frame should be blended with a prior frame, allowing the client to provide the prior frame to speed up decoding Add a new fields to SkCodec::Options: - fFrameIndex - fHasPriorFrame The API is designed so that SkCodec never caches frames. If a client wants a frame beyond the first, they specify the frame in Options.fFrameIndex. If the client does not have the frame's required frame (the frame that this frame must be blended on top of) cached, they pass false for Options.fHasPriorFrame. Unless the frame is independent, the codec will then recursively decode all frames necessary to decode fFrameIndex. If the client has the required frame cached, they can put it in the dst they pass to the codec, and the codec will only draw fFrameIndex onto it. Replace SkGifCodec's scanline decoding support with progressive decoding, and update the tests accordingly. Implement new APIs in SkGifCodec. Instead of using gif_lib, use GIFImageReader, imported from Chromium (along with its copyright headers) with the following changes: - SkGifCodec is now the client - Replace blink types - Combine GIFColorMap::buildTable and ::getTable into a method that creates and returns an SkColorTable - Input comes from an SkStream, instead of a SegmentReader. Add SkStreamBuffer, which buffers the (potentially partial) stream in order to decode progressively. (FIXME: This requires copying data that previously was read directly from the SegmentReader. Does this hurt performance? If so, can we fix it?) - Remove UMA code - Instead of reporting screen width and height to the client, allow the client to query for it - Fail earlier if the first frame AND screen have size of zero - Compute required previous frame when adding a new one - Move GIFParseQuery from GIFImageDecoder to GIFImageReader - Allow parsing up to a specific frame (to skip parsing the rest of the stream if a client only wants the first frame) - Compute whether the first frame has alpha and supports index 8, to create the SkImageInfo. This happens before reporting that the size has been decoded. Add GIFImageDecoder::haveDecodedRow to SkGifCodec, imported from Chromium (along with its copyright header), with the following changes: - Add support for sampling - Use the swizzler - Keep track of the rows decoded - Do *not* keep track of whether we've seen alpha Remove SkCodec::kOutOfOrder_SkScanlineOrder, which was only used by GIF scanline decoding. Call onRewind even if there is no stream (SkGifCodec needs to clear its decoded state so it will decode from the beginning). Add a method to SkSwizzler to access the offset into the dst, taking subsetting into account. Add a GM that animates a GIF. Add tests for the new APIs. *** Behavior changes: * Previously, we reported that an image with a subset frame and no transparent index was opaque and used the background index (if present) to fill the background. This is necessary in order to support index 8, but it does not match viewers/browsers I have seen. Examples: - Chromium and Gimp render the background transparent - Firefox, Safari, Linux Image Viewer, Safari Preview clip to the frame (for a single frame image) This CL matches Chromium's behavior and renders the background transparent. This allows us to have consistent behavior across products and simplifies the code (relative to what we would have to do to continue the old behavior on Android). It also means that we will no longer support index 8 for some GIFs. * Stop checking for GIFSTAMP - all GIFs should be either 89a or 87a. This matches Chromium. I suspect that bugs would have been reported if valid GIFs started with "GIFVER" instead of "GIF89a" or "GIF87a" (but did not decode in Chromium). *** Future work not included in this CL: * Move some checks out of haveDecodedRow, since they are the same for the entire frame e.g. - intersecting the frameRect with the full image size - whether there is a color table * Change when we write transparent pixels - In some cases, Chromium deemed this unnecessary, but I suspect it is slower than the fallback case. There will continue to be cases where we should *not* write them, but for e.g. the first pass where we have already cleared to transparent (which we may also be able to skip) writing the transparent pixels will not make anything incorrect. * Report color type and alpha type per frame - Depending on alpha values, disposal methods, frame rects, etc, subsequent frames may have different properties than the first. * Skip copies of the encoded data - We copy the encoded data in case the stream is one that cannot be rewound, so we can parse and then decode (possibly not immediately). For some input streams, this is unnecessary. - I was concerned this cause a performance regression, but on average the new code is faster than the old for the images I tested [1]. - It may cause a performance regression for Chromium, though, where we can always move back in the stream, so this should be addressed. Design doc: https://docs.google.com/a/google.com/document/d/12Qhf9T92MWfdWujQwCIjhCO3sw6pTJB5pJBwDM1T7Kc/ [1] https://docs.google.com/a/google.com/spreadsheets/d/19V-t9BfbFw5eiwBTKA1qOBkZbchjlTC5EIz6HFy-6RI/ GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=2045293002 Review-Url: https://codereview.chromium.org/2045293002
2016-10-24 16:03:26 +00:00
":flags",
":skia",
":tool_utils",
"modules/skottie",
"modules/skottie:gm",
"modules/sksg",
]
public_deps = [
":gpu_tool_utils",
]
if (skia_enable_skshaper) {
deps += [ "modules/skshaper" ]
defines = [ "SK_USING_SKSHAPER" ]
}
}
import("gn/tests.gni")
test_lib("tests") {
public_include_dirs = [ "tests" ]
sources = tests_sources + pathops_tests_sources
if (!skia_enable_fontmgr_android) {
sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ]
}
Reland "Implement onMakeClone(const SkFontArguments& args) in class SkTypeface_fontconfig." This reverts commit cce82d2b7c6ce3addd72016191e1be73bc084953. Reason for revert: Just add suppression. Original change's description: > Revert "Implement onMakeClone(const SkFontArguments& args) in class SkTypeface_fontconfig." > > This reverts commit 96b1ecc25d00a3d52dcc51a788b0df0acdd1dad9. > > Reason for revert: Breaking Google3, I think > > Original change's description: > > Implement onMakeClone(const SkFontArguments& args) in class SkTypeface_fontconfig. > > > > Create FontMgrFontConfigTest.cpp file to test the above function. > > > > Change-Id: I7716355f702af3d6f25574305914f0b82a4147ce > > Reviewed-on: https://skia-review.googlesource.com/137133 > > Reviewed-by: Ben Wagner <bungeman@google.com> > > Commit-Queue: Ben Wagner <bungeman@google.com> > > TBR=bungeman@google.com,herb@google.com,brucewang@google.com > > Change-Id: I665de46d379f1b533358f0be644814aa4bfffb33 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://skia-review.googlesource.com/137240 > Reviewed-by: Kevin Lubick <kjlubick@google.com> > Commit-Queue: Kevin Lubick <kjlubick@google.com> TBR=bungeman@google.com,herb@google.com,kjlubick@google.com,brucewang@google.com Change-Id: I41f0e4505ed0579a77a56212898e9a6caf6f1ed5 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/137260 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
2018-06-22 21:11:00 +00:00
if (!(skia_use_freetype && skia_use_fontconfig)) {
sources -= [ "//tests/FontMgrFontConfigTest.cpp" ]
}
deps = [
":experimental_svg_model",
":flags",
":skia",
":tool_utils",
"modules/skottie:tests",
"modules/sksg:tests",
"//third_party/libpng",
Reland "Treat kWEBP encode with quality=100 as lossless" This reverts commit 22170b317800325408310e144194d6c024d571bc. It was reverted due to the test breaking Google3. This includes a workaround. Original change's description: > Treat kWEBP encode with quality=100 as lossless > > In SkEncodeImage and friends, treat quality of 100 as a lossless encode > when using kWEBP. This seems a good fit for the intent - which is > presumably to save the highest quality image. This also matches > Chromium's blink::ImageEncoder::ComputeWebpOptions, which treats a > quality of 1 (on a float scale from 0 to 1) as a lossless encode. > > FWIW, Chromium has had this behavior since > https://codereview.chromium.org/1937433002, in response to > crbug.com/523098. The goal is to "maintain sharpness to > match the JPEG encoder behavior (use WEBP lossless encoding)". > > Add a test to verify the new behavior. This requires making tests > depend on libwebp to use WebPGetFeatures, since the Skia API does not > provide a way to determine whether an encoded webp file was encoded > lossless-ly or lossily. > > Bug: skia:8586 > Change-Id: Ie9e09c2f7414ab701d696c4ad9edf405868a716f > Reviewed-on: https://skia-review.googlesource.com/c/175823 > Commit-Queue: Leon Scroggins <scroggo@google.com> > Reviewed-by: Derek Sollenberger <djsollen@google.com> > Reviewed-by: Mike Reed <reed@google.com> TBR=reed@google.com, based on prior approval Bug: skia:8586 Change-Id: I09c73f71996422f797fd9456fef5dfad9af36839 Reviewed-on: https://skia-review.googlesource.com/c/194194 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com> Auto-Submit: Leon Scroggins <scroggo@google.com>
2019-02-22 17:32:16 +00:00
"//third_party/libwebp",
"//third_party/zlib",
]
public_deps = [
":gpu_tool_utils", # Test.h #includes headers from this target.
]
if (skia_enable_skshaper) {
deps += [ "modules/skshaper" ]
defines = [ "SK_USING_SKSHAPER" ]
}
}
import("gn/bench.gni")
test_lib("bench") {
public_include_dirs = [ "bench" ]
sources = bench_sources
deps = [
":flags",
":gm",
":gpu_tool_utils",
":skia",
":tool_utils",
]
}
test_lib("experimental_svg_model") {
public_include_dirs = []
if (skia_use_expat) {
public_include_dirs += [ "experimental/svg/model" ]
sources = [
"experimental/svg/model/SkSVGAttribute.cpp",
"experimental/svg/model/SkSVGAttributeParser.cpp",
"experimental/svg/model/SkSVGCircle.cpp",
"experimental/svg/model/SkSVGClipPath.cpp",
"experimental/svg/model/SkSVGContainer.cpp",
"experimental/svg/model/SkSVGDOM.cpp",
"experimental/svg/model/SkSVGEllipse.cpp",
"experimental/svg/model/SkSVGGradient.cpp",
"experimental/svg/model/SkSVGLine.cpp",
"experimental/svg/model/SkSVGLinearGradient.cpp",
"experimental/svg/model/SkSVGNode.cpp",
"experimental/svg/model/SkSVGPath.cpp",
"experimental/svg/model/SkSVGPattern.cpp",
"experimental/svg/model/SkSVGPoly.cpp",
"experimental/svg/model/SkSVGRadialGradient.cpp",
"experimental/svg/model/SkSVGRect.cpp",
"experimental/svg/model/SkSVGRenderContext.cpp",
"experimental/svg/model/SkSVGSVG.cpp",
"experimental/svg/model/SkSVGShape.cpp",
"experimental/svg/model/SkSVGStop.cpp",
"experimental/svg/model/SkSVGTransformableNode.cpp",
"experimental/svg/model/SkSVGUse.cpp",
"experimental/svg/model/SkSVGValue.cpp",
]
deps = [
":skia",
":xml",
]
}
}
if (skia_use_lua) {
test_lib("lua") {
public_include_dirs = []
sources = [
"src/utils/SkLua.cpp",
"src/utils/SkLuaCanvas.cpp",
]
deps = [
"modules/skshaper",
"//third_party/lua",
]
}
test_app("lua_app") {
sources = [
"tools/lua/lua_app.cpp",
]
deps = [
":lua",
":skia",
"//third_party/lua",
]
}
test_app("lua_pictures") {
sources = [
"tools/lua/lua_pictures.cpp",
]
deps = [
":flags",
":lua",
":skia",
":tool_utils",
"//third_party/lua",
]
}
}
test_app("bookmaker") {
sources = [
"tools/bookmaker/bmhParser.cpp",
"tools/bookmaker/bookmaker.cpp",
"tools/bookmaker/cataloger.cpp",
"tools/bookmaker/definition.cpp",
"tools/bookmaker/fiddleParser.cpp",
"tools/bookmaker/hackParser.cpp",
"tools/bookmaker/includeParser.cpp",
"tools/bookmaker/includeWriter.cpp",
"tools/bookmaker/mdOut.cpp",
"tools/bookmaker/parserCommon.cpp",
"tools/bookmaker/selfCheck.cpp",
"tools/bookmaker/spellCheck.cpp",
"tools/bookmaker/textParser.cpp",
]
deps = [
":flags",
":skia",
":tool_utils",
]
}
if (is_linux || is_mac) {
test_app("skottie_tool") {
deps = [
"modules/skottie:tool",
]
}
}
if (target_cpu != "wasm") {
import("gn/samples.gni")
test_lib("samples") {
public_include_dirs = [ "samplecode" ]
include_dirs = [ "experimental" ]
sources = samples_sources
public_deps = [
":tool_utils",
]
deps = [
":experimental_svg_model",
":flags",
":xml",
"modules/sksg",
"modules/skshaper",
]
# NIMA does not build on Windows clang
if (!is_win || !is_clang) {
sources += [ "experimental/nima/NimaActor.cpp" ]
deps += [ "//third_party/Nima-Cpp" ]
}
if (skia_use_lua) {
sources += [ "samplecode/SampleLua.cpp" ]
deps += [
":lua",
"//third_party/lua",
]
}
}
test_app("imgcvt") {
sources = [
"tools/imgcvt.cpp",
]
deps = [
":skcms",
":skia",
]
}
test_app("dm") {
sources = [
"dm/DM.cpp",
"dm/DMGpuTestProcs.cpp",
"dm/DMJsonWriter.cpp",
"dm/DMSrcSink.cpp",
]
deps = [
":common_flags",
":experimental_svg_model",
":flags",
":gm",
":gpu_tool_utils",
":skia",
":tests",
":tool_utils",
"modules/skottie",
"modules/skottie:utils",
"modules/sksg",
"//third_party/libpng",
]
# NIMA does not build on Windows clang
if (!is_win || !is_clang) {
deps += [ "//third_party/Nima-Cpp" ]
}
}
}
if (!is_win) {
test_app("remote_demo") {
sources = [
"tools/remote_demo.cpp",
]
deps = [
":skia",
]
}
}
test_app("nanobench") {
sources = [
"bench/nanobench.cpp",
]
deps = [
":bench",
":common_flags",
":experimental_svg_model",
":flags",
":gm",
":gpu_tool_utils",
":skia",
":tool_utils",
"modules/sksg",
]
}
test_app("skpinfo") {
sources = [
"tools/skpinfo.cpp",
]
deps = [
":flags",
":skia",
]
}
test_app("skpbench") {
sources = [
"tools/skpbench/skpbench.cpp",
]
deps = [
":flags",
":gpu_tool_utils",
":skia",
":tool_utils",
]
}
test_app("sktexttopdf") {
sources = [
"tools/using_skia_and_harfbuzz.cpp",
]
deps = [
":skia",
"modules/skshaper",
]
}
test_app("create_test_font") {
sources = [
"tools/fonts/create_test_font.cpp",
]
deps = [
":skia",
]
assert_no_deps = [
# tool_utils requires the output of this app.
":tool_utils",
]
}
if (skia_use_expat) {
test_app("create_test_font_color") {
sources = [
"tools/fonts/create_test_font_color.cpp",
]
deps = [
":flags",
":skia",
":tool_utils",
]
}
}
test_app("get_images_from_skps") {
sources = [
"tools/get_images_from_skps.cpp",
]
deps = [
":flags",
":skia",
]
}
if (!is_ios && target_cpu != "wasm" && !(is_win && target_cpu == "arm64")) {
test_app("skiaserve") {
sources = [
"tools/skiaserve/Request.cpp",
"tools/skiaserve/Response.cpp",
"tools/skiaserve/skiaserve.cpp",
"tools/skiaserve/urlhandlers/BreakHandler.cpp",
"tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
"tools/skiaserve/urlhandlers/CmdHandler.cpp",
"tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
"tools/skiaserve/urlhandlers/DataHandler.cpp",
"tools/skiaserve/urlhandlers/DownloadHandler.cpp",
"tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
"tools/skiaserve/urlhandlers/ImgHandler.cpp",
"tools/skiaserve/urlhandlers/InfoHandler.cpp",
"tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
"tools/skiaserve/urlhandlers/OpsHandler.cpp",
"tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
"tools/skiaserve/urlhandlers/PostHandler.cpp",
"tools/skiaserve/urlhandlers/QuitHandler.cpp",
"tools/skiaserve/urlhandlers/RootHandler.cpp",
]
deps = [
":flags",
":gpu_tool_utils",
":skia",
":tool_utils",
"//third_party/libmicrohttpd",
"//third_party/libpng",
]
}
}
test_app("fuzz") {
include_dirs = [
"tools",
"tools/debugger",
"tools/fonts",
"src/sksl",
]
sources = [
"fuzz/Fuzz.cpp",
"fuzz/FuzzCanvas.cpp",
"fuzz/FuzzCommon.cpp",
"fuzz/FuzzDrawFunctions.cpp",
"fuzz/FuzzEncoders.cpp",
"fuzz/FuzzGradients.cpp",
"fuzz/FuzzMain.cpp",
"fuzz/FuzzParsePath.cpp",
"fuzz/FuzzPathMeasure.cpp",
"fuzz/FuzzPathop.cpp",
"fuzz/FuzzPolyUtils.cpp",
"fuzz/FuzzRegionOp.cpp",
"fuzz/oss_fuzz/FuzzAndroidCodec.cpp",
"fuzz/oss_fuzz/FuzzAnimatedImage.cpp",
"fuzz/oss_fuzz/FuzzImage.cpp",
"fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp",
"fuzz/oss_fuzz/FuzzIncrementalImage.cpp",
"fuzz/oss_fuzz/FuzzJSON.cpp",
"fuzz/oss_fuzz/FuzzPathDeserialize.cpp",
"fuzz/oss_fuzz/FuzzRegionDeserialize.cpp",
"fuzz/oss_fuzz/FuzzRegionSetPath.cpp",
"fuzz/oss_fuzz/FuzzSKSL2GLSL.cpp",
"fuzz/oss_fuzz/FuzzSKSL2Metal.cpp",
"fuzz/oss_fuzz/FuzzSKSL2Pipeline.cpp",
"fuzz/oss_fuzz/FuzzSKSL2SPIRV.cpp",
"fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp",
"tools/UrlDataManager.cpp",
"tools/debugger/SkDebugCanvas.cpp",
"tools/debugger/SkDrawCommand.cpp",
"tools/debugger/SkJsonWriteBuffer.cpp",
]
deps = [
":flags",
":gpu_tool_utils",
":skia",
"modules/skottie:fuzz",
"//third_party/libpng",
]
}
test_app("pathops_unittest") {
sources = pathops_tests_sources + [
rebase_path("tests/skia_test.cpp"),
rebase_path("tests/Test.cpp"),
]
deps = [
":flags",
":gpu_tool_utils",
":skia",
":tool_utils",
]
}
test_app("dump_record") {
sources = [
"tools/DumpRecord.cpp",
"tools/dump_record.cpp",
]
deps = [
":flags",
":skia",
]
}
test_app("skdiff") {
sources = [
"tools/skdiff/skdiff.cpp",
"tools/skdiff/skdiff_html.cpp",
"tools/skdiff/skdiff_main.cpp",
"tools/skdiff/skdiff_utils.cpp",
]
deps = [
":skia",
":tool_utils",
]
}
test_app("skp_parser") {
sources = [
"tools/skp_parser.cpp",
]
deps = [
":skia",
":tool_utils",
]
}
if (!is_win) {
test_lib("skqp_lib") {
public_include_dirs = [ "tools/skqp/src" ]
defines =
[ "SK_SKQP_GLOBAL_ERROR_TOLERANCE=$skia_skqp_global_error_tolerance" ]
sources = [
"dm/DMGpuTestProcs.cpp",
"tools/skqp/src/skqp.cpp",
"tools/skqp/src/skqp_model.cpp",
]
deps = [
":gm",
":gpu_tool_utils",
":skia",
":tests",
":tool_utils",
]
}
test_app("skqp") {
sources = [
"tools/skqp/src/skqp_main.cpp",
]
deps = [
":skia",
":skqp_lib",
":tool_utils",
]
}
test_app("jitter_gms") {
sources = [
"tools/skqp/jitter_gms.cpp",
]
deps = [
":gm",
":skia",
":skqp_lib",
]
}
}
if (is_android) {
test_app("skqp_app") {
is_shared_library = true
sources = [
"tools/skqp/src/jni_skqp.cpp",
]
deps = [
":skia",
":skqp_lib",
":tool_utils",
]
libs = [ "android" ]
}
}
if (is_android && skia_enable_gpu) {
test_app("skottie_android") {
is_shared_library = true
sources = [
"platform_tools/android/apps/skottie/src/main/cpp/JavaInputStreamAdaptor.cpp",
"platform_tools/android/apps/skottie/src/main/cpp/native-lib.cpp",
]
libs = []
include_dirs = []
deps = [
":skia",
"modules/skottie",
"modules/sksg:samples",
]
}
}
test_app("list_gms") {
sources = [
"tools/list_gms.cpp",
]
deps = [
":gm",
":skia",
]
}
test_app("list_gpu_unit_tests") {
sources = [
"dm/DMGpuTestProcs.cpp",
"tools/list_gpu_unit_tests.cpp",
]
deps = [
":skia",
":tests",
]
}
test_lib("sk_app") {
public_include_dirs = [ "tools/sk_app" ]
sources = [
"tools/sk_app/CommandSet.cpp",
"tools/sk_app/GLWindowContext.cpp",
"tools/sk_app/Window.cpp",
]
libs = []
if (is_android) {
sources += [
"tools/sk_app/android/GLWindowContext_android.cpp",
"tools/sk_app/android/RasterWindowContext_android.cpp",
"tools/sk_app/android/Window_android.cpp",
"tools/sk_app/android/main_android.cpp",
"tools/sk_app/android/surface_glue_android.cpp",
]
libs += [ "android" ]
} else if (is_linux) {
sources += [
"tools/sk_app/unix/GLWindowContext_unix.cpp",
"tools/sk_app/unix/RasterWindowContext_unix.cpp",
"tools/sk_app/unix/Window_unix.cpp",
"tools/sk_app/unix/keysym2ucs.c",
"tools/sk_app/unix/main_unix.cpp",
]
libs += [
"GL",
"X11",
]
} else if (is_win) {
sources += [
"tools/sk_app/win/GLWindowContext_win.cpp",
"tools/sk_app/win/RasterWindowContext_win.cpp",
"tools/sk_app/win/Window_win.cpp",
"tools/sk_app/win/main_win.cpp",
]
if (skia_use_angle) {
sources += [ "tools/sk_app/win/ANGLEWindowContext_win.cpp" ]
}
} else if (is_mac) {
sources += [
"tools/sk_app/mac/GLWindowContext_mac.mm",
"tools/sk_app/mac/RasterWindowContext_mac.mm",
"tools/sk_app/mac/Window_mac.mm",
"tools/sk_app/mac/main_mac.mm",
]
libs += [
"QuartzCore.framework",
"Cocoa.framework",
"Foundation.framework",
]
} else if (is_ios) {
sources += [
"tools/sk_app/ios/GLWindowContext_ios.cpp",
"tools/sk_app/ios/RasterWindowContext_ios.cpp",
"tools/sk_app/ios/Window_ios.cpp",
"tools/sk_app/ios/main_ios.cpp",
]
}
if (skia_use_vulkan) {
sources += [ "tools/sk_app/VulkanWindowContext.cpp" ]
if (is_android) {
sources += [ "tools/sk_app/android/VulkanWindowContext_android.cpp" ]
} else if (is_linux) {
sources += [ "tools/sk_app/unix/VulkanWindowContext_unix.cpp" ]
libs += [ "X11-xcb" ]
} else if (is_win) {
sources += [ "tools/sk_app/win/VulkanWindowContext_win.cpp" ]
} else if (is_mac) {
sources += [ "tools/sk_app/mac/VulkanWindowContext_mac.mm" ]
libs += [ "MetalKit.framework" ]
}
}
if (skia_use_metal) {
sources += [ "tools/sk_app/MetalWindowContext.mm" ]
if (is_mac) {
sources += [ "tools/sk_app/mac/MetalWindowContext_mac.mm" ]
}
libs += [ "MetalKit.framework" ]
}
deps = [
":gpu_tool_utils",
":skia",
":tool_utils",
]
if (is_android) {
deps += [ "//third_party/native_app_glue" ]
} else if (is_ios) {
deps += [ "//third_party/libsdl" ]
}
if (skia_use_angle) {
deps += [ "//third_party/angle2" ]
}
}
import("gn/examples.gni")
if (!skia_use_vulkan && (is_mac || is_linux || is_win)) {
test_app("fiddle_examples") {
sources = [
"tools/fiddle/examples.cpp",
"tools/fiddle/examples.h",
]
sources += examples_sources
include_dirs = [ "tools" ]
if (is_win) {
cflags = [ "/wd4756" ] # Overflow in constant arithmetic
}
deps = [
":skia",
":skia.h",
"modules/skottie",
]
}
}
test_app("viewer") {
is_shared_library = is_android
if (is_ios) {
bundle_ios_data = true
}
sources = [
"tools/viewer/BisectSlide.cpp",
"tools/viewer/GMSlide.cpp",
"tools/viewer/ImGuiLayer.cpp",
"tools/viewer/ImageSlide.cpp",
Experimental Particle System This adds a new "Particles" slide to viewer, that allows editing, loading, and saving particle effects. All of the particle system code is in modules/particles. There are many rough edges and some not-yet-finished changes to generalize the model[1]. A rough overview: - SkReflected.h implements a lightweight reflection system for classes derived from SkReflected. Adding a new class involves deriving from SkReflected, adding a macro to the class declaration, and implementing visitFields(), which simply calls a virtual on an SkFieldVisitor for each field. Currently, emitters and affectors use this mechanism. - SkParticleSerialization.h demonstrates two useful field visitors - for serializing to and from JSON. The driver code that uses those is directly in ParticlesSlide. - SkParticleData.h and SkCurve.h define a variety of helper types for talking about particles, both for parameterizing individual values, and communicating about the state of a particle among the effect, affectors, and emitters. - SkParticleEffect.h defines the static data definition of an effect (SkParticleEffectParams), as well as a running instance of an effect (SkParticleEffect). The effect has simple update() and draw() methods. - ParticlesSlide.cpp adds a third field visitor to generate GUIs for interactively editing the running effect. --- 1: The critical change I'd like to make is to remove all special case behavior over time and at spawn (setting sprite frames, size over time, color over time, etc...). Integration is the only fixed function behavior. Everything else is driven by two lists of affectors. One is applied at spawn time, using the effect's lifetime to evaluate curves. This allows spawning particles with different colors as the effect ages out, for example. The second list is applied every frame to update existing particles, and is driven by the particle's lifetime. This allows particles to change color after being spawned, for example. With a small set of affectors using a single expressive curve primitive (keyframed list of cubic curve segments), we can have affectors that update color, size, velocity, position, sprite frame, etc., and implement many complex behaviors. Bug: skia: Change-Id: Id9402bef22825d55d021c5a2f9e5e41791aabaf4 Reviewed-on: https://skia-review.googlesource.com/c/181404 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Mike Reed <reed@google.com>
2019-02-12 18:27:51 +00:00
"tools/viewer/ParticlesSlide.cpp",
"tools/viewer/SKPSlide.cpp",
"tools/viewer/SampleSlide.cpp",
"tools/viewer/SkottieSlide.cpp",
"tools/viewer/SlideDir.cpp",
"tools/viewer/StatsLayer.cpp",
"tools/viewer/SvgSlide.cpp",
"tools/viewer/TouchGesture.cpp",
Switch SkCodec to use skcms Bug: skia:6839 Bug: skia:8052 Create an skcms_Profile instead of an SkColorSpace when creating an SkCodec. Eventually we'll move the SkImageInfo (and its SkColorSpace) entirely to clients (e.g. SkAndroidCodec, SkCodecImageGenerator), but for now, create it with SkEncodedInfo::makeImageInfo. Create new SkEncodedInfo::Colors for the special PNG cases that we want to map to specific SkColorTypes. SkEncodedInfo: - Add ICCProfile, which owns an skcms_ICCProfile - FIXME: maybe we should have a single instance for SRGB like SkColorSpace? - Add kXAlpha_Color, for kAlpha_8. Since I'm not longer creating an SkImageInfo (at least in SkPngCodec), it needs a way to pass this info to the caller. - Add k565_Color, for the same reason. Matt originally had this in https://codereview.chromium.org/2212563003/#ps120001, but didn't land that version. I like it though. Mike didn't like the bits per component for 565, but it seems like a sensible hack, much like the existing one for kAlpha_8 - Add width and height. These were removed for redundancy with SkImageInfo, but it makes sense to have them here without it. BUILD.gn: - Build the new SkEncodedInfo.cpp SkCodec: - Remove the constructor with an SkImageInfo. Edit the other one to drop width and height (now in SkEncodedInfo) and take a RHS reference to SkEncodedInfo - Create the SkImageInfo from fEncodedInfo (for now) - Consolidate choosing skcms_AlphaFormat for Transform here - Call conversionSupported from initializeColorXform, with a new parameter for whether there is a color Xform, allowing SkJpegCodec and SkHeifCodec to override that method instead of having another method. SkBmpCodec (etc) - Adapt to the changes above - Create a new SkEncodedInfo w/o profile for the swizzler. SkPngCodec: - use the new SkEncodedInfo::Colors rather than a custom SkImageInfo SkRawCodec: - Remove SkEncodedInfo from SkDngImage, which doesn't actually need it. This is helpful since we don't know all the info yet. - Rewrite gAdobeRGB_toXYZD50 as an skcms_Matrix3x3 SkWebpCodec: - Remove premul_step computation, and simplify to just rely on the base class' handling of applying the transform. SkSwizzler: - Add cases for the new SkEncodedInfo::Colors TBR=reed@google.com No public API changes. Only private/public members of SkCodec.h are modified. Change-Id: Ic0d3bb752b03f13be886b80331987aa5a5713fc0 Reviewed-on: https://skia-review.googlesource.com/136062 Commit-Queue: Leon Scroggins <scroggo@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
2018-08-22 15:18:08 +00:00
"tools/viewer/TouchGesture.h",
"tools/viewer/Viewer.cpp",
]
libs = []
include_dirs = [ "experimental" ]
deps = [
":experimental_svg_model",
":flags",
":gm",
":gpu_tool_utils",
":samples",
":sk_app",
":skia",
":tool_utils",
Experimental Particle System This adds a new "Particles" slide to viewer, that allows editing, loading, and saving particle effects. All of the particle system code is in modules/particles. There are many rough edges and some not-yet-finished changes to generalize the model[1]. A rough overview: - SkReflected.h implements a lightweight reflection system for classes derived from SkReflected. Adding a new class involves deriving from SkReflected, adding a macro to the class declaration, and implementing visitFields(), which simply calls a virtual on an SkFieldVisitor for each field. Currently, emitters and affectors use this mechanism. - SkParticleSerialization.h demonstrates two useful field visitors - for serializing to and from JSON. The driver code that uses those is directly in ParticlesSlide. - SkParticleData.h and SkCurve.h define a variety of helper types for talking about particles, both for parameterizing individual values, and communicating about the state of a particle among the effect, affectors, and emitters. - SkParticleEffect.h defines the static data definition of an effect (SkParticleEffectParams), as well as a running instance of an effect (SkParticleEffect). The effect has simple update() and draw() methods. - ParticlesSlide.cpp adds a third field visitor to generate GUIs for interactively editing the running effect. --- 1: The critical change I'd like to make is to remove all special case behavior over time and at spawn (setting sprite frames, size over time, color over time, etc...). Integration is the only fixed function behavior. Everything else is driven by two lists of affectors. One is applied at spawn time, using the effect's lifetime to evaluate curves. This allows spawning particles with different colors as the effect ages out, for example. The second list is applied every frame to update existing particles, and is driven by the particle's lifetime. This allows particles to change color after being spawned, for example. With a small set of affectors using a single expressive curve primitive (keyframed list of cubic curve segments), we can have affectors that update color, size, velocity, position, sprite frame, etc., and implement many complex behaviors. Bug: skia: Change-Id: Id9402bef22825d55d021c5a2f9e5e41791aabaf4 Reviewed-on: https://skia-review.googlesource.com/c/181404 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Mike Reed <reed@google.com>
2019-02-12 18:27:51 +00:00
"modules/particles",
"modules/skottie",
"modules/skottie:utils",
"modules/sksg",
"modules/sksg:samples",
"//third_party/imgui",
]
# NIMA does not build on Windows clang
if (!is_win || !is_clang) {
sources += [ "tools/viewer/NIMASlide.cpp" ]
deps += [ "//third_party/Nima-Cpp" ]
}
}
if (is_android) {
test_app("arcore") {
is_shared_library = true
configs = [
":skia_public",
"gn:default",
]
# For internship expedience, yes, we're rebuilding Skia rather than depending on :skia.
# At the moment there's no way to use Skia and Skottie/SkShaper unless they're in the same .so.
public = skia_core_public
public += skia_utils_public
sources = []
sources += skia_core_sources
sources += skia_utils_sources
sources += skia_xps_sources
sources += [
"src/android/SkAndroidFrameworkUtils.cpp",
"src/android/SkAnimatedImage.cpp",
"src/android/SkBitmapRegionCodec.cpp",
"src/android/SkBitmapRegionDecoder.cpp",
"src/codec/SkAndroidCodec.cpp",
"src/codec/SkBmpBaseCodec.cpp",
"src/codec/SkBmpCodec.cpp",
"src/codec/SkBmpMaskCodec.cpp",
"src/codec/SkBmpRLECodec.cpp",
"src/codec/SkBmpStandardCodec.cpp",
"src/codec/SkCodec.cpp",
"src/codec/SkCodecImageGenerator.cpp",
"src/codec/SkColorTable.cpp",
"src/codec/SkGifCodec.cpp",
"src/codec/SkMaskSwizzler.cpp",
"src/codec/SkMasks.cpp",
"src/codec/SkSampledCodec.cpp",
"src/codec/SkSampler.cpp",
"src/codec/SkStreamBuffer.cpp",
"src/codec/SkSwizzler.cpp",
"src/codec/SkWbmpCodec.cpp",
"src/images/SkImageEncoder.cpp",
"src/ports/SkDiscardableMemory_none.cpp",
"src/ports/SkImageGenerator_skia.cpp",
"src/ports/SkMemory_malloc.cpp",
"src/ports/SkOSFile_stdio.cpp",
"src/sfnt/SkOTTable_name.cpp",
"src/sfnt/SkOTUtils.cpp",
"src/utils/mac/SkStream_mac.cpp",
"third_party/etc1/etc1.cpp",
"third_party/gif/SkGifImageReader.cpp",
]
deps = [
":tool_utils",
"modules/skottie",
"modules/skshaper",
]
}
}
if (!skia_use_angle && (is_linux || is_win || is_mac)) {
test_app("HelloWorld") {
sources = [
"example/HelloWorld.cpp",
]
libs = []
include_dirs = []
deps = [
":flags",
":gpu_tool_utils",
":sk_app",
":skia",
":tool_utils",
]
}
}
if (is_linux || is_mac || is_ios) {
test_app("SkiaSDLExample") {
sources = [
"example/SkiaSDLExample.cpp",
]
libs = []
include_dirs = []
deps = [
":gpu_tool_utils",
":skia",
"//third_party/libsdl",
]
}
}
if (skia_qt_path != "" && (is_win || is_linux || is_mac)) {
action_foreach("generate_mocs") {
script = "gn/call.py"
sources = [
"tools/mdbviz/MainWindow.h",
]
outputs = [
"$target_gen_dir/mdbviz/{{source_name_part}}_moc.cpp",
]
args = [
"$skia_qt_path" + "/bin/moc",
"{{source}}",
"-o",
"gen/mdbviz/{{source_name_part}}_moc.cpp",
]
}
action_foreach("generate_resources") {
script = "gn/call.py"
sources = [
"tools/mdbviz/resources.qrc",
]
outputs = [
"$target_gen_dir/mdbviz/{{source_name_part}}_res.cpp",
]
args = [
"$skia_qt_path" + "/bin/rcc",
"{{source}}",
"-o",
"gen/mdbviz/{{source_name_part}}_res.cpp",
]
}
test_app("mdbviz") {
if (is_win) {
# on Windows we need to disable some exception handling warnings due to the Qt headers
cflags = [ "/Wv:18" ] # 18 -> VS2013, 19 -> VS2015, 1910 -> VS2017
}
sources = [
"tools/UrlDataManager.cpp",
"tools/debugger/SkDebugCanvas.cpp",
"tools/debugger/SkDrawCommand.cpp",
"tools/debugger/SkJsonWriteBuffer.cpp",
"tools/mdbviz/MainWindow.cpp",
"tools/mdbviz/Model.cpp",
"tools/mdbviz/main.cpp",
# generated files
"$target_gen_dir/mdbviz/MainWindow_moc.cpp",
"$target_gen_dir/mdbviz/resources_res.cpp",
]
lib_dirs = [ "$skia_qt_path/lib" ]
libs = [
"Qt5Core.lib",
"Qt5Gui.lib",
"Qt5Widgets.lib",
]
include_dirs = [
"$skia_qt_path/include",
"$skia_qt_path/include/QtCore",
"$skia_qt_path/include/QtWidgets",
"tools",
"tools/debugger",
]
deps = [
":generate_mocs",
":generate_resources",
":skia",
"//third_party/libpng",
]
}
}
Strengthen is_official_build, update docs. This makes is_official_build turn off all development targets and features in Skia, including building third-party dependencies from source. This will intentionally break some external users, who will find themselves no longer able to find third-party headers or link against third-party libraries. These users have been building with our testing third-party dependencies unknowingly. They'll need to either explicitly turn back on building each dependency from source (skia_use_system_foo=false) or disable that dependency entirely (skia_use_foo=false). is_skia_standalone is now basically !is_official_build, so I've propagated that through, removing is_skia_standalone. In a few places we were using it as a stand-in for defined(ndk), so I've just written defined(ndk) there. Duh. gn_to_bp: is_offical_build's new strength also makes gn_to_bp.py simpler to write. In spirit, Android builds are official Skia builds that also build DM and nanobench. It seems that SkJumper (src/jumper/*) is (unintentionally) enabled on Android. Switching to an is_official_build would have disabled that. But as that accidental launch seems to have gone fine, I've kept it explicitly enabled. In the end, no changes to Android.bp or its SkUserConfig.h. The -Mini builder no longer needs to explicitly disable tools. CQ_INCLUDE_TRYBOTS=skia.primary:Build-Ubuntu-Clang-x86_64-Release-Mini Change-Id: Id06e53268a5caf55c6046ada354a0863c3031c73 Reviewed-on: https://skia-review.googlesource.com/9190 Reviewed-by: Leon Scroggins <scroggo@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-03-03 14:21:30 +00:00
if (is_android && defined(ndk) && ndk != "") {
copy("gdbserver") {
sources = [
"$ndk/$ndk_gdbserver",
]
outputs = [
"$root_out_dir/gdbserver",
]
}
}
if (skia_use_opencl) {
test_app("hello-opencl") {
sources = [
"tools/hello-opencl.cpp",
]
deps = [
"//third_party/opencl",
]
}
}
}