Start on fiddle.

Mostly stolen from Joe.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2188493002

Review-Url: https://codereview.chromium.org/2188493002
This commit is contained in:
mtklein 2016-07-26 13:55:45 -07:00 committed by Commit bot
parent ae76f49a76
commit 1211e0ca74
2 changed files with 83 additions and 21 deletions

View File

@ -6,21 +6,25 @@
declare_args() {
}
skia_public_includes = [
"include/codec",
"include/config",
"include/core",
"include/effects",
"include/gpu",
"include/gpu/gl",
"include/images",
"include/pathops",
"include/ports",
"include/utils",
"include/utils/mac",
"include/c", # TODO: move back to top, order shouldn't matter
]
# Skia public API, generally provided by :skia.
config("skia_public") {
include_dirs = [
"include/c",
"include/config",
"include/core",
"include/effects",
"include/gpu",
"include/images",
"include/lazy",
"include/pathops",
"include/ports",
"include/utils",
"include/utils/mac",
]
include_dirs = skia_public_includes
defines = [ "SKIA_DLL" ]
}
@ -31,6 +35,7 @@ config("skia_private") {
include_dirs = [
"include/private",
"src/c",
"src/codec",
"src/config",
"src/core",
"src/effects",
@ -146,6 +151,11 @@ component("skia") {
"//third_party/zlib",
]
defines = [
"SK_HAS_JPEG_LIBRARY",
"SK_HAS_PNG_LIBRARY",
]
libs = [ "pthread" ]
sources = []
@ -156,11 +166,27 @@ component("skia") {
sources += pdf_gypi.sources
sources += utils_gypi.sources
sources += [
"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/SkIcoCodec.cpp",
"src/codec/SkJpegCodec.cpp",
"src/codec/SkJpegDecoderMgr.cpp",
"src/codec/SkJpegUtility.cpp",
"src/codec/SkMaskSwizzler.cpp",
"src/codec/SkMasks.cpp",
"src/codec/SkPngCodec.cpp",
"src/codec/SkSampler.cpp",
"src/codec/SkSwizzler.cpp",
"src/codec/SkWbmpCodec.cpp",
"src/images/SkImageEncoder.cpp",
"src/images/SkImageEncoder_Factory.cpp",
"src/ports/SkDiscardableMemory_none.cpp",
"src/ports/SkGlobalInitialization_default.cpp",
"src/ports/SkImageGenerator_none.cpp",
"src/ports/SkImageGenerator_skia.cpp",
"src/ports/SkMemory_malloc.cpp",
"src/ports/SkOSFile_stdio.cpp",
"src/sfnt/SkOTTable_name.cpp",
@ -225,16 +251,25 @@ component("skia") {
}
}
executable("example") {
action("skia.h") {
script = "gn/echo_headers.py"
args = [ rebase_path("$target_gen_dir/skia.h", root_build_dir) ] +
rebase_path(skia_public_includes, root_build_dir)
outputs = [
"$target_gen_dir/skia.h",
]
}
executable("fiddle") {
include_dirs = [ "$target_gen_dir" ]
libs = [ "OSMesa" ]
sources = [
"cmake/example.cpp",
"tools/fiddle/draw.cpp",
"tools/fiddle/fiddle_main.cpp",
]
deps = [
":skia",
":skia.h",
]
libs = []
if (is_mac) {
libs += [ "OpenGL.framework" ]
}
}

27
gn/echo_headers.py Normal file
View File

@ -0,0 +1,27 @@
#!/usr/bin/env python
#
# 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 sys
import os
import os.path
blacklist = [
'GrGLConfig_chrome.h',
]
headers = []
for d in sys.argv[2:]:
headers.extend([f for f in os.listdir(d)
if os.path.isfile(os.path.join(d,f))])
with open(sys.argv[1], "w") as f:
f.write('// skia.h generated by GN.\n')
f.write('#ifndef skia_h_DEFINED\n')
f.write('#define skia_h_DEFINED\n')
for h in headers:
if h not in blacklist:
f.write('#include "' + h + '"\n')
f.write('#endif//skia_h_DEFINED\n')