From 861b1223ec636efd48a6818ee7bcf2b7a7d2431f Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Thu, 17 Nov 2022 17:00:35 -0800 Subject: [PATCH] [macOS] Cleanup unnecessary references to Metal (flutter/engine#37733) Removes a few unncessary references to Metal in the macOS embedder. Now that Metal is the only supported rendering implementation for the macOS embedder, specifying a class as a Metal variant is redundant. Issue: https://github.com/flutter/flutter/issues/108304 Issue: https://github.com/flutter/flutter/issues/114445 --- .../macos/framework/Source/FlutterCompositorUnittests.mm | 8 ++++---- .../macos/framework/Source/FlutterSurfaceManagerTest.mm | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterCompositorUnittests.mm b/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterCompositorUnittests.mm index f2a9a8de3b..576af2bbac 100644 --- a/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterCompositorUnittests.mm +++ b/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterCompositorUnittests.mm @@ -10,16 +10,16 @@ #import "flutter/shell/platform/darwin/macos/framework/Source/FlutterViewProvider.h" #import "flutter/testing/testing.h" -@interface FlutterViewMockProviderMetal : NSObject { +@interface FlutterViewMockProvider : NSObject { FlutterView* _defaultView; } /** - * Create a FlutterViewMockProviderMetal with the provided view as the default view. + * Create a FlutterViewMockProvider with the provided view as the default view. */ - (nonnull instancetype)initWithDefaultView:(nonnull FlutterView*)view; @end -@implementation FlutterViewMockProviderMetal +@implementation FlutterViewMockProvider - (nonnull instancetype)initWithDefaultView:(nonnull FlutterView*)view { self = [super init]; @@ -57,7 +57,7 @@ id MockViewProvider() { }) .andReturn(backingStoreMock); - return [[FlutterViewMockProviderMetal alloc] initWithDefaultView:viewMock]; + return [[FlutterViewMockProvider alloc] initWithDefaultView:viewMock]; } } // namespace diff --git a/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterSurfaceManagerTest.mm b/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterSurfaceManagerTest.mm index 27b0e8748d..b9e1742abd 100644 --- a/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterSurfaceManagerTest.mm +++ b/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterSurfaceManagerTest.mm @@ -9,13 +9,13 @@ #include "flutter/testing/testing.h" #include "gtest/gtest.h" -@interface TestMetalView : NSView +@interface TestView : NSView - (nonnull instancetype)init; @end -@implementation TestMetalView +@implementation TestView - (instancetype)init { self = [super initWithFrame:NSZeroRect]; @@ -32,7 +32,7 @@ namespace flutter::testing { static FlutterSurfaceManager* CreateSurfaceManager() { id device = MTLCreateSystemDefaultDevice(); id commandQueue = [device newCommandQueue]; - TestMetalView* metalView = [[TestMetalView alloc] init]; + TestView* metalView = [[TestView alloc] init]; CALayer* layer = reinterpret_cast(metalView.layer); return [[FlutterSurfaceManager alloc] initWithDevice:device commandQueue:commandQueue