From 0503f354ded4567163bc5cea6318c6bbcd6045dc Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Tue, 17 Sep 2019 07:49:10 +1000 Subject: [PATCH] specify to skip alpha when drawing launcher on OSX This saves 1-3 ms on average when redrawing launcher at maximised size --- src/Window.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Window.c b/src/Window.c index 3f1fd2738..611a18a65 100644 --- a/src/Window.c +++ b/src/Window.c @@ -2234,7 +2234,7 @@ void Window_DrawFramebuffer(Rect2D r) { provider = CGDataProviderCreateWithData(NULL, fb_bmp.Scan0, Bitmap_DataSize(fb_bmp.Width, fb_bmp.Height), NULL); image = CGImageCreate(fb_bmp.Width, fb_bmp.Height, 8, 32, fb_bmp.Width * 4, colorSpace, - kCGBitmapByteOrder32Little | kCGImageAlphaFirst, provider, NULL, 0, 0); + kCGBitmapByteOrder32Little | kCGImageAlphaNoneSkipFirst, provider, NULL, 0, 0); CGContextDrawImage(context, rect, image); CGContextSynchronize(context); @@ -2308,6 +2308,7 @@ static void GLContext_UnsetFullscreen(void) { GLContext_SetDrawable(); win_fullscreen = false; + /* TODO: Eliminate this if possible */ Window_SetSize(ctx_windowWidth, ctx_windowHeight); } @@ -2326,6 +2327,7 @@ static void GLContext_SetFullscreen(void) { /* This is a weird hack to workaround a bug where the first time a context */ /* is made fullscreen, we just end up with a blank screen. So we undo it as fullscreen */ /* and redo it as fullscreen. */ + /* TODO: We really should'd need to do this. Need to debug on real hardware. */ if (!ctx_firstFullscreen) { ctx_firstFullscreen = true; GLContext_UnsetFullscreen(); @@ -3873,7 +3875,7 @@ void Window_DrawFramebuffer(Rect2D r) { provider = CGDataProviderCreateWithData(NULL, fb_bmp.Scan0, Bitmap_DataSize(fb_bmp.Width, fb_bmp.Height), NULL); image = CGImageCreate(fb_bmp.Width, fb_bmp.Height, 8, 32, fb_bmp.Width * 4, colorSpace, - kCGBitmapByteOrder32Little | kCGImageAlphaFirst, provider, NULL, 0, 0); + kCGBitmapByteOrder32Little | kCGImageAlphaNoneSkipFirst, provider, NULL, 0, 0); CGContextDrawImage(context, rect, image); CGContextSynchronize(context);