Add GN arg to allow Flutter-specific API guards

Bug: skia:
Change-Id: I5a97da664626eebf30bba3f391fff0d8b9e62ea5
Reviewed-on: https://skia-review.googlesource.com/23042
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
diff --git a/BUILD.gn b/BUILD.gn
index 4c34a1e..f60c23b 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -3,6 +3,7 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
+import("gn/flutter_defines.gni")
 import("gn/shared_sources.gni")
 
 if (is_fuchsia) {
@@ -34,6 +35,7 @@
   skia_android_serial = ""
   skia_enable_discrete_gpu = true
   skia_enable_effects = true
+  skia_enable_flutter_defines = false
   skia_enable_gpu = true
   skia_enable_pdf = true
   skia_enable_spirv_validation = is_skia_dev_build && is_debug
@@ -112,6 +114,9 @@
   if (is_fuchsia || is_linux) {
     defines += [ "SK_SAMPLES_FOR_X" ]
   }
+  if (skia_enable_flutter_defines) {
+    defines += flutter_defines
+  }
   if (!skia_enable_gpu) {
     defines += [ "SK_SUPPORT_GPU=0" ]
   }
diff --git a/gn/flutter_defines.gni b/gn/flutter_defines.gni
new file mode 100644
index 0000000..75ac43d
--- /dev/null
+++ b/gn/flutter_defines.gni
@@ -0,0 +1,5 @@
+# Copyright 2017 Google Inc.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+flutter_defines = [ "SK_SUPPORT_LEGACY_IMAGE_ENCODE_API" ]