Skip to content

Commit

Permalink
Minor Metal backend cleanups and improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
fniephaus committed Mar 2, 2020
1 parent 0818124 commit c25b871
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions platforms/iOS/vm/OSX/sqSqueakOSXMetalView.m
Expand Up @@ -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];
Expand All @@ -138,6 +138,7 @@ - (id)initWithFrame:(NSRect)frameRect {
}

- (void)awakeFromNib {
[super awakeFromNib];
[self initialize];
}

Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -724,39 +725,39 @@ - (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;
}

- (NSAttributedString *)attributedSubstringForProposedRange:(NSRange)aRange actualRange:(NSRangePointer)actualRange {
return nil;
}

- (NSRange) markedRange {
- (NSRange)markedRange {
return inputMark;
}

- (NSRange) selectedRange {
- (NSRange)selectedRange {
return inputSelection;
}

- (NSRect)firstRectForCharacterRange:(NSRange)aRange actualRange:(NSRangePointer)actualRange {
return NSMakeRect(0,0, 0,0);
}

- (NSUInteger) characterIndexForPoint: (NSPoint)thePoint {
- (NSUInteger)characterIndexForPoint: (NSPoint)thePoint {
return 0;
}

- (NSArray *) validAttributesForMarkedText {
- (NSArray *)validAttributesForMarkedText {
return nil;
}

Expand Down Expand Up @@ -940,7 +941,6 @@ - (void) setExtraLayer: (unsigned int) handle texture: (id<MTLTexture>) texture
return mainMetalView ? mainMetalView.device : nil;
}


id<MTLCommandQueue>
getMainWindowMetalCommandQueue(void) {
return mainMetalView ? mainMetalView.graphicsCommandQueue : nil;
Expand Down

0 comments on commit c25b871

Please sign in to comment.