Skip to content

Commit

Permalink
[macOS] Cleanup unnecessary references to Metal (#37733)
Browse files Browse the repository at this point in the history
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: flutter/flutter#108304
Issue: flutter/flutter#114445
  • Loading branch information
cbracken committed Nov 18, 2022
1 parent f27666d commit 5471734
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterViewProvider.h"
#import "flutter/testing/testing.h"

@interface FlutterViewMockProviderMetal : NSObject <FlutterViewProvider> {
@interface FlutterViewMockProvider : NSObject <FlutterViewProvider> {
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];
Expand Down Expand Up @@ -57,7 +57,7 @@ - (nullable FlutterView*)getView:(uint64_t)viewId {
})
.andReturn(backingStoreMock);

return [[FlutterViewMockProviderMetal alloc] initWithDefaultView:viewMock];
return [[FlutterViewMockProvider alloc] initWithDefaultView:viewMock];
}
} // namespace

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -32,7 +32,7 @@ - (instancetype)init {
static FlutterSurfaceManager* CreateSurfaceManager() {
id<MTLDevice> device = MTLCreateSystemDefaultDevice();
id<MTLCommandQueue> commandQueue = [device newCommandQueue];
TestMetalView* metalView = [[TestMetalView alloc] init];
TestView* metalView = [[TestView alloc] init];
CALayer* layer = reinterpret_cast<CALayer*>(metalView.layer);
return [[FlutterSurfaceManager alloc] initWithDevice:device
commandQueue:commandQueue
Expand Down

0 comments on commit 5471734

Please sign in to comment.