-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add functions required by SwayFX (#35)
- Loading branch information
1 parent
7e723f9
commit e1f4bc5
Showing
21 changed files
with
791 additions
and
287 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,101 +1,29 @@ | ||
#ifndef FX_RENDER_PASS_H | ||
#define FX_RENDER_PASS_H | ||
|
||
#include <scenefx/render/pass.h> | ||
#include <stdbool.h> | ||
#include <wlr/render/pass.h> | ||
#include <wlr/util/box.h> | ||
#include <wlr/render/interface.h> | ||
#include "scenefx/types/fx/shadow_data.h" | ||
|
||
struct fx_gles_render_pass { | ||
struct wlr_render_pass base; | ||
struct fx_framebuffer *buffer; | ||
float projection_matrix[9]; | ||
struct fx_render_timer *timer; | ||
}; | ||
|
||
/** | ||
* Begin a new render pass with the supplied destination buffer. | ||
* | ||
* Callers must call wlr_render_pass_submit() once they are done with the | ||
* render pass. | ||
*/ | ||
struct fx_gles_render_pass *fx_renderer_begin_buffer_pass(struct wlr_renderer *wlr_renderer, | ||
struct wlr_buffer *wlr_buffer, struct wlr_output *output, | ||
const struct wlr_buffer_pass_options *options); | ||
|
||
struct fx_render_texture_options { | ||
struct wlr_render_texture_options base; | ||
float scale; | ||
struct wlr_box *clip_box; // Used to clip csd. Ignored if NULL | ||
int corner_radius; | ||
bool discard_transparent; | ||
}; | ||
|
||
struct fx_render_texture_options fx_render_texture_options_default( | ||
const struct wlr_render_texture_options *base); | ||
|
||
struct fx_render_rect_options { | ||
struct wlr_render_rect_options base; | ||
float scale; | ||
}; | ||
|
||
struct fx_render_rect_options fx_render_rect_options_default( | ||
const struct wlr_render_rect_options *base); | ||
|
||
struct fx_render_blur_pass_options { | ||
struct fx_render_texture_options tex_options; | ||
pixman_region32_t *opaque_region; | ||
struct wlr_output *output; | ||
struct wlr_box monitor_box; | ||
struct fx_framebuffer *current_buffer; | ||
struct blur_data *blur_data; | ||
bool use_optimized_blur; | ||
bool ignore_transparent; | ||
struct fx_render_stencil_box_options { | ||
struct wlr_box box; | ||
/* Clip region, leave NULL to disable clipping */ | ||
const pixman_region32_t *clip; | ||
int corner_radius; | ||
}; | ||
|
||
/** | ||
* Render a fx texture. | ||
*/ | ||
void fx_render_pass_add_texture(struct fx_gles_render_pass *render_pass, | ||
const struct fx_render_texture_options *options); | ||
|
||
/** | ||
* Render a rectangle. | ||
*/ | ||
void fx_render_pass_add_rect(struct fx_gles_render_pass *render_pass, | ||
const struct fx_render_rect_options *options); | ||
|
||
/** | ||
* Render a stencil mask. | ||
*/ | ||
void fx_render_pass_add_stencil_mask(struct fx_gles_render_pass *pass, | ||
const struct fx_render_rect_options *fx_options, int corner_radius); | ||
|
||
/** | ||
* Render a box shadow. | ||
*/ | ||
void fx_render_pass_add_box_shadow(struct fx_gles_render_pass *pass, | ||
const struct fx_render_rect_options *fx_options, | ||
int corner_radius, struct shadow_data *shadow_data); | ||
|
||
/** | ||
* Render blur. | ||
*/ | ||
void fx_render_pass_add_blur(struct fx_gles_render_pass *pass, | ||
struct fx_render_blur_pass_options *fx_options); | ||
|
||
/** | ||
* Render optimized blur. | ||
*/ | ||
void fx_render_pass_add_optimized_blur(struct fx_gles_render_pass *pass, | ||
struct fx_render_blur_pass_options *fx_options); | ||
|
||
/** | ||
* Render from one buffer to another | ||
*/ | ||
void fx_renderer_read_to_buffer(struct fx_gles_render_pass *pass, | ||
pixman_region32_t *region, struct fx_framebuffer *dst_buffer, | ||
struct fx_framebuffer *src_buffer); | ||
const struct fx_render_stencil_box_options *options); | ||
|
||
#endif |
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
include/scenefx/render/fx_renderer/fx_effect_framebuffers.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#ifndef _FX_EFFECT_FRAMEBUFFERS_H | ||
#define _FX_EFFECT_FRAMEBUFFERS_H | ||
|
||
#include <wlr/types/wlr_output.h> | ||
#include <wlr/util/addon.h> | ||
|
||
/** | ||
* Used to add effect framebuffers per output instead of every output sharing | ||
* them. | ||
*/ | ||
struct fx_effect_framebuffers { | ||
struct wlr_addon addon; | ||
|
||
// Contains the blurred background for tiled windows | ||
struct fx_framebuffer *optimized_blur_buffer; | ||
// Contains the original pixels to draw over the areas where artifact are visible | ||
struct fx_framebuffer *blur_saved_pixels_buffer; | ||
// Blur swaps between the two effects buffers everytime it scales the image | ||
// Buffer used for effects | ||
struct fx_framebuffer *effects_buffer; | ||
// Swap buffer used for effects | ||
struct fx_framebuffer *effects_buffer_swapped; | ||
|
||
bool blur_buffer_dirty; | ||
}; | ||
|
||
struct fx_effect_framebuffers *fx_effect_framebuffers_try_get(struct wlr_output *output); | ||
|
||
#endif |
Oops, something went wrong.