mirror of
https://gitlab.freedesktop.org/emersion/libliftoff.git
synced 2024-12-26 21:59:18 +01:00
Move layer_is_visible to layer.c
This commit is contained in:
parent
470af77869
commit
c4ef21af35
3 changed files with 17 additions and 16 deletions
16
alloc.c
16
alloc.c
|
@ -344,22 +344,6 @@ bool check_alloc_valid(struct alloc_result *result, struct alloc_step *step)
|
|||
return true;
|
||||
}
|
||||
|
||||
static bool layer_is_visible(struct liftoff_layer *layer)
|
||||
{
|
||||
struct liftoff_layer_property *alpha_prop;
|
||||
|
||||
alpha_prop = layer_get_property(layer, "alpha");
|
||||
if (alpha_prop != NULL && alpha_prop->value == 0) {
|
||||
return false; /* fully transparent */
|
||||
}
|
||||
|
||||
if (layer->force_composition) {
|
||||
return true;
|
||||
} else {
|
||||
return layer_has_fb(layer);
|
||||
}
|
||||
}
|
||||
|
||||
bool output_choose_layers(struct liftoff_output *output,
|
||||
struct alloc_result *result, struct alloc_step *step)
|
||||
{
|
||||
|
|
|
@ -91,6 +91,7 @@ bool layer_intersects(struct liftoff_layer *a, struct liftoff_layer *b);
|
|||
void layer_mark_clean(struct liftoff_layer *layer);
|
||||
void layer_update_priority(struct liftoff_layer *layer, bool make_current);
|
||||
bool layer_has_fb(struct liftoff_layer *layer);
|
||||
bool layer_is_visible(struct liftoff_layer *layer);
|
||||
|
||||
struct liftoff_plane *plane_create(struct liftoff_device *device, uint32_t id);
|
||||
void plane_destroy(struct liftoff_plane *plane);
|
||||
|
|
16
layer.c
16
layer.c
|
@ -177,3 +177,19 @@ bool layer_has_fb(struct liftoff_layer *layer) {
|
|||
fb_id_prop = layer_get_property(layer, "FB_ID");
|
||||
return fb_id_prop != NULL && fb_id_prop->value != 0;
|
||||
}
|
||||
|
||||
bool layer_is_visible(struct liftoff_layer *layer)
|
||||
{
|
||||
struct liftoff_layer_property *alpha_prop;
|
||||
|
||||
alpha_prop = layer_get_property(layer, "alpha");
|
||||
if (alpha_prop != NULL && alpha_prop->value == 0) {
|
||||
return false; /* fully transparent */
|
||||
}
|
||||
|
||||
if (layer->force_composition) {
|
||||
return true;
|
||||
} else {
|
||||
return layer_has_fb(layer);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue