Make src/effects explicitly optional.
This adds a GN argument to disable src/effects, which can cut about 1M off libskia. It's not the first place you'd go to trim code size, but after turning off easy big things like Ganesh, it starts looking big. I tested that fiddle builds and links. It uses Skia but not effects. Most of our test apps use effects and can't build in this new mode. Change-Id: I9b5d6e9289a87bc08eedf6d202d0eabe754da41a Reviewed-on: https://skia-review.googlesource.com/8263 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
This commit is contained in:
parent
67d64605d3
commit
a04bb45b23
11
BUILD.gn
11
BUILD.gn
@ -28,6 +28,7 @@ declare_args() {
|
||||
skia_android_serial = ""
|
||||
skia_enable_android_framework_defines = false
|
||||
skia_enable_discrete_gpu = true
|
||||
skia_enable_effects = true
|
||||
skia_enable_gpu = true
|
||||
skia_enable_pdf = true
|
||||
skia_enable_splicer = is_skia_standalone && sanitize != "MSAN" && !is_ios
|
||||
@ -322,6 +323,13 @@ template("optional") {
|
||||
}
|
||||
}
|
||||
|
||||
optional("effects") {
|
||||
enabled = skia_enable_effects
|
||||
sources =
|
||||
skia_effects_sources + [ "src/ports/SkGlobalInitialization_default.cpp" ]
|
||||
sources_when_disabled = [ "src/ports/SkGlobalInitialization_none.cpp" ]
|
||||
}
|
||||
|
||||
optional("fontmgr_android") {
|
||||
enabled = fontmgr_android_enabled
|
||||
|
||||
@ -543,6 +551,7 @@ component("skia") {
|
||||
":armv7",
|
||||
":avx",
|
||||
":crc32",
|
||||
":effects",
|
||||
":fontmgr_android",
|
||||
":fontmgr_custom",
|
||||
":fontmgr_fontconfig",
|
||||
@ -571,7 +580,6 @@ component("skia") {
|
||||
|
||||
sources = []
|
||||
sources += skia_core_sources
|
||||
sources += skia_effects_sources
|
||||
sources += skia_sksl_sources
|
||||
sources += skia_utils_sources
|
||||
sources += skia_xps_sources
|
||||
@ -595,7 +603,6 @@ component("skia") {
|
||||
"src/codec/SkWbmpCodec.cpp",
|
||||
"src/images/SkImageEncoder.cpp",
|
||||
"src/ports/SkDiscardableMemory_none.cpp",
|
||||
"src/ports/SkGlobalInitialization_default.cpp",
|
||||
"src/ports/SkImageGenerator_skia.cpp",
|
||||
"src/ports/SkMemory_malloc.cpp",
|
||||
"src/ports/SkOSFile_stdio.cpp",
|
||||
|
10
src/ports/SkGlobalInitialization_none.cpp
Normal file
10
src/ports/SkGlobalInitialization_none.cpp
Normal file
@ -0,0 +1,10 @@
|
||||
/*
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license that can be
|
||||
* found in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "SkFlattenable.h"
|
||||
|
||||
void SkFlattenable::PrivateInitializer::InitEffects() {}
|
Loading…
Reference in New Issue
Block a user