mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-06 18:06:33 +00:00
Integrating new surface
This commit is contained in:
@@ -47,8 +47,8 @@ cursor_h: xev.Timer,
|
||||
cursor_c: xev.Completion = .{},
|
||||
cursor_c_cancel: xev.Completion = .{},
|
||||
|
||||
/// The window we're rendering to.
|
||||
window: apprt.runtime.Window,
|
||||
/// The surface we're rendering to.
|
||||
surface: *apprt.Surface,
|
||||
|
||||
/// The underlying renderer implementation.
|
||||
renderer: *renderer.Renderer,
|
||||
@@ -65,7 +65,7 @@ mailbox: *Mailbox,
|
||||
/// is up to the caller to start the thread with the threadMain entrypoint.
|
||||
pub fn init(
|
||||
alloc: Allocator,
|
||||
win: apprt.runtime.Window,
|
||||
surface: *apprt.Surface,
|
||||
renderer_impl: *renderer.Renderer,
|
||||
state: *renderer.State,
|
||||
) !Thread {
|
||||
@@ -100,7 +100,7 @@ pub fn init(
|
||||
.stop = stop_h,
|
||||
.render_h = render_h,
|
||||
.cursor_h = cursor_timer,
|
||||
.window = win,
|
||||
.surface = surface,
|
||||
.renderer = renderer_impl,
|
||||
.state = state,
|
||||
.mailbox = mailbox,
|
||||
@@ -135,7 +135,7 @@ fn threadMain_(self: *Thread) !void {
|
||||
// Run our thread start/end callbacks. This is important because some
|
||||
// renderers have to do per-thread setup. For example, OpenGL has to set
|
||||
// some thread-local state since that is how it works.
|
||||
try self.renderer.threadEnter(self.window);
|
||||
try self.renderer.threadEnter(self.surface);
|
||||
defer self.renderer.threadExit();
|
||||
|
||||
// Start the async handlers
|
||||
@@ -305,7 +305,7 @@ fn renderCallback(
|
||||
return .disarm;
|
||||
};
|
||||
|
||||
t.renderer.render(t.window, t.state) catch |err|
|
||||
t.renderer.render(t.surface, t.state) catch |err|
|
||||
log.warn("error rendering err={}", .{err});
|
||||
return .disarm;
|
||||
}
|
||||
|
Reference in New Issue
Block a user