/* Helper function that blits the front buffer contents to the target window. */void x11_copy_to_screen(const struct wined3d_swapchain *swapchain, const RECT *rect){ struct wined3d_surface *front; POINT offset = {0, 0}; HDC src_dc, dst_dc; RECT draw_rect; HWND window; TRACE("swapchain %p, rect %s./n", swapchain, wine_dbgstr_rect(rect)); front = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0)); if (swapchain->palette) wined3d_palette_apply_to_dc(swapchain->palette, front->hDC); if (front->resource.map_count) ERR("Trying to blit a mapped surface./n"); TRACE("Copying surface %p to screen./n", front); surface_load_location(front, WINED3D_LOCATION_DIB); src_dc = front->hDC; window = swapchain->win_handle; dst_dc = GetDCEx(window, 0, DCX_CLIPSIBLINGS | DCX_CACHE); /* Front buffer coordinates are screen coordinates. Map them to the * destination window if not fullscreened. */ if (swapchain->desc.windowed) ClientToScreen(window, &offset); TRACE("offset %s./n", wine_dbgstr_point(&offset)); draw_rect.left = 0; draw_rect.right = front->resource.width; draw_rect.top = 0; draw_rect.bottom = front->resource.height; if (rect) IntersectRect(&draw_rect, &draw_rect, rect); BitBlt(dst_dc, draw_rect.left - offset.x, draw_rect.top - offset.y, draw_rect.right - draw_rect.left, draw_rect.bottom - draw_rect.top, src_dc, draw_rect.left, draw_rect.top, SRCCOPY); ReleaseDC(window, dst_dc);}