Do not build the ktx encoder for android framework

Move SkKTXImageEncoder.cpp into an optional block, and disable that
block for the android framework. Use a new define to determine whether
to define the entry point, rather than using
SK_BUILD_FOR_ANDROID_FRAMEWORK.

Change-Id: I41103459135af744cf5715f27783c63dc37a7ad1
Reviewed-on: https://skia-review.googlesource.com/5982
Commit-Queue: Leon Scroggins <scroggo@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
This commit is contained in:
Leon Scroggins III 2016-12-13 16:32:32 -05:00 committed by Skia Commit-Bot
parent 04e10da836
commit eeb7137a0b
3 changed files with 12 additions and 2 deletions

View File

@ -27,6 +27,7 @@ declare_args() {
skia_enable_android_framework_defines = false
skia_enable_gpu = true
skia_enable_ktx_encoder = true
skia_enable_tools = is_skia_standalone
skia_enable_vulkan_debug_layers = is_skia_standalone && is_debug
skia_vulkan_sdk = getenv("VULKAN_SDK")
@ -430,6 +431,14 @@ optional("jpeg") {
]
}
optional("ktx_encoder") {
enabled = skia_enable_ktx_encoder
public_defines = [ "SK_HAS_KTX_ENCODER" ]
sources = [
"src/images/SkKTXImageEncoder.cpp",
]
}
optional("pdf") {
enabled = skia_use_zlib
@ -536,6 +545,7 @@ component("skia") {
":gpu",
":hsw",
":jpeg",
":ktx_encoder",
":none",
":pdf",
":png",
@ -578,7 +588,6 @@ component("skia") {
"src/codec/SkSwizzler.cpp",
"src/codec/SkWbmpCodec.cpp",
"src/images/SkImageEncoder.cpp",
"src/images/SkKTXImageEncoder.cpp",
"src/ports/SkDiscardableMemory_none.cpp",
"src/ports/SkGlobalInitialization_default.cpp",
"src/ports/SkImageGenerator_skia.cpp",

View File

@ -109,6 +109,7 @@ cc_library {
# We'll run GN to get the main source lists and include directories for Skia.
gn_args = {
'skia_enable_ktx_encoder': 'false',
'skia_enable_vulkan_debug_layers': 'false',
'skia_use_system_expat': 'true',
'skia_use_vulkan': 'true',

View File

@ -28,7 +28,7 @@
#define SkEncodeImageAsWEBP(...) false
#endif
#ifndef SK_BUILD_FOR_ANDROID_FRAMEWORK
#ifdef SK_HAS_KTX_ENCODER
bool SkEncodeImageAsKTX(SkWStream*, const SkPixmap&);
#else
#define SkEncodeImageAsKTX(...) false