Skip to content

Commit

Permalink
whitespace tidyup after commit ab7529cb9558 for bug 4788
Browse files Browse the repository at this point in the history
  • Loading branch information
sezero committed Jun 21, 2020
1 parent 7c875d9 commit 6f1afbb
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
54 changes: 27 additions & 27 deletions src/video/quartz/SDL_QuartzVideo.m
Expand Up @@ -941,9 +941,9 @@ other blitting while waiting on the VBL (and hence results in higher framerates)
QZ_DoActivate(this);

[ window_view setNeedsDisplay:YES ];
[ [ qz_window contentView ] setNeedsDisplay:YES ];
[ qz_window displayIfNeeded ];
[ [ qz_window contentView ] setNeedsDisplay:YES ];
[ qz_window displayIfNeeded ];

return current;

/* Since the blanking window covers *all* windows (even force quit) correct recovery is crucial */
Expand Down Expand Up @@ -1119,11 +1119,11 @@ other blitting while waiting on the VBL (and hence results in higher framerates)

/* Save flags to ensure correct teardown */
mode_flags = current->flags;

[ window_view setNeedsDisplay:YES ];
[ [ qz_window contentView ] setNeedsDisplay:YES ];
[ qz_window displayIfNeeded ];
[ [ qz_window contentView ] setNeedsDisplay:YES ];
[ qz_window displayIfNeeded ];

/* Fade in again (asynchronously) if we came from a fullscreen mode and faded to black */
if (fade_token != kCGDisplayFadeReservationInvalidToken) {
CGDisplayFade (fade_token, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0.0, 0.0, 0.0, FALSE);
Expand Down Expand Up @@ -1164,12 +1164,12 @@ other blitting while waiting on the VBL (and hence results in higher framerates)
if (qz_window != nil) {
nsgfx_context = [NSGraphicsContext graphicsContextWithWindow:qz_window];
if (nsgfx_context != NULL) {
[NSGraphicsContext setCurrentContext:nsgfx_context];
}
else {
/* Whoops, looks like Mojave doesn't support this anymore */
fprintf(stderr,"Unable to obtain graphics context for NSWindow (Mojave behavior)\n");
}
[NSGraphicsContext setCurrentContext:nsgfx_context];
}
else {
/* Whoops, looks like Mojave doesn't support this anymore */
fprintf(stderr,"Unable to obtain graphics context for NSWindow (Mojave behavior)\n");
}
}

/* Setup the new pixel format */
Expand Down Expand Up @@ -1516,15 +1516,16 @@ static void QZ_DrawResizeIcon (_THIS)

static SDL_VideoDevice *last_this = NULL;

void QZ_UpdateRectsOnDrawRect(/*TODO: NSRect from drawRect*/) {
// HACK
SDL_VideoDevice *this = last_this;
void QZ_UpdateRectsOnDrawRect (/*TODO: NSRect from drawRect*/)
{
SDL_VideoDevice *this = last_this; /* HACK */

if (this == NULL) return;
if (SDL_VideoSurface == NULL) return;
if (this == NULL) return;
if (SDL_VideoSurface == NULL)
return;

if (SDL_VideoSurface->flags & SDL_OPENGLBLIT) {
// TODO
/* TODO? */
}
else if ( [ qz_window isMiniaturized ] ) {

Expand All @@ -1534,8 +1535,8 @@ void QZ_UpdateRectsOnDrawRect(/*TODO: NSRect from drawRect*/) {
else {
NSGraphicsContext *ctx = [NSGraphicsContext currentContext];
/* NTS: nsgfx_context == NULL will occur on Mojave, may be non-NULL on older versions of OS X */
if (nsgfx_context != NULL && ctx != nsgfx_context) { /* uhoh, you might be rendering from another thread... */
[NSGraphicsContext setCurrentContext:nsgfx_context];
if (nsgfx_context != NULL && ctx != nsgfx_context) { /* uhoh, you might be rendering from another thread... */
[NSGraphicsContext setCurrentContext:nsgfx_context];
ctx = nsgfx_context;
}
CGContextRef cgc = (CGContextRef) [ctx graphicsPort];
Expand All @@ -1552,20 +1553,19 @@ void QZ_UpdateRectsOnDrawRect(/*TODO: NSRect from drawRect*/) {

static void QZ_UpdateRects (_THIS, int numRects, SDL_Rect *rects)
{
// HACK
last_this = this;
last_this = this; /* HACK */

if (SDL_VideoSurface->flags & SDL_OPENGLBLIT) {
QZ_GL_SwapBuffers (this);
// TODO?
/* TODO? */
}
else if ( [ qz_window isMiniaturized ] ) {
/* Do nothing if miniaturized */
}
else {
[ window_view setNeedsDisplay:YES ];
[ [ qz_window contentView ] setNeedsDisplay:YES ];
[ qz_window displayIfNeeded ];
[ window_view setNeedsDisplay:YES ];
[ [ qz_window contentView ] setNeedsDisplay:YES ];
[ qz_window displayIfNeeded ];
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/video/quartz/SDL_QuartzWindow.m
Expand Up @@ -224,7 +224,7 @@ @implementation SDL_QuartzView

- (void)drawRect:(NSRect)dirtyRect
{
QZ_UpdateRectsOnDrawRect();
QZ_UpdateRectsOnDrawRect();
}

- (void)resetCursorRects
Expand Down

0 comments on commit 6f1afbb

Please sign in to comment.