summaryrefslogtreecommitdiff
path: root/src/common/backend.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/backend.h')
-rw-r--r--src/common/backend.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/common/backend.h b/src/common/backend.h
index 246a9bc..e26f9d2 100644
--- a/src/common/backend.h
+++ b/src/common/backend.h
@@ -8,6 +8,7 @@
#include "common/gl_options.h"
#include "common/timing.h"
+#include <stdatomic.h>
#include <string.h>
struct yasl_private_backend_ops;
@@ -16,7 +17,12 @@ struct yasl_private_event_state;
struct yasl_private_display {
const struct yasl_private_backend_ops *ops;
void *native_handle;
- bool offline; /* Connection lost; native handles are unusable until it is restored. */
+ /* Connection lost; native handles are unusable until it is restored. Read by GL
+ * rendering threads, so it is atomic. */
+ atomic_bool offline;
+ /* Set by the backend while a native modal loop (macOS live resize) blocks the
+ * event loop; refresh callbacks run only then. */
+ bool modal;
struct yasl_private_loop *loop;
/* Backend's copy of yasl_private_display_spec.app_id, or NULL; for desktop services. */
const char *app_id;
@@ -29,19 +35,14 @@ struct yasl_surface {
unsigned creation_flags;
enum yasl_private_presenter presenter;
struct yasl_surface *parent;
- uint32_t *cpu_pixels;
- int cpu_width, cpu_height;
- uint64_t cpu_token;
- bool cpu_acquired;
- uint32_t *committed_pixels;
- int committed_width, committed_height;
+ /* CPU canvas returned by yasl_cpu_pixels and copied into each drawn frame. */
+ uint32_t *canvas;
+ int canvas_width, canvas_height;
/* Window values last reported through public WINDOW events. */
struct yasl_private_vector2i reported_size;
uint32_t reported_scale_120, reported_state;
bool refresh_owed;
- bool refresh_active;
- void (*refresh_callback)(struct yasl_surface *, void *);
- void *refresh_userdata;
+ void (*refresh)(struct yasl_surface *);
bool text_input_active;
unsigned text_purpose;
char *text_surrounding;