diff --git a/engine/src/flutter/shell/common/shell_io_manager.cc b/engine/src/flutter/shell/common/shell_io_manager.cc index 22a6ef7089..d977c46186 100644 --- a/engine/src/flutter/shell/common/shell_io_manager.cc +++ b/engine/src/flutter/shell/common/shell_io_manager.cc @@ -13,20 +13,20 @@ namespace flutter { sk_sp ShellIOManager::CreateCompatibleResourceLoadingContext( GrBackend backend, sk_sp 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; } diff --git a/engine/src/flutter/tools/gn b/engine/src/flutter/tools/gn index c1046aad35..2028fe26bf 100755 --- a/engine/src/flutter/tools/gn +++ b/engine/src/flutter/tools/gn @@ -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']: