diff --git a/src/apprt/gtk/class/render_surface.zig b/src/apprt/gtk/class/render_surface.zig index e995e880a..f4ac78cab 100644 --- a/src/apprt/gtk/class/render_surface.zig +++ b/src/apprt/gtk/class/render_surface.zig @@ -158,15 +158,6 @@ pub const RenderSurface = extern struct { const h = widget.getHeight(); if (w == 0 or h == 0) return; - // In OpenGL +Y is up but in GSK (and DirectX, Metal, Vulkan, etc.) - // +Y is down. We therefore might need to flip the rendered image. - snap.save(); - defer snap.restore(); - if (comptime !rendererpkg.Renderer.API.custom_shader_y_is_down) { - snap.translate(&.{ .f_x = 0, .f_y = @floatFromInt(h) }); - snap.scale(1, -1); - } - snap.appendTexture(texture, &.{ .f_origin = .{ .f_x = 0, .f_y = 0 }, .f_size = .{ .f_width = @floatFromInt(w), .f_height = @floatFromInt(h) }, diff --git a/src/renderer/opengl/Target.zig b/src/renderer/opengl/Target.zig index 7bc844221..55e7e3384 100644 --- a/src/renderer/opengl/Target.zig +++ b/src/renderer/opengl/Target.zig @@ -165,15 +165,19 @@ pub fn exportDmabuf( const draw_bind = try self.export_framebuffer.bind(.draw); defer draw_bind.unbind(); + // Flip the Y axis during the blit so apprts don't have to + // handle this. We do this explicitly in OpenGL only + // because it's the only one that thinks +Y should point up + // for some reason. try gl.blitFramebuffer( 0, 0, @intCast(self.width), @intCast(self.height), 0, - 0, - @intCast(self.width), @intCast(self.height), + @intCast(self.width), + 0, .{ .color_buffer_bit = true }, .nearest, );