mirror of
https://github.com/yshui/picom.git
synced 2025-02-17 15:56:21 -05:00
Merge pull request #1107 from absolutelynothelix/name-default-backend-operation-implementations-consistently
This commit is contained in:
commit
e90757a6ec
5 changed files with 9 additions and 19 deletions
|
@ -211,18 +211,18 @@ struct backend_operations {
|
|||
struct xvisual_info fmt, bool owned);
|
||||
|
||||
/// Create a shadow context for rendering shadows with radius `radius`.
|
||||
/// Default implementation: default_backend_create_shadow_context
|
||||
/// Default implementation: default_create_shadow_context
|
||||
struct backend_shadow_context *(*create_shadow_context)(backend_t *backend_data,
|
||||
double radius);
|
||||
/// Destroy a shadow context
|
||||
/// Default implementation: default_backend_destroy_shadow_context
|
||||
/// Default implementation: default_destroy_shadow_context
|
||||
void (*destroy_shadow_context)(backend_t *backend_data,
|
||||
struct backend_shadow_context *ctx);
|
||||
|
||||
/// Create a shadow image based on the parameters. Resulting image should have a
|
||||
/// size of `width + radisu * 2` x `height + radius * 2`. Radius is set when the
|
||||
/// shadow context is created.
|
||||
/// Default implementation: default_backend_render_shadow
|
||||
/// Default implementation: default_render_shadow
|
||||
///
|
||||
/// Required.
|
||||
void *(*render_shadow)(backend_t *backend_data, int width, int height,
|
||||
|
|
|
@ -293,8 +293,8 @@ shadow_picture_err:
|
|||
return false;
|
||||
}
|
||||
|
||||
void *default_backend_render_shadow(backend_t *backend_data, int width, int height,
|
||||
struct backend_shadow_context *sctx, struct color color) {
|
||||
void *default_render_shadow(backend_t *backend_data, int width, int height,
|
||||
struct backend_shadow_context *sctx, struct color color) {
|
||||
const conv *kernel = (void *)sctx;
|
||||
xcb_render_picture_t shadow_pixel =
|
||||
solid_picture(backend_data->c, true, 1, color.red, color.green, color.blue);
|
||||
|
|
|
@ -54,16 +54,8 @@ solid_picture(struct x_connection *, bool argb, double a, double r, double g, do
|
|||
xcb_image_t *make_shadow(struct x_connection *c, const conv *kernel, double opacity,
|
||||
int width, int height);
|
||||
|
||||
/// The default implementation of `is_win_transparent`, it simply looks at win::mode. So
|
||||
/// this is not suitable for backends that alter the content of windows
|
||||
bool default_is_win_transparent(void *, win *, void *);
|
||||
|
||||
/// The default implementation of `is_frame_transparent`, it uses win::frame_opacity. Same
|
||||
/// caveat as `default_is_win_transparent` applies.
|
||||
bool default_is_frame_transparent(void *, win *, void *);
|
||||
|
||||
void *default_backend_render_shadow(backend_t *backend_data, int width, int height,
|
||||
struct backend_shadow_context *sctx, struct color color);
|
||||
void *default_render_shadow(backend_t *backend_data, int width, int height,
|
||||
struct backend_shadow_context *sctx, struct color color);
|
||||
|
||||
/// Implement `render_shadow` with `shadow_from_mask`.
|
||||
void *
|
||||
|
|
|
@ -184,7 +184,7 @@ struct backend_operations dummy_ops = {
|
|||
.bind_pixmap = dummy_bind_pixmap,
|
||||
.create_shadow_context = default_create_shadow_context,
|
||||
.destroy_shadow_context = default_destroy_shadow_context,
|
||||
.render_shadow = default_backend_render_shadow,
|
||||
.render_shadow = default_render_shadow,
|
||||
.make_mask = dummy_make_mask,
|
||||
.release_image = dummy_release_image,
|
||||
.is_image_transparent = dummy_is_image_transparent,
|
||||
|
|
|
@ -984,10 +984,8 @@ struct backend_operations xrender_ops = {
|
|||
.release_image = release_image,
|
||||
.create_shadow_context = default_create_shadow_context,
|
||||
.destroy_shadow_context = default_destroy_shadow_context,
|
||||
.render_shadow = default_backend_render_shadow,
|
||||
.render_shadow = default_render_shadow,
|
||||
.make_mask = make_mask,
|
||||
//.prepare_win = prepare_win,
|
||||
//.release_win = release_win,
|
||||
.is_image_transparent = default_is_image_transparent,
|
||||
.buffer_age = buffer_age,
|
||||
.max_buffer_age = 2,
|
||||
|
|
Loading…
Add table
Reference in a new issue