Skip to content

Commit

Permalink
Don't compile the Skia GL backend on iOS. (flutter#34924)
Browse files Browse the repository at this point in the history
  • Loading branch information
chinmaygarde authored Jul 28, 2022
1 parent 1d0188c commit 229cd84
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions shell/common/shell_io_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 5 additions & 1 deletion tools/gn
Original file line number Diff line number Diff line change
Expand Up @@ -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']:
Expand Down

0 comments on commit 229cd84

Please sign in to comment.