Brendan Shanks (@bshanks) commented about dlls/winemac.drv/surface.c:
CGImageRef image; + IOSurfaceRef io_surface = surface->back_buffer;
- colorspace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB); - image = CGImageCreate(color_info->bmiHeader.biWidth, abs(color_info->bmiHeader.biHeight), 8, 32, - color_info->bmiHeader.biSizeImage / abs(color_info->bmiHeader.biHeight), colorspace, - alpha_info | kCGBitmapByteOrder32Little, surface->provider, NULL, retina_on, kCGRenderingIntentDefault); - CGColorSpaceRelease(colorspace); + /* Swap the front and back buffers, so we are not writing into the presented surface */ + surface->back_buffer = surface->front_buffer; + surface->front_buffer = io_surface; + IOSurfaceLock(io_surface, 0, NULL);
- macdrv_window_set_color_image(surface->window, image, cgrect_from_rect(*rect), cgrect_from_rect(*dirty)); - CGImageRelease(image); + /* First only copy the RBG componenets from color_bits as it uses BGRX */
typo: should be "components" -- https://gitlab.winehq.org/wine/wine/-/merge_requests/7938#note_124833