Add deprecation warning when running Metal on older OSes.

Older versions of MacOS are unstable when compiling shaders, and we
don't have the testing support for older versions of iOS.

Bug: skia:10777
Change-Id: I95d9fe0f1007af6bec5c7525dacda565e32989f2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320260
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index 9b0b685..2ec3c34 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -9,6 +9,9 @@
 
   * <insert new release notes here>
 
+  * Added deprecation warning for Metal support on MacOS 10.13, iOS 8.3, and older.
+    https://review.skia.org/320260
+
   * Update SkClipOp::kMax_EnumValue to include only intersect and difference when
     SK_SUPPORT_DEPRECATED_CLIPOPS is not defined.
     https://review.skia.org/320064
diff --git a/src/gpu/mtl/GrMtlGpu.mm b/src/gpu/mtl/GrMtlGpu.mm
index e991080..853e4e6 100644
--- a/src/gpu/mtl/GrMtlGpu.mm
+++ b/src/gpu/mtl/GrMtlGpu.mm
@@ -105,6 +105,18 @@
     if (!device || !queue) {
         return nullptr;
     }
+    if (@available(macOS 10.14, iOS 9.0, *)) {
+        // no warning needed
+    } else {
+        SkDebugf("*** Warning ***: this OS version is deprecated and will no longer be supported " \
+                 "in future releases.\n");
+#ifdef SK_BUILD_FOR_IOS
+        SkDebugf("Minimum recommended version is iOS 9.0.\n");
+#else
+        SkDebugf("Minimum recommended version is MacOS 10.14.\n");
+#endif
+    }
+
     MTLFeatureSet featureSet;
     if (!get_feature_set(device, &featureSet)) {
         return nullptr;