Fix sk_app macOS raster window build conditions.

The "raster" window on macOS is actually backed by GL. Fix the build
rules and code conditions to reflect this. This allows for some sk_app
applications to run on macOS with skia_use_gl=false.

Change-Id: I5d7b37c4172079e163690faa4e55a622a6d4f844
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/397256
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/BUILD.gn b/BUILD.gn
index 7b03e0f..c86f0b0 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -2557,7 +2557,6 @@
       ]
     } else if (is_mac) {
       sources += [
-        "tools/sk_app/mac/RasterWindowContext_mac.mm",
         "tools/sk_app/mac/WindowContextFactory_mac.h",
         "tools/sk_app/mac/Window_mac.h",
         "tools/sk_app/mac/Window_mac.mm",
@@ -2592,7 +2591,10 @@
           sources += [ "tools/sk_app/win/ANGLEWindowContext_win.cpp" ]
         }
       } else if (is_mac) {
-        sources += [ "tools/sk_app/mac/GLWindowContext_mac.mm" ]
+        sources += [
+          "tools/sk_app/mac/GLWindowContext_mac.mm",
+          "tools/sk_app/mac/RasterWindowContext_mac.mm",
+        ]
       } else if (is_ios) {
         sources += [ "tools/sk_app/ios/GLWindowContext_ios.mm" ]
       }
@@ -2863,7 +2865,7 @@
     ]
   }
 
-  if (skia_use_gl && skia_use_icu && skia_use_harfbuzz) {
+  if (skia_use_icu && skia_use_harfbuzz) {
     test_app("editor") {
       is_shared_library = is_android
       deps = [ "modules/skplaintexteditor:editor_app" ]
diff --git a/modules/skplaintexteditor/app/editor_application.cpp b/modules/skplaintexteditor/app/editor_application.cpp
index cf37eb6..7ee67e1 100644
--- a/modules/skplaintexteditor/app/editor_application.cpp
+++ b/modules/skplaintexteditor/app/editor_application.cpp
@@ -366,8 +366,17 @@
     }
 };
 
-//static constexpr sk_app::Window::BackendType kBackendType = sk_app::Window::kRaster_BackendType;
+#ifdef SK_VULKAN
+static constexpr sk_app::Window::BackendType kBackendType = sk_app::Window::kVulkan_BackendType;
+#elif SK_METAL
+static constexpr sk_app::Window::BackendType kBackendType = sk_app::Window::kMetal_BackendType;
+#elif SK_GL
 static constexpr sk_app::Window::BackendType kBackendType = sk_app::Window::kNativeGL_BackendType;
+#elif SK_DAWN
+static constexpr sk_app::Window::BackendType kBackendType = sk_app::Window::kDawn_BackendType;
+#else
+static constexpr sk_app::Window::BackendType kBackendType = sk_app::Window::kRaster_BackendType;
+#endif
 
 struct EditorApplication : public sk_app::Application {
     std::unique_ptr<sk_app::Window> fWindow;
diff --git a/tools/sk_app/mac/WindowContextFactory_mac.h b/tools/sk_app/mac/WindowContextFactory_mac.h
index acf860a..e772030 100644
--- a/tools/sk_app/mac/WindowContextFactory_mac.h
+++ b/tools/sk_app/mac/WindowContextFactory_mac.h
@@ -35,18 +35,22 @@
     NSView*   fMainView;
 };
 
+#ifdef SK_VULKAN
 inline std::unique_ptr<WindowContext> MakeVulkanForMac(const MacWindowInfo&, const DisplayParams&) {
     // No Vulkan support on Mac.
     return nullptr;
 }
+#endif
 
+#ifdef SK_GL
+std::unique_ptr<WindowContext> MakeRasterForMac(const MacWindowInfo&, const DisplayParams&);
 std::unique_ptr<WindowContext> MakeGLForMac(const MacWindowInfo&, const DisplayParams&);
+#endif
 
 #ifdef SK_DAWN
 std::unique_ptr<WindowContext> MakeDawnMTLForMac(const MacWindowInfo&, const DisplayParams&);
 #endif
 
-std::unique_ptr<WindowContext> MakeRasterForMac(const MacWindowInfo&, const DisplayParams&);
 #ifdef SK_METAL
 std::unique_ptr<WindowContext> MakeMetalForMac(const MacWindowInfo&, const DisplayParams&);
 #endif
diff --git a/tools/sk_app/mac/Window_mac.mm b/tools/sk_app/mac/Window_mac.mm
index 63ef3f8..4cdee9c 100644
--- a/tools/sk_app/mac/Window_mac.mm
+++ b/tools/sk_app/mac/Window_mac.mm
@@ -139,15 +139,14 @@
 #endif
 #ifdef SK_GL
         case kNativeGL_BackendType:
-        default:
             fWindowContext = MakeGLForMac(info, fRequestedDisplayParams);
             break;
-#else
-        default:
-#endif
         case kRaster_BackendType:
             fWindowContext = MakeRasterForMac(info, fRequestedDisplayParams);
             break;
+#endif
+        default:
+            SkASSERT_RELEASE(false);
     }
     this->onBackendCreated();