From: <ho...@us...> - 2015-03-02 00:02:32
|
Revision: 8684 http://sourceforge.net/p/skim-app/code/8684 Author: hofman Date: 2015-03-02 00:02:25 +0000 (Mon, 02 Mar 2015) Log Message: ----------- setup open GL for hirez ini initializers Modified Paths: -------------- trunk/SKTransitionController.m Modified: trunk/SKTransitionController.m =================================================================== --- trunk/SKTransitionController.m 2015-03-01 22:54:38 UTC (rev 8683) +++ trunk/SKTransitionController.m 2015-03-02 00:02:25 UTC (rev 8684) @@ -138,7 +138,8 @@ #pragma mark - -@interface NSOpenGLView (SKMountainLionExtensions) +@interface NSOpenGLView (SKLionExtensions) +- (BOOL)wantsBestResolutionOpenGLSurface; - (void)setWantsBestResolutionOpenGLSurface:(BOOL)flag; @end @@ -227,10 +228,9 @@ [window setReleasedWhenClosed:NO]; [window setIgnoresMouseEvents:YES]; [window setContentView:[[[SKTransitionView alloc] init] autorelease]]; - if ([[window contentView] respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)]) - [(NSOpenGLView *)[window contentView] setWantsBestResolutionOpenGLSurface:YES]; - if ((self = [self initWithWindow:window])) { + self = [self initWithWindow:window]; + if (self) { view = aView; // don't retain as it may retain us transitionStyle = SKNoTransition; @@ -608,6 +608,8 @@ self = [super initWithFrame:frameRect pixelFormat:format]; if (self) { imageScale = 1.0; + if ([self respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)]) + [self setWantsBestResolutionOpenGLSurface:YES]; } return self; } @@ -616,6 +618,8 @@ self = [super initWithFrame:frameRect]; if (self) { imageScale = 1.0; + if ([self respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)]) + [self setWantsBestResolutionOpenGLSurface:YES]; } return self; } @@ -691,7 +695,7 @@ - (void)updateMatrices { NSRect bounds = [self bounds]; - CGFloat scale = [self backingScale]; + CGFloat scale = ([self respondsToSelector:@selector(wantsBestResolutionOpenGLSurface)] && [self wantsBestResolutionOpenGLSurface]) ? [self backingScale] : 1.0; [[self openGLContext] update]; @@ -708,7 +712,7 @@ } - (void)drawRect:(NSRect)rect { - CGFloat scale = [self backingScale]; + CGFloat scale = ([self respondsToSelector:@selector(wantsBestResolutionOpenGLSurface)] && [self wantsBestResolutionOpenGLSurface]) ? [self backingScale] : 1.0; [[self openGLContext] makeCurrentContext]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |