From 5dbd27484641279b53369587c93ba0566c20a161 Mon Sep 17 00:00:00 2001 From: mtklein Date: Tue, 2 Aug 2016 11:13:48 -0700 Subject: [PATCH] gn: fix fiddle - __SK_FORCE_IMAGE_DECODER_LINKING makes sure the PNG encoder is linked - updated path to make working with sample draw.cpp easier. No public API changes. TBR=reed@google.com BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2202353002 Review-Url: https://codereview.chromium.org/2202353002 --- BUILD.gn | 2 ++ include/images/SkForceLinking.h | 2 ++ tools/fiddle/draw.cpp | 2 +- tools/fiddle/fiddle_main.cpp | 3 +++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/BUILD.gn b/BUILD.gn index e6defbf..d1daccb 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -308,7 +308,9 @@ executable("fiddle") { deps = [ ":skia", ":skia.h", + ":tool_utils", ] + testonly = true } template("test_lib") { diff --git a/include/images/SkForceLinking.h b/include/images/SkForceLinking.h index 13ada54..5de8918 100644 --- a/include/images/SkForceLinking.h +++ b/include/images/SkForceLinking.h @@ -5,6 +5,8 @@ * found in the LICENSE file. */ +#include "SkTypes.h" + /** * This function's sole purpose is to trick the linker into not discarding * SkImageDecoder subclasses just because we do not directly call them. diff --git a/tools/fiddle/draw.cpp b/tools/fiddle/draw.cpp index 78f428d..68cbbdf 100644 --- a/tools/fiddle/draw.cpp +++ b/tools/fiddle/draw.cpp @@ -12,7 +12,7 @@ #include "fiddle_main.h" DrawOptions GetDrawOptions() { // path *should* be absolute. - static const char path[] = "../../resources/color_wheel.png"; + static const char path[] = "resources/color_wheel.png"; return DrawOptions(256, 256, true, true, true, true, path); } void draw(SkCanvas* canvas) { diff --git a/tools/fiddle/fiddle_main.cpp b/tools/fiddle/fiddle_main.cpp index 1c80c44..df2e8ff 100644 --- a/tools/fiddle/fiddle_main.cpp +++ b/tools/fiddle/fiddle_main.cpp @@ -7,6 +7,9 @@ #include #include +#include "SkForceLinking.h" + +__SK_FORCE_IMAGE_DECODER_LINKING; #include "fiddle_main.h" -- 2.7.4