This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -76,19 +76,12 @@ PlaygroundImplGLES::PlaygroundImplGLES(PlaygroundSwitches switches)
76
76
::glfwDefaultWindowHints ();
77
77
78
78
#if FML_OS_MACOSX
79
- if (use_angle_) {
80
- ::glfwWindowHint (GLFW_CONTEXT_CREATION_API, GLFW_EGL_CONTEXT_API);
81
- ::glfwWindowHint (GLFW_CLIENT_API, GLFW_OPENGL_ES_API);
82
- ::glfwWindowHint (GLFW_CONTEXT_VERSION_MAJOR, 2 );
83
- ::glfwWindowHint (GLFW_CONTEXT_VERSION_MINOR, 0 );
84
- } else {
85
- ::glfwWindowHint (GLFW_CLIENT_API, GLFW_OPENGL_API);
86
- }
87
- #else // FML_OS_MACOSX
79
+ FML_CHECK (use_angle_) << " Must use Angle on macOS for OpenGL ES." ;
80
+ ::glfwWindowHint (GLFW_CONTEXT_CREATION_API, GLFW_EGL_CONTEXT_API);
81
+ #endif // FML_OS_MACOSX
88
82
::glfwWindowHint (GLFW_CLIENT_API, GLFW_OPENGL_ES_API);
89
83
::glfwWindowHint (GLFW_CONTEXT_VERSION_MAJOR, 2 );
90
84
::glfwWindowHint (GLFW_CONTEXT_VERSION_MINOR, 0 );
91
- #endif // FML_OS_MACOSX
92
85
::glfwWindowHint (GLFW_RED_BITS, 8 );
93
86
::glfwWindowHint (GLFW_GREEN_BITS, 8 );
94
87
::glfwWindowHint (GLFW_BLUE_BITS, 8 );
Original file line number Diff line number Diff line change 6
6
7
7
#include < cstdlib>
8
8
9
+ #include " flutter/fml/build_config.h"
10
+
9
11
namespace impeller {
10
12
11
13
PlaygroundSwitches::PlaygroundSwitches () = default ;
@@ -20,6 +22,11 @@ PlaygroundSwitches::PlaygroundSwitches(const fml::CommandLine& args) {
20
22
}
21
23
enable_vulkan_validation = args.HasOption (" enable_vulkan_validation" );
22
24
use_swiftshader = args.HasOption (" use_swiftshader" );
25
+ use_angle = args.HasOption (" use_angle" );
26
+ #if FML_OS_MACOSX
27
+ // OpenGL on macOS is busted and deprecated. Use Angle there by default.
28
+ use_angle = true ;
29
+ #endif // FML_OS_MACOSX
23
30
}
24
31
25
32
} // namespace impeller
Original file line number Diff line number Diff line change @@ -26,6 +26,11 @@ struct PlaygroundSwitches {
26
26
// / find a SwiftShader implementation.
27
27
// /
28
28
bool use_swiftshader = false ;
29
+ // / Attempt to use Angle on the system instead of the available OpenGL ES
30
+ // / implementation. This is on-by-default on macOS due to the broken-ness in
31
+ // / the deprecated OpenGL implementation. On other platforms, it this opt-in
32
+ // / via the flag with the system OpenGL ES implementation used by fault.
33
+ // /
29
34
bool use_angle = false ;
30
35
31
36
PlaygroundSwitches ();
You can’t perform that action at this time.
0 commit comments