From c25b8713647d8bba5264b792654747f7174b0eed Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Mon, 2 Mar 2020 17:25:23 +0100 Subject: [PATCH] Minor Metal backend cleanups and improvements --- platforms/iOS/vm/OSX/sqSqueakOSXMetalView.m | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/platforms/iOS/vm/OSX/sqSqueakOSXMetalView.m b/platforms/iOS/vm/OSX/sqSqueakOSXMetalView.m index dd804c58a7..3621f20b25 100644 --- a/platforms/iOS/vm/OSX/sqSqueakOSXMetalView.m +++ b/platforms/iOS/vm/OSX/sqSqueakOSXMetalView.m @@ -127,7 +127,7 @@ + (BOOL) isMetalViewSupported { #pragma mark Initialization / Release - (id)initWithFrame:(NSRect)frameRect { - self = [self initWithFrame: NSRectToCGRect(frameRect) device: MTLCreateSystemDefaultDevice()]; + self = [super initWithFrame:frameRect]; [self setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; [self setAutoresizesSubviews:YES]; @@ -138,6 +138,7 @@ - (id)initWithFrame:(NSRect)frameRect { } - (void)awakeFromNib { + [super awakeFromNib]; [self initialize]; } @@ -323,7 +324,7 @@ -(void)drawRect:(NSRect)rect [self setupMetal]; [self setupFullScreendispBitsIndex]; - // Alawys try to fill the texture with the pixels. + // Always try to fill the texture with the pixels. if ( fullScreendispBitsIndex ) { [self loadTexturesFrom: fullScreendispBitsIndex subRectangle: (clippyIsEmpty ? rect : NSRectFromCGRect(clippy))]; //[self loadTexturesFrom: fullScreendispBitsIndex subRectangle: rect]; @@ -724,15 +725,15 @@ - (void)setMarkedText:(id)aString selectedRange:(NSRange)selectedRange replaceme inputSelection= NSMakeRange(NSNotFound, 0); } -- (void) unmarkText { +- (void)unmarkText { inputMark= NSMakeRange(NSNotFound, 0); } -- (BOOL) hasMarkedText { +- (BOOL)hasMarkedText { return inputMark.location != NSNotFound; } -- (NSInteger) conversationIdentifier { +- (NSInteger)conversationIdentifier { return (NSInteger )self; } @@ -740,11 +741,11 @@ - (NSAttributedString *)attributedSubstringForProposedRange:(NSRange)aRange actu return nil; } -- (NSRange) markedRange { +- (NSRange)markedRange { return inputMark; } -- (NSRange) selectedRange { +- (NSRange)selectedRange { return inputSelection; } @@ -752,11 +753,11 @@ - (NSRect)firstRectForCharacterRange:(NSRange)aRange actualRange:(NSRangePointer return NSMakeRect(0,0, 0,0); } -- (NSUInteger) characterIndexForPoint: (NSPoint)thePoint { +- (NSUInteger)characterIndexForPoint: (NSPoint)thePoint { return 0; } -- (NSArray *) validAttributesForMarkedText { +- (NSArray *)validAttributesForMarkedText { return nil; } @@ -940,7 +941,6 @@ - (void) setExtraLayer: (unsigned int) handle texture: (id) texture return mainMetalView ? mainMetalView.device : nil; } - id getMainWindowMetalCommandQueue(void) { return mainMetalView ? mainMetalView.graphicsCommandQueue : nil;