Don't compile the Skia GL backend on iOS. (flutter/engine#34924)

This commit is contained in:
Chinmay Garde
2022-07-27 17:51:03 -07:00
committed by GitHub
parent 06e5813871
commit e1218270fd
2 changed files with 7 additions and 3 deletions

View File

@@ -13,20 +13,20 @@ namespace flutter {
sk_sp<GrDirectContext> ShellIOManager::CreateCompatibleResourceLoadingContext(
GrBackend backend,
sk_sp<const GrGLInterface> gl_interface) {
#if !OS_FUCHSIA && SK_GL
if (backend != GrBackend::kOpenGL_GrBackend) {
return nullptr;
}
const auto options = MakeDefaultContextOptions(ContextType::kResource);
#if !OS_FUCHSIA
if (auto context = GrDirectContext::MakeGL(gl_interface, options)) {
// Do not cache textures created by the image decoder. These textures
// should be deleted when they are no longer referenced by an SkImage.
context->setResourceCacheLimit(0);
return context;
}
#endif
#endif // !OS_FUCHSIA && SK_GL
return nullptr;
}

View File

@@ -398,12 +398,16 @@ def to_gn_args(args):
# Enable Metal on iOS builds.
if args.target_os == 'ios':
gn_args['skia_use_metal'] = True
gn_args['shell_enable_gl'] = False
gn_args['skia_use_gl'] = False
gn_args['shell_enable_metal'] = True
gn_args['skia_use_metal'] = True
# Bitcode enabled builds using the current version of the toolchain leak
# C++ symbols decorated with the availability attribute. Disable these
# attributes in release modes till the toolchain is updated.
gn_args['skia_enable_api_available_macro'] = args.runtime_mode != 'release'
else:
gn_args['skia_use_gl'] = args.target_os != 'fuchsia'
if sys.platform == 'darwin' and args.target_os not in ['android', 'fuchsia',
'wasm']: