Skip to content

Commit 2986145

Browse files
authored
Merge branch 'yshui:next' into next
2 parents 8b1da9d + 7a4fdd8 commit 2986145

File tree

9 files changed

+1
-166
lines changed

9 files changed

+1
-166
lines changed

CONTRIBUTORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ Toni Jarjour
9393
triallax <triallax at tutanota.com>
9494
Tuomas Kinnunen <tuomas.kinnunen at aalto.fi>
9595
Uli Schlachter <psychon at znc.in>
96+
Vasiliy Stelmachenok <ventureo at cachyos.org>
9697
Walter Lapchynski <wxl at ubuntu.com>
9798
Will Dietz <w at wdtz.org>
9899
Wim Koomen <autosuggestion at gmail.com>

src/backend/gl/egl.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,6 @@ void egl_deinit(backend_t *base) {
9696
free(gd);
9797
}
9898

99-
static void *egl_decouple_user_data(backend_t *base attr_unused, void *ud attr_unused) {
100-
return NULL;
101-
}
102-
10399
static bool egl_set_swap_interval(int interval, EGLDisplay dpy) {
104100
return eglSwapInterval(dpy, interval);
105101
}
@@ -215,7 +211,6 @@ static backend_t *egl_init(session_t *ps, xcb_window_t target) {
215211
goto end;
216212
}
217213

218-
gd->gl.decouple_texture_user_data = egl_decouple_user_data;
219214
gd->gl.release_user_data = egl_release_image;
220215

221216
if (ps->o.vsync) {

src/backend/gl/gl_common.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,6 @@ struct gl_data {
117117

118118
GLuint default_mask_texture;
119119

120-
/// Called when an gl_texture is decoupled from the texture it refers. Returns
121-
/// the decoupled user_data
122-
void *(*decouple_texture_user_data)(backend_t *base, void *user_data);
123-
124120
/// Release the user data attached to a gl_texture
125121
void (*release_user_data)(backend_t *base, struct gl_texture *);
126122

@@ -129,14 +125,6 @@ struct gl_data {
129125

130126
typedef struct session session_t;
131127

132-
#define GL_PROG_MAIN_INIT \
133-
{ \
134-
.prog = 0, \
135-
.unifm_opacity = -1, \
136-
.unifm_invert_color = -1, \
137-
.unifm_tex = -1, \
138-
}
139-
140128
void gl_prepare(backend_t *base, const region_t *reg);
141129
/// Convert a mask formed by a collection of rectangles to OpenGL vertex and texture
142130
/// coordinates.
@@ -182,8 +170,6 @@ GLuint gl_new_texture(void);
182170

183171
xcb_pixmap_t gl_release_image(backend_t *base, image_handle image);
184172

185-
image_handle gl_clone(backend_t *base, image_handle image, const region_t *reg_visible);
186-
187173
bool gl_blur(struct backend_base *gd, ivec2 origin, image_handle target,
188174
const struct backend_blur_args *args);
189175
bool gl_copy_area(backend_t *backend_data, ivec2 origin, image_handle target,

src/backend/gl/glx.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,6 @@ void glx_deinit(backend_t *base) {
197197
free(gd);
198198
}
199199

200-
static void *glx_decouple_user_data(backend_t *base attr_unused, void *ud attr_unused) {
201-
return NULL;
202-
}
203-
204200
static bool glx_set_swap_interval(int interval, Display *dpy, GLXDrawable drawable) {
205201
bool vsync_enabled = false;
206202
if (glxext.has_MESA_swap_control) {
@@ -328,7 +324,6 @@ static backend_t *glx_init(session_t *ps, xcb_window_t target) {
328324
goto end;
329325
}
330326

331-
gd->gl.decouple_texture_user_data = glx_decouple_user_data;
332327
gd->gl.release_user_data = glx_release_image;
333328

334329
if (ps->o.vsync) {

src/common.h

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,6 @@ typedef struct session {
151151
// === Operation related ===
152152
/// Whether there is a pending quest to get the focused window
153153
bool pending_focus_check;
154-
/// Flags related to the root window
155-
uint64_t root_flags;
156154
/// Program options.
157155
options_t o;
158156
/// State object for c2.
@@ -181,8 +179,6 @@ typedef struct session {
181179
struct renderer *renderer;
182180
/// Whether all windows are currently redirected.
183181
bool redirected;
184-
/// Pre-generated alpha pictures.
185-
xcb_render_picture_t *alpha_picts;
186182
/// Time of last fading. In milliseconds.
187183
long long fade_time;
188184
/// If we should quit
@@ -196,21 +192,6 @@ typedef struct session {
196192

197193
struct window_options window_options_default;
198194

199-
// === Shadow/dimming related ===
200-
/// 1x1 black Picture.
201-
xcb_render_picture_t black_picture;
202-
/// 1x1 Picture of the shadow color.
203-
xcb_render_picture_t cshadow_picture;
204-
/// 1x1 white Picture.
205-
xcb_render_picture_t white_picture;
206-
/// Backend shadow context.
207-
struct backend_shadow_context *shadow_context;
208-
// for shadow precomputation
209-
210-
// === Software-optimization-related ===
211-
/// Nanosecond offset of the first painting.
212-
long paint_tm_offset;
213-
214195
// === X extension related ===
215196
/// Information about monitors.
216197
struct x_monitors monitors;
@@ -224,31 +205,15 @@ typedef struct session {
224205
#endif
225206
} session_t;
226207

227-
/// Enumeration for window event hints.
228-
typedef enum { WIN_EVMODE_UNKNOWN, WIN_EVMODE_FRAME, WIN_EVMODE_CLIENT } win_evmode_t;
229208
struct wintype_info {
230209
const char *name;
231210
const char *atom;
232211
};
233212
extern const struct wintype_info WINTYPES[NUM_WINTYPES];
234213
extern session_t *ps_g;
235214

236-
void ev_xcb_error(session_t *ps, xcb_generic_error_t *err);
237-
238215
// === Functions ===
239216

240-
/**
241-
* Get current time in struct timeval.
242-
*/
243-
static inline struct timeval get_time_timeval(void) {
244-
struct timeval tv = {0, 0};
245-
246-
gettimeofday(&tv, NULL);
247-
248-
// Return a time of all 0 if the call fails
249-
return tv;
250-
}
251-
252217
/**
253218
* Get current time in struct timespec.
254219
*
@@ -263,13 +228,6 @@ static inline struct timespec get_time_timespec(void) {
263228
return tm;
264229
}
265230

266-
/**
267-
* Return the painting target window.
268-
*/
269-
static inline xcb_window_t get_tgt_window(session_t *ps) {
270-
return ps->overlay != XCB_NONE ? ps->overlay : ps->c.screen_info->root;
271-
}
272-
273231
/**
274232
* Determine if a window has a specific property.
275233
*
@@ -295,14 +253,3 @@ static inline bool wid_has_prop(xcb_connection_t *c, xcb_window_t w, xcb_atom_t
295253
}
296254

297255
void force_repaint(session_t *ps);
298-
299-
/**
300-
* Set a <code>bool</code> array of all wintypes to true.
301-
*/
302-
static inline void wintype_arr_enable(bool arr[]) {
303-
wintype_t i;
304-
305-
for (i = 0; i < NUM_WINTYPES; ++i) {
306-
arr[i] = true;
307-
}
308-
}

src/picom.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1981,15 +1981,9 @@ static session_t *session_init(int argc, char **argv, Display *dpy,
19811981
.overlay = XCB_NONE,
19821982
.reg_win = XCB_NONE,
19831983
.redirected = false,
1984-
.alpha_picts = NULL,
19851984
.fade_time = 0L,
19861985
.quit = false,
19871986

1988-
.black_picture = XCB_NONE,
1989-
.cshadow_picture = XCB_NONE,
1990-
.white_picture = XCB_NONE,
1991-
.shadow_context = NULL,
1992-
19931987
.last_msc = 0,
19941988

19951989
#ifdef CONFIG_DBUS

src/picom.h

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,10 @@
2525
// == Functions ==
2626
// TODO(yshui) move static inline functions that are only used in picom.c, into picom.c
2727

28-
void circulate_win(session_t *ps, xcb_circulate_notify_event_t *ce);
29-
3028
void root_damaged(session_t *ps);
3129

3230
void queue_redraw(session_t *ps);
3331

34-
void discard_pending(session_t *ps, uint32_t sequence);
35-
3632
void configure_root(session_t *ps);
3733

3834
void quit(session_t *ps);
@@ -48,47 +44,3 @@ static inline struct cdbus_data *session_get_cdbus(session_t *ps attr_unused) {
4844
return NULL;
4945
}
5046
#endif
51-
52-
/**
53-
* Set a <code>switch_t</code> array of all unset wintypes to true.
54-
*/
55-
static inline void wintype_arr_enable_unset(switch_t arr[]) {
56-
wintype_t i;
57-
58-
for (i = 0; i < NUM_WINTYPES; ++i) {
59-
if (UNSET == arr[i]) {
60-
arr[i] = ON;
61-
}
62-
}
63-
}
64-
65-
/**
66-
* Check if a window ID exists in an array of window IDs.
67-
*
68-
* @param arr the array of window IDs
69-
* @param count amount of elements in the array
70-
* @param wid window ID to search for
71-
*/
72-
static inline bool array_wid_exists(const xcb_window_t *arr, int count, xcb_window_t wid) {
73-
while (count--) {
74-
if (arr[count] == wid) {
75-
return true;
76-
}
77-
}
78-
79-
return false;
80-
}
81-
82-
/**
83-
* Dump an drawable's info.
84-
*/
85-
static inline void dump_drawable(session_t *ps, xcb_drawable_t drawable) {
86-
auto r = xcb_get_geometry_reply(ps->c.c, xcb_get_geometry(ps->c.c, drawable), NULL);
87-
if (!r) {
88-
log_trace("Drawable %#010x: Failed", drawable);
89-
return;
90-
}
91-
log_trace("Drawable %#010x: x = %u, y = %u, wid = %u, hei = %d, b = %u, d = %u",
92-
drawable, r->x, r->y, r->width, r->height, r->border_width, r->depth);
93-
free(r);
94-
}

src/x.c

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -964,39 +964,6 @@ bool x_is_root_back_pixmap_atom(struct atom *atoms, xcb_atom_t atom) {
964964
atom == atoms->a_XSETROOT_ID;
965965
}
966966

967-
/**
968-
* Synchronizes a X Render drawable to ensure all pending painting requests
969-
* are completed.
970-
*/
971-
bool x_fence_sync(struct x_connection *c, xcb_sync_fence_t f) {
972-
// TODO(richardgv): If everybody just follows the rules stated in X Sync
973-
// prototype, we need only one fence per screen, but let's stay a bit
974-
// cautious right now
975-
976-
auto e = xcb_request_check(c->c, xcb_sync_trigger_fence_checked(c->c, f));
977-
if (e) {
978-
log_error_x_error(c, e, "Failed to trigger the fence");
979-
goto err;
980-
}
981-
982-
e = xcb_request_check(c->c, xcb_sync_await_fence_checked(c->c, 1, &f));
983-
if (e) {
984-
log_error_x_error(c, e, "Failed to await on a fence");
985-
goto err;
986-
}
987-
988-
e = xcb_request_check(c->c, xcb_sync_reset_fence_checked(c->c, f));
989-
if (e) {
990-
log_error_x_error(c, e, "Failed to reset the fence");
991-
goto err;
992-
}
993-
return true;
994-
995-
err:
996-
free(e);
997-
return false;
998-
}
999-
1000967
void x_request_vblank_event(struct x_connection *c, xcb_window_t window, uint64_t msc) {
1001968
auto cookie = xcb_present_notify_msc(c->c, window, 0, msc, 1, 0);
1002969
x_set_error_action_abort(c, cookie);

src/x.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,8 +420,6 @@ xcb_pixmap_t x_get_root_back_pixmap(struct x_connection *c, struct atom *atoms);
420420
/// root window background pixmap
421421
bool x_is_root_back_pixmap_atom(struct atom *atoms, xcb_atom_t atom);
422422

423-
bool x_fence_sync(struct x_connection *, xcb_sync_fence_t);
424-
425423
struct x_convolution_kernel {
426424
int size;
427425
int capacity;

0 commit comments

Comments
 (0)