GN: add some missing SkCodec defines
TURBO_HAS_...
WEBP_SWAP_16BIT_CSP
BUG=skia:5591
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2196413003
Review-Url: https://codereview.chromium.org/2196413003
diff --git a/BUILD.gn b/BUILD.gn
index a310e33..6a655c8 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -65,6 +65,10 @@
"SK_HAS_JPEG_LIBRARY",
"SK_HAS_PNG_LIBRARY",
"SK_HAS_WEBP_LIBRARY",
+
+ "TURBO_HAS_565",
+ "TURBO_HAS_CROP",
+ "TURBO_HAS_SKIP",
]
}
diff --git a/third_party/libwebp/BUILD.gn b/third_party/libwebp/BUILD.gn
index d27004b..efac7d2 100644
--- a/third_party/libwebp/BUILD.gn
+++ b/third_party/libwebp/BUILD.gn
@@ -11,6 +11,14 @@
third_party("libwebp") {
public_include_dirs = [ "../externals/libwebp/src" ]
+ defines = [
+ # WebP naturally decodes to RGB_565, and we work with BGR_565.
+ # This makes WebP decode to BGR_565 when we ask for RGB_565.
+ # (It also swaps the color order for 4444, but we don't care today.)
+ # TODO: swizzle ourself in SkWebpCodec instead of requiring this non-standard libwebp.
+ "WEBP_SWAP_16BIT_CSP",
+ ]
+
sources = [
"../externals/libwebp/src/dec/alpha.c",
"../externals/libwebp/src/dec/buffer.c",