diff options
author | Leon Scroggins III <scroggo@google.com> | 2018-10-26 09:25:51 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-10-26 13:53:04 +0000 |
commit | e93ec68a52599bfe109d196f6ae3576f40056de2 (patch) | |
tree | 94cff33cf38412a677c3ccf7c316cef667152079 /third_party | |
parent | e2fd74b48f6f7bc445abbb5f7b6e188d904601bf (diff) | |
download | skqp-e93ec68a52599bfe109d196f6ae3576f40056de2.tar.gz |
Reland "New GIF codec; new third_party/wuffs dep"
This reverts commit 7d1c9ec49f8a846cef833a0f956cf9c91a298145.
Bug: skia:8235
Change-Id: I830ba00a87e85c80f7e8583f5dfa105cd60029b2
Reviewed-on: https://skia-review.googlesource.com/c/165301
Commit-Queue: Leon Scroggins <scroggo@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Leon Scroggins <scroggo@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Diffstat (limited to 'third_party')
-rw-r--r-- | third_party/wuffs/BUILD.gn | 13 | ||||
-rw-r--r-- | third_party/wuffs/wuffs.c | 42 |
2 files changed, 55 insertions, 0 deletions
diff --git a/third_party/wuffs/BUILD.gn b/third_party/wuffs/BUILD.gn new file mode 100644 index 0000000000..377b60932d --- /dev/null +++ b/third_party/wuffs/BUILD.gn @@ -0,0 +1,13 @@ +# Copyright 2018 Google Inc. +# +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("../third_party.gni") + +third_party("wuffs") { + public_include_dirs = [ "../externals/wuffs/release/c" ] + sources = [ + "wuffs.c", + ] +} diff --git a/third_party/wuffs/wuffs.c b/third_party/wuffs/wuffs.c new file mode 100644 index 0000000000..9c6eb9d05d --- /dev/null +++ b/third_party/wuffs/wuffs.c @@ -0,0 +1,42 @@ +/* + * Copyright 2018 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +// The Wuffs library ships as a single file - a .h file - which GN does not +// recognize as something to be compiled, because it ends in .h and not .c or +// .cpp. Instead, this trivial file is a placeholder .c file that is a BUILD.gn +// target for the third party Wuffs library. +// +// Copy/pasting from the Wuffs .h file's comments: +// +// ---- +// +// Wuffs ships as a "single file C library" or "header file library" as per +// https://github.com/nothings/stb/blob/master/docs/stb_howto.txt +// +// To use that single file as a "foo.c"-like implementation, instead of a +// "foo.h"-like header, #define WUFFS_IMPLEMENTATION before #include'ing or +// compiling it. +// +// ---- +#define WUFFS_IMPLEMENTATION + +// Defining the WUFFS_CONFIG__MODULE* macros are optional, but it lets users of +// Wuffs' .h file whitelist which parts of Wuffs to build. That file contains +// the entire Wuffs standard library, implementing a variety of codecs and file +// formats. Without this macro definition, an optimizing compiler or linker may +// very well discard Wuffs code for unused codecs, but listing the Wuffs +// modules we use makes that process explicit. Preprocessing means that such +// code simply isn't compiled. +// +// For Skia, we're only interested in particular image codes (e.g. GIF) and +// their dependencies (e.g. BASE, LZW). +#define WUFFS_CONFIG__MODULES +#define WUFFS_CONFIG__MODULE__BASE +#define WUFFS_CONFIG__MODULE__GIF +#define WUFFS_CONFIG__MODULE__LZW + +#include "wuffs-v0.2.h" |