Skip to content

Commit 229cd84

Browse files
authored
Don't compile the Skia GL backend on iOS. (flutter#34924)
1 parent 1d0188c commit 229cd84

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

shell/common/shell_io_manager.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@ namespace flutter {
1313
sk_sp<GrDirectContext> ShellIOManager::CreateCompatibleResourceLoadingContext(
1414
GrBackend backend,
1515
sk_sp<const GrGLInterface> gl_interface) {
16+
#if !OS_FUCHSIA && SK_GL
1617
if (backend != GrBackend::kOpenGL_GrBackend) {
1718
return nullptr;
1819
}
1920

2021
const auto options = MakeDefaultContextOptions(ContextType::kResource);
2122

22-
#if !OS_FUCHSIA
2323
if (auto context = GrDirectContext::MakeGL(gl_interface, options)) {
2424
// Do not cache textures created by the image decoder. These textures
2525
// should be deleted when they are no longer referenced by an SkImage.
2626
context->setResourceCacheLimit(0);
2727
return context;
2828
}
29-
#endif
29+
#endif // !OS_FUCHSIA && SK_GL
3030

3131
return nullptr;
3232
}

tools/gn

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,12 +398,16 @@ def to_gn_args(args):
398398

399399
# Enable Metal on iOS builds.
400400
if args.target_os == 'ios':
401-
gn_args['skia_use_metal'] = True
401+
gn_args['shell_enable_gl'] = False
402+
gn_args['skia_use_gl'] = False
402403
gn_args['shell_enable_metal'] = True
404+
gn_args['skia_use_metal'] = True
403405
# Bitcode enabled builds using the current version of the toolchain leak
404406
# C++ symbols decorated with the availability attribute. Disable these
405407
# attributes in release modes till the toolchain is updated.
406408
gn_args['skia_enable_api_available_macro'] = args.runtime_mode != 'release'
409+
else:
410+
gn_args['skia_use_gl'] = args.target_os != 'fuchsia'
407411

408412
if sys.platform == 'darwin' and args.target_os not in ['android', 'fuchsia',
409413
'wasm']:

0 commit comments

Comments
 (0)