未验证 提交 07e7dafa 编写于 作者: K Kaushik Iska 提交者: GitHub

[macos] Make metal the default rendering backend on macOS >= 10.14 (#23967)

Fixes: https://github.com/flutter/flutter/issues/74058
上级 9fd39160
...@@ -1132,6 +1132,8 @@ FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterOpenG ...@@ -1132,6 +1132,8 @@ FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterOpenG
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterOpenGLRenderer.mm FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterOpenGLRenderer.mm
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterOpenGLRendererTest.mm FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterOpenGLRendererTest.mm
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterRenderer.h FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterRenderer.h
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterRenderingBackend.h
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterRenderingBackend.mm
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterResizableBackingStoreProvider.h FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterResizableBackingStoreProvider.h
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterResizableBackingStoreProvider.mm FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterResizableBackingStoreProvider.mm
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterResizeSynchronizer.h FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterResizeSynchronizer.h
......
...@@ -82,6 +82,8 @@ source_set("flutter_framework_source") { ...@@ -82,6 +82,8 @@ source_set("flutter_framework_source") {
"framework/Source/FlutterOpenGLRenderer.h", "framework/Source/FlutterOpenGLRenderer.h",
"framework/Source/FlutterOpenGLRenderer.mm", "framework/Source/FlutterOpenGLRenderer.mm",
"framework/Source/FlutterRenderer.h", "framework/Source/FlutterRenderer.h",
"framework/Source/FlutterRenderingBackend.h",
"framework/Source/FlutterRenderingBackend.mm",
"framework/Source/FlutterResizableBackingStoreProvider.h", "framework/Source/FlutterResizableBackingStoreProvider.h",
"framework/Source/FlutterResizableBackingStoreProvider.mm", "framework/Source/FlutterResizableBackingStoreProvider.mm",
"framework/Source/FlutterResizeSynchronizer.h", "framework/Source/FlutterResizeSynchronizer.h",
...@@ -152,23 +154,17 @@ executable("flutter_desktop_darwin_unittests") { ...@@ -152,23 +154,17 @@ executable("flutter_desktop_darwin_unittests") {
testonly = true testonly = true
sources = [ sources = [
"framework/Source/FlutterEmbedderExternalTextureUnittests.mm",
"framework/Source/FlutterEngineTest.mm", "framework/Source/FlutterEngineTest.mm",
"framework/Source/FlutterGLCompositorUnittests.mm", "framework/Source/FlutterGLCompositorUnittests.mm",
"framework/Source/FlutterMetalRendererTest.mm",
"framework/Source/FlutterMetalSurfaceManagerTest.mm",
"framework/Source/FlutterOpenGLRendererTest.mm",
"framework/Source/FlutterViewControllerTest.mm", "framework/Source/FlutterViewControllerTest.mm",
"framework/Source/FlutterViewControllerTestUtils.h", "framework/Source/FlutterViewControllerTestUtils.h",
"framework/Source/FlutterViewControllerTestUtils.mm", "framework/Source/FlutterViewControllerTestUtils.mm",
] ]
if (shell_enable_metal) {
sources += [
"framework/Source/FlutterEmbedderExternalTextureUnittests.mm",
"framework/Source/FlutterMetalRendererTest.mm",
"framework/Source/FlutterMetalSurfaceManagerTest.mm",
]
} else {
sources += [ "framework/Source/FlutterOpenGLRendererTest.mm" ]
}
cflags_objcc = flutter_cflags_objcc_arc cflags_objcc = flutter_cflags_objcc_arc
ldflags = [ "-ObjC" ] ldflags = [ "-ObjC" ]
...@@ -177,6 +173,7 @@ executable("flutter_desktop_darwin_unittests") { ...@@ -177,6 +173,7 @@ executable("flutter_desktop_darwin_unittests") {
":flutter_desktop_darwin_fixtures", ":flutter_desktop_darwin_fixtures",
":flutter_framework_source", ":flutter_framework_source",
"//flutter/shell/platform/darwin/common:framework_shared", "//flutter/shell/platform/darwin/common:framework_shared",
"//flutter/shell/platform/darwin/graphics",
"//flutter/shell/platform/embedder:embedder_as_internal_library", "//flutter/shell/platform/embedder:embedder_as_internal_library",
"//flutter/shell/platform/embedder:embedder_test_utils", "//flutter/shell/platform/embedder:embedder_test_utils",
"//flutter/testing", "//flutter/testing",
...@@ -185,10 +182,6 @@ executable("flutter_desktop_darwin_unittests") { ...@@ -185,10 +182,6 @@ executable("flutter_desktop_darwin_unittests") {
"//flutter/testing:testing_lib", "//flutter/testing:testing_lib",
"//third_party/ocmock:ocmock", "//third_party/ocmock:ocmock",
] ]
if (shell_enable_metal) {
deps += [ "//flutter/shell/platform/darwin/graphics" ]
}
} }
copy("copy_dylib") { copy("copy_dylib") {
......
...@@ -41,6 +41,9 @@ TEST(FlutterEmbedderExternalTextureUnittests, TestTextureResolution) { ...@@ -41,6 +41,9 @@ TEST(FlutterEmbedderExternalTextureUnittests, TestTextureResolution) {
textureDescriptor.usage = MTLTextureUsageRenderTarget | MTLTextureUsageShaderRead; textureDescriptor.usage = MTLTextureUsageRenderTarget | MTLTextureUsageShaderRead;
id<MTLTexture> mtlTexture = id<MTLTexture> mtlTexture =
[darwinContextMetal.device newTextureWithDescriptor:textureDescriptor]; [darwinContextMetal.device newTextureWithDescriptor:textureDescriptor];
std::vector<FlutterMetalTextureHandle> textures = {
(__bridge FlutterMetalTextureHandle)mtlTexture,
};
// callback to resolve the texture. // callback to resolve the texture.
EmbedderExternalTextureMetal::ExternalTextureCallback callback = [&](int64_t texture_id, size_t w, EmbedderExternalTextureMetal::ExternalTextureCallback callback = [&](int64_t texture_id, size_t w,
...@@ -54,11 +57,6 @@ TEST(FlutterEmbedderExternalTextureUnittests, TestTextureResolution) { ...@@ -54,11 +57,6 @@ TEST(FlutterEmbedderExternalTextureUnittests, TestTextureResolution) {
texture->height = h; texture->height = h;
texture->width = w; texture->width = w;
texture->pixel_format = FlutterMetalExternalTexturePixelFormat::kRGBA; texture->pixel_format = FlutterMetalExternalTexturePixelFormat::kRGBA;
std::vector<FlutterMetalTextureHandle> textures = {
(__bridge FlutterMetalTextureHandle)mtlTexture,
};
texture->textures = textures.data(); texture->textures = textures.data();
return std::unique_ptr<FlutterMetalExternalTexture>(texture); return std::unique_ptr<FlutterMetalExternalTexture>(texture);
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterGLCompositor.h" #import "flutter/shell/platform/darwin/macos/framework/Source/FlutterGLCompositor.h"
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterMetalRenderer.h" #import "flutter/shell/platform/darwin/macos/framework/Source/FlutterMetalRenderer.h"
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterOpenGLRenderer.h" #import "flutter/shell/platform/darwin/macos/framework/Source/FlutterOpenGLRenderer.h"
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterRenderingBackend.h"
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterViewController_Internal.h" #import "flutter/shell/platform/darwin/macos/framework/Source/FlutterViewController_Internal.h"
#import "flutter/shell/platform/embedder/embedder.h" #import "flutter/shell/platform/embedder/embedder.h"
...@@ -131,10 +132,6 @@ static void OnPlatformMessage(const FlutterPlatformMessage* message, FlutterEngi ...@@ -131,10 +132,6 @@ static void OnPlatformMessage(const FlutterPlatformMessage* message, FlutterEngi
// Pointer to the Dart AOT snapshot and instruction data. // Pointer to the Dart AOT snapshot and instruction data.
_FlutterEngineAOTData* _aotData; _FlutterEngineAOTData* _aotData;
// If set to true, engine will render using metal. This is controlled by SHELL_ENABLE_METAL
// for now, intent is to be made default in the future.
BOOL _enableMetalRendering;
// _macOSGLCompositor is created when the engine is created and // _macOSGLCompositor is created when the engine is created and
// it's destruction is handled by ARC when the engine is destroyed. // it's destruction is handled by ARC when the engine is destroyed.
std::unique_ptr<flutter::FlutterGLCompositor> _macOSGLCompositor; std::unique_ptr<flutter::FlutterGLCompositor> _macOSGLCompositor;
...@@ -157,14 +154,10 @@ static void OnPlatformMessage(const FlutterPlatformMessage* message, FlutterEngi ...@@ -157,14 +154,10 @@ static void OnPlatformMessage(const FlutterPlatformMessage* message, FlutterEngi
_messageHandlers = [[NSMutableDictionary alloc] init]; _messageHandlers = [[NSMutableDictionary alloc] init];
_allowHeadlessExecution = allowHeadlessExecution; _allowHeadlessExecution = allowHeadlessExecution;
#ifdef SHELL_ENABLE_METAL
_enableMetalRendering = YES;
#endif
_embedderAPI.struct_size = sizeof(FlutterEngineProcTable); _embedderAPI.struct_size = sizeof(FlutterEngineProcTable);
FlutterEngineGetProcAddresses(&_embedderAPI); FlutterEngineGetProcAddresses(&_embedderAPI);
if (_enableMetalRendering) { if ([FlutterRenderingBackend renderUsingMetal]) {
_renderer = [[FlutterMetalRenderer alloc] initWithFlutterEngine:self]; _renderer = [[FlutterMetalRenderer alloc] initWithFlutterEngine:self];
} else { } else {
_renderer = [[FlutterOpenGLRenderer alloc] initWithFlutterEngine:self]; _renderer = [[FlutterOpenGLRenderer alloc] initWithFlutterEngine:self];
...@@ -307,7 +300,7 @@ static void OnPlatformMessage(const FlutterPlatformMessage* message, FlutterEngi ...@@ -307,7 +300,7 @@ static void OnPlatformMessage(const FlutterPlatformMessage* message, FlutterEngi
- (FlutterCompositor*)createFlutterCompositor { - (FlutterCompositor*)createFlutterCompositor {
// When rendering with metal do not support platform views. // When rendering with metal do not support platform views.
if (_enableMetalRendering) { if ([FlutterRenderingBackend renderUsingMetal]) {
return nil; return nil;
} }
......
...@@ -13,21 +13,36 @@ ...@@ -13,21 +13,36 @@
#include "flutter/shell/platform/embedder/test_utils/proc_table_replacement.h" #include "flutter/shell/platform/embedder/test_utils/proc_table_replacement.h"
#include "flutter/testing/testing.h" #include "flutter/testing/testing.h"
namespace flutter::testing { @interface TestOpenGLEngine : FlutterEngine
@property(nonatomic, readwrite) id<FlutterRenderer> renderer;
- (nullable instancetype)initWithGLRenderer;
@end
@implementation TestOpenGLEngine
namespace { @synthesize renderer;
// Returns an engine configured for the test fixture resource configuration.
FlutterEngine* CreateTestEngine() { - (nullable instancetype)initWithGLRenderer {
NSString* fixtures = @(testing::GetFixturesPath()); NSString* fixtures = @(flutter::testing::GetFixturesPath());
FlutterDartProject* project = [[FlutterDartProject alloc] FlutterDartProject* project = [[FlutterDartProject alloc]
initWithAssetsPath:fixtures initWithAssetsPath:fixtures
ICUDataPath:[fixtures stringByAppendingString:@"/icudtl.dat"]]; ICUDataPath:[fixtures stringByAppendingString:@"/icudtl.dat"]];
return [[FlutterEngine alloc] initWithName:@"test" project:project allowHeadlessExecution:true]; self = [self initWithName:@"test" project:project allowHeadlessExecution:true];
if (self) {
renderer = [[FlutterOpenGLRenderer alloc] initWithFlutterEngine:self];
}
return self;
} }
} // namespace
@end
namespace flutter::testing {
TEST(FlutterOpenGLRenderer, RegisterExternalTexture) { TEST(FlutterOpenGLRenderer, RegisterExternalTexture) {
FlutterEngine* engine = CreateTestEngine(); FlutterEngine* engine = [[TestOpenGLEngine alloc] initWithGLRenderer];
EXPECT_TRUE([engine runWithEntrypoint:@"main"]); EXPECT_TRUE([engine runWithEntrypoint:@"main"]);
id<FlutterTexture> flutterTexture = OCMProtocolMock(@protocol(FlutterTexture)); id<FlutterTexture> flutterTexture = OCMProtocolMock(@protocol(FlutterTexture));
...@@ -48,7 +63,7 @@ TEST(FlutterOpenGLRenderer, RegisterExternalTexture) { ...@@ -48,7 +63,7 @@ TEST(FlutterOpenGLRenderer, RegisterExternalTexture) {
} }
TEST(FlutterOpenGLRenderer, UnregisterExternalTexture) { TEST(FlutterOpenGLRenderer, UnregisterExternalTexture) {
FlutterEngine* engine = CreateTestEngine(); FlutterEngine* engine = [[TestOpenGLEngine alloc] initWithGLRenderer];
EXPECT_TRUE([engine runWithEntrypoint:@"main"]); EXPECT_TRUE([engine runWithEntrypoint:@"main"]);
id<FlutterTexture> flutterTexture = OCMProtocolMock(@protocol(FlutterTexture)); id<FlutterTexture> flutterTexture = OCMProtocolMock(@protocol(FlutterTexture));
...@@ -70,7 +85,7 @@ TEST(FlutterOpenGLRenderer, UnregisterExternalTexture) { ...@@ -70,7 +85,7 @@ TEST(FlutterOpenGLRenderer, UnregisterExternalTexture) {
} }
TEST(FlutterOpenGLRenderer, MarkExternalTextureFrameAvailable) { TEST(FlutterOpenGLRenderer, MarkExternalTextureFrameAvailable) {
FlutterEngine* engine = CreateTestEngine(); FlutterEngine* engine = [[TestOpenGLEngine alloc] initWithGLRenderer];
EXPECT_TRUE([engine runWithEntrypoint:@"main"]); EXPECT_TRUE([engine runWithEntrypoint:@"main"]);
id<FlutterTexture> flutterTexture = OCMProtocolMock(@protocol(FlutterTexture)); id<FlutterTexture> flutterTexture = OCMProtocolMock(@protocol(FlutterTexture));
...@@ -92,7 +107,7 @@ TEST(FlutterOpenGLRenderer, MarkExternalTextureFrameAvailable) { ...@@ -92,7 +107,7 @@ TEST(FlutterOpenGLRenderer, MarkExternalTextureFrameAvailable) {
} }
TEST(FlutterOpenGLRenderer, PresetDelegatesToFlutterView) { TEST(FlutterOpenGLRenderer, PresetDelegatesToFlutterView) {
FlutterEngine* engine = CreateTestEngine(); FlutterEngine* engine = [[TestOpenGLEngine alloc] initWithGLRenderer];
FlutterOpenGLRenderer* renderer = [[FlutterOpenGLRenderer alloc] initWithFlutterEngine:engine]; FlutterOpenGLRenderer* renderer = [[FlutterOpenGLRenderer alloc] initWithFlutterEngine:engine];
id mockFlutterView = OCMClassMock([FlutterView class]); id mockFlutterView = OCMClassMock([FlutterView class]);
[[mockFlutterView expect] present]; [[mockFlutterView expect] present];
...@@ -102,7 +117,7 @@ TEST(FlutterOpenGLRenderer, PresetDelegatesToFlutterView) { ...@@ -102,7 +117,7 @@ TEST(FlutterOpenGLRenderer, PresetDelegatesToFlutterView) {
} }
TEST(FlutterOpenGLRenderer, FBOReturnedByFlutterView) { TEST(FlutterOpenGLRenderer, FBOReturnedByFlutterView) {
FlutterEngine* engine = CreateTestEngine(); FlutterEngine* engine = [[TestOpenGLEngine alloc] initWithGLRenderer];
FlutterOpenGLRenderer* renderer = [[FlutterOpenGLRenderer alloc] initWithFlutterEngine:engine]; FlutterOpenGLRenderer* renderer = [[FlutterOpenGLRenderer alloc] initWithFlutterEngine:engine];
id mockFlutterView = OCMClassMock([FlutterView class]); id mockFlutterView = OCMClassMock([FlutterView class]);
FlutterFrameInfo frameInfo; FlutterFrameInfo frameInfo;
......
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import <Cocoa/Cocoa.h>
/**
* Flutter on macOS currently supports both OpenGL and Metal rendering backends. This class provides
* utilities for determining the rendering backend and the corresponging layer properties.
*/
@interface FlutterRenderingBackend : NSObject
/**
* Returns YES if the engine is supposed to use Metal as the rendering backend. On macOS versions
* >= 10.4 this is YES.
*/
+ (BOOL)renderUsingMetal;
/**
* CALayer class depending on the rendering backend.
*/
+ (nonnull Class)layerClass;
/**
* On both Metal and OpenGL rendering backends, `wantsLayer` is set on the `FlutterView`. This
* methos is used by `FlutterView` to provide the said `CALayer`.
*/
+ (nonnull CALayer*)createBackingLayer;
@end
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterRenderingBackend.h"
#import <QuartzCore/QuartzCore.h>
@implementation FlutterRenderingBackend
+ (BOOL)renderUsingMetal {
if (@available(macOS 10.14, *)) {
return YES;
} else {
return NO;
}
}
+ (Class)layerClass {
BOOL enableMetal = [FlutterRenderingBackend renderUsingMetal];
if (enableMetal) {
return [CAMetalLayer class];
} else {
return [CAOpenGLLayer class];
}
}
+ (CALayer*)createBackingLayer {
BOOL enableMetal = [FlutterRenderingBackend renderUsingMetal];
if (enableMetal) {
CAMetalLayer* metalLayer = [CAMetalLayer layer];
// This is set to true to synchronize the presentation of the layer and its contents with Core
// Animation. When presenting the texture see `[FlutterMetalResizableBackingStoreProvider
// resizeSynchronizerCommit:]` we start a CATransaction and wait for the command buffer to be
// scheduled. This ensures that the resizing process is smooth.
metalLayer.presentsWithTransaction = YES;
metalLayer.autoresizingMask = kCALayerHeightSizable | kCALayerWidthSizable;
return metalLayer;
} else {
return [CAOpenGLLayer layer];
}
}
@end
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterView.h" #import "flutter/shell/platform/darwin/macos/framework/Source/FlutterView.h"
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterRenderingBackend.h"
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterResizeSynchronizer.h" #import "flutter/shell/platform/darwin/macos/framework/Source/FlutterResizeSynchronizer.h"
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterSurfaceManager.h" #import "flutter/shell/platform/darwin/macos/framework/Source/FlutterSurfaceManager.h"
#import "flutter/shell/platform/darwin/macos/framework/Source/MacOSGLContextSwitch.h" #import "flutter/shell/platform/darwin/macos/framework/Source/MacOSGLContextSwitch.h"
...@@ -39,22 +40,13 @@ ...@@ -39,22 +40,13 @@
return self; return self;
} }
#ifdef SHELL_ENABLE_METAL
+ (Class)layerClass { + (Class)layerClass {
return [CAMetalLayer class]; return [FlutterRenderingBackend layerClass];
} }
- (CALayer*)makeBackingLayer { - (CALayer*)makeBackingLayer {
CAMetalLayer* metalLayer = [CAMetalLayer layer]; return [FlutterRenderingBackend createBackingLayer];
// This is set to true to synchronize the presentation of the layer and its contents with Core
// Animation. When presenting the texture see `[FlutterMetalResizableBackingStoreProvider
// resizeSynchronizerCommit:]` we start a CATransaction and wait for the command buffer to be
// scheduled. This ensures that the resizing process is smooth.
metalLayer.presentsWithTransaction = YES;
metalLayer.autoresizingMask = kCALayerHeightSizable | kCALayerWidthSizable;
return metalLayer;
} }
#endif
- (instancetype)initWithMainContext:(NSOpenGLContext*)mainContext - (instancetype)initWithMainContext:(NSOpenGLContext*)mainContext
reshapeListener:(id<FlutterViewReshapeListener>)reshapeListener { reshapeListener:(id<FlutterViewReshapeListener>)reshapeListener {
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterMetalRenderer.h" #import "flutter/shell/platform/darwin/macos/framework/Source/FlutterMetalRenderer.h"
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterMouseCursorPlugin.h" #import "flutter/shell/platform/darwin/macos/framework/Source/FlutterMouseCursorPlugin.h"
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterOpenGLRenderer.h" #import "flutter/shell/platform/darwin/macos/framework/Source/FlutterOpenGLRenderer.h"
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterRenderingBackend.h"
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterTextInputPlugin.h" #import "flutter/shell/platform/darwin/macos/framework/Source/FlutterTextInputPlugin.h"
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterView.h" #import "flutter/shell/platform/darwin/macos/framework/Source/FlutterView.h"
#import "flutter/shell/platform/embedder/embedder.h" #import "flutter/shell/platform/embedder/embedder.h"
...@@ -278,11 +279,7 @@ static void CommonInit(FlutterViewController* controller) { ...@@ -278,11 +279,7 @@ static void CommonInit(FlutterViewController* controller) {
- (void)loadView { - (void)loadView {
FlutterView* flutterView; FlutterView* flutterView;
BOOL enableMetalRendering = NO; if ([FlutterRenderingBackend renderUsingMetal]) {
#ifdef SHELL_ENABLE_METAL
enableMetalRendering = YES;
#endif
if (enableMetalRendering) {
FlutterMetalRenderer* metalRenderer = reinterpret_cast<FlutterMetalRenderer*>(_engine.renderer); FlutterMetalRenderer* metalRenderer = reinterpret_cast<FlutterMetalRenderer*>(_engine.renderer);
id<MTLDevice> device = metalRenderer.device; id<MTLDevice> device = metalRenderer.device;
id<MTLCommandQueue> commandQueue = metalRenderer.commandQueue; id<MTLCommandQueue> commandQueue = metalRenderer.commandQueue;
......
...@@ -54,6 +54,9 @@ def get_out_dir(args): ...@@ -54,6 +54,9 @@ def get_out_dir(args):
if args.enable_vulkan: if args.enable_vulkan:
target_dir.append('vulkan') target_dir.append('vulkan')
# This exists for backwards compatibility of tests that are being run
# on LUCI. This can be removed in coordination with a LUCI change:
# https://github.com/flutter/flutter/issues/76547
if args.macos_enable_metal: if args.macos_enable_metal:
target_dir.append('metal') target_dir.append('metal')
...@@ -263,11 +266,7 @@ def to_gn_args(args): ...@@ -263,11 +266,7 @@ def to_gn_args(args):
# build a macOS metal only shell and a gl only shell. # build a macOS metal only shell and a gl only shell.
gn_args['allow_deprecated_api_calls'] = True gn_args['allow_deprecated_api_calls'] = True
gn_args['skia_use_metal'] = True gn_args['skia_use_metal'] = True
if args.macos_enable_metal: gn_args['shell_enable_metal'] = True
gn_args['shell_enable_metal'] = True
# Skia has Metal support on macOS version >= 10.14.
MACOS_SKIA_METAL_SUPPORTED_MIN_VERSION = '10.14'
gn_args['mac_sdk_min'] = MACOS_SKIA_METAL_SUPPORTED_MIN_VERSION
if args.enable_vulkan: if args.enable_vulkan:
# Enable vulkan in the Flutter shell. # Enable vulkan in the Flutter shell.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册