Revert "Fix sk_app macOS raster window build conditions."
This reverts commit 163ba10ddefab50ef11411f17af7e8325cff98c1.
Reason for revert: Mac linker errors
Original change's description:
> 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>
TBR=bungeman@google.com,brianosman@google.com
Change-Id: Ie5fa24138e4387784c21559f28528a4c4d335626
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/397737
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/BUILD.gn b/BUILD.gn
index c86f0b0..7b03e0f 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -2557,6 +2557,7 @@
]
} 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",
@@ -2591,10 +2592,7 @@
sources += [ "tools/sk_app/win/ANGLEWindowContext_win.cpp" ]
}
} else if (is_mac) {
- sources += [
- "tools/sk_app/mac/GLWindowContext_mac.mm",
- "tools/sk_app/mac/RasterWindowContext_mac.mm",
- ]
+ sources += [ "tools/sk_app/mac/GLWindowContext_mac.mm" ]
} else if (is_ios) {
sources += [ "tools/sk_app/ios/GLWindowContext_ios.mm" ]
}
@@ -2865,7 +2863,7 @@
]
}
- if (skia_use_icu && skia_use_harfbuzz) {
+ if (skia_use_gl && 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 7ee67e1..cf37eb6 100644
--- a/modules/skplaintexteditor/app/editor_application.cpp
+++ b/modules/skplaintexteditor/app/editor_application.cpp
@@ -366,17 +366,8 @@
}
};
-#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::kRaster_BackendType;
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 e772030..acf860a 100644
--- a/tools/sk_app/mac/WindowContextFactory_mac.h
+++ b/tools/sk_app/mac/WindowContextFactory_mac.h
@@ -35,22 +35,18 @@
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 4cdee9c..63ef3f8 100644
--- a/tools/sk_app/mac/Window_mac.mm
+++ b/tools/sk_app/mac/Window_mac.mm
@@ -139,14 +139,15 @@
#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();