Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 0c75727

Browse files
brianosmanSkia Commit-Bot
authored andcommitted
Disable OpenGL for Windows-on-ARM64
Bug: skia:8569 Change-Id: I4f526c8918a9a4aae4b6cd6d7c803b12e90e82ed Reviewed-on: https://skia-review.googlesource.com/c/175984 Reviewed-by: Mike Klein <mtklein@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
1 parent b2a0025 commit 0c75727

File tree

5 files changed

+41
-6
lines changed

5 files changed

+41
-6
lines changed

BUILD.gn

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,9 @@ optional("gpu_for_real") {
625625
sources += [ "src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp" ]
626626
} else if (is_win) {
627627
sources += [ "src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp" ]
628-
libs += [ "OpenGL32.lib" ]
628+
if (target_cpu != "arm64") {
629+
libs += [ "OpenGL32.lib" ]
630+
}
629631
} else {
630632
sources += [ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ]
631633
}
@@ -1416,10 +1418,10 @@ if (skia_enable_tools) {
14161418
sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
14171419
} else if (is_win) {
14181420
sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
1419-
libs += [
1420-
"Gdi32.lib",
1421-
"OpenGL32.lib",
1422-
]
1421+
libs += [ "Gdi32.lib" ]
1422+
if (target_cpu != "arm64") {
1423+
libs += [ "OpenGL32.lib" ]
1424+
}
14231425
}
14241426

14251427
cflags_objcc = [ "-fobjc-arc" ]

src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
#include "gl/GrGLAssembleInterface.h"
1414
#include "gl/GrGLUtil.h"
1515

16+
#if defined(_M_ARM64)
17+
18+
sk_sp<const GrGLInterface> GrGLMakeNativeInterface() { return nullptr; }
19+
20+
#else
21+
1622
class AutoLibraryUnload {
1723
public:
1824
AutoLibraryUnload(const char* moduleName) {
@@ -87,6 +93,8 @@ sk_sp<const GrGLInterface> GrGLMakeNativeInterface() {
8793
return nullptr;
8894
}
8995

96+
#endif // ARM64
97+
9098
const GrGLInterface* GrGLCreateNativeInterface() { return GrGLMakeNativeInterface().release(); }
9199

92100
#endif//defined(SK_BUILD_FOR_WIN)

src/utils/win/SkWGL_win.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
#include "SkTypes.h"
9-
#if defined(SK_BUILD_FOR_WIN)
9+
#if defined(SK_BUILD_FOR_WIN) && !defined(_M_ARM64)
1010

1111
#include "SkWGL.h"
1212

tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@
88

99
#include "gl/GLTestContext.h"
1010

11+
#if defined(_M_ARM64)
12+
13+
namespace sk_gpu_test {
14+
15+
GLTestContext* CreatePlatformGLTestContext(GrGLStandard, GLTestContext*) { return nullptr; }
16+
17+
} // namespace sk_gpu_test
18+
19+
#else
20+
1121
#include <windows.h>
1222
#include <GL/GL.h>
1323
#include "win/SkWGL.h"
@@ -220,3 +230,4 @@ GLTestContext* CreatePlatformGLTestContext(GrGLStandard forcedGpuAPI,
220230
}
221231
} // namespace sk_gpu_test
222232

233+
#endif

tools/sk_app/win/GLWindowContext_win.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@
1717
using sk_app::GLWindowContext;
1818
using sk_app::DisplayParams;
1919

20+
#if defined(_M_ARM64)
21+
22+
namespace sk_app {
23+
namespace window_context_factory {
24+
25+
WindowContext* NewGLForWin(HWND, const DisplayParams&) { return nullptr; }
26+
27+
} // namespace window_context_factory
28+
} // namespace sk_app
29+
30+
#else
31+
2032
namespace {
2133

2234
class GLWindowContext_win : public GLWindowContext {
@@ -141,3 +153,5 @@ WindowContext* NewGLForWin(HWND wnd, const DisplayParams& params) {
141153

142154
} // namespace window_context_factory
143155
} // namespace sk_app
156+
157+
#endif

0 commit comments

Comments
 (0)