mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-02 09:01:38 -05:00
output: drop gamma LUT from state
This has been superseded by color transforms.
This commit is contained in:
parent
bfcb4211f6
commit
a30c102163
3 changed files with 6 additions and 64 deletions
|
|
@ -643,10 +643,6 @@ static bool output_basic_test(struct wlr_output *output,
|
|||
wlr_log(WLR_DEBUG, "Tried to set format for a disabled output");
|
||||
return false;
|
||||
}
|
||||
if (!enabled && state->committed & WLR_OUTPUT_STATE_GAMMA_LUT) {
|
||||
wlr_log(WLR_DEBUG, "Tried to set the gamma lut on a disabled output");
|
||||
return false;
|
||||
}
|
||||
if (!enabled && state->committed & WLR_OUTPUT_STATE_SUBPIXEL) {
|
||||
wlr_log(WLR_DEBUG, "Tried to set the subpixel layout on a disabled output");
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ void wlr_output_state_finish(struct wlr_output_state *state) {
|
|||
// reads it after output_state_finish().
|
||||
state->buffer = NULL;
|
||||
pixman_region32_fini(&state->damage);
|
||||
free(state->gamma_lut);
|
||||
wlr_drm_syncobj_timeline_unref(state->wait_timeline);
|
||||
wlr_drm_syncobj_timeline_unref(state->signal_timeline);
|
||||
}
|
||||
|
|
@ -89,28 +88,6 @@ void wlr_output_state_set_damage(struct wlr_output_state *state,
|
|||
pixman_region32_copy(&state->damage, damage);
|
||||
}
|
||||
|
||||
bool wlr_output_state_set_gamma_lut(struct wlr_output_state *state,
|
||||
size_t ramp_size, const uint16_t *r, const uint16_t *g, const uint16_t *b) {
|
||||
uint16_t *gamma_lut = NULL;
|
||||
if (ramp_size > 0) {
|
||||
gamma_lut = realloc(state->gamma_lut, 3 * ramp_size * sizeof(uint16_t));
|
||||
if (gamma_lut == NULL) {
|
||||
wlr_log_errno(WLR_ERROR, "Allocation failed");
|
||||
return false;
|
||||
}
|
||||
memcpy(gamma_lut, r, ramp_size * sizeof(uint16_t));
|
||||
memcpy(gamma_lut + ramp_size, g, ramp_size * sizeof(uint16_t));
|
||||
memcpy(gamma_lut + 2 * ramp_size, b, ramp_size * sizeof(uint16_t));
|
||||
} else {
|
||||
free(state->gamma_lut);
|
||||
}
|
||||
|
||||
state->committed |= WLR_OUTPUT_STATE_GAMMA_LUT;
|
||||
state->gamma_lut_size = ramp_size;
|
||||
state->gamma_lut = gamma_lut;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wlr_output_state_set_layers(struct wlr_output_state *state,
|
||||
struct wlr_output_layer_state *layers, size_t layers_len) {
|
||||
state->committed |= WLR_OUTPUT_STATE_LAYERS;
|
||||
|
|
@ -150,7 +127,6 @@ bool wlr_output_state_copy(struct wlr_output_state *dst,
|
|||
struct wlr_output_state copy = *src;
|
||||
copy.committed &= ~(WLR_OUTPUT_STATE_BUFFER |
|
||||
WLR_OUTPUT_STATE_DAMAGE |
|
||||
WLR_OUTPUT_STATE_GAMMA_LUT |
|
||||
WLR_OUTPUT_STATE_WAIT_TIMELINE |
|
||||
WLR_OUTPUT_STATE_SIGNAL_TIMELINE |
|
||||
WLR_OUTPUT_STATE_COLOR_TRANSFORM);
|
||||
|
|
@ -158,8 +134,6 @@ bool wlr_output_state_copy(struct wlr_output_state *dst,
|
|||
copy.buffer_src_box = (struct wlr_fbox){0};
|
||||
copy.buffer_dst_box = (struct wlr_box){0};
|
||||
pixman_region32_init(©.damage);
|
||||
copy.gamma_lut = NULL;
|
||||
copy.gamma_lut_size = 0;
|
||||
copy.wait_timeline = NULL;
|
||||
copy.signal_timeline = NULL;
|
||||
copy.color_transform = NULL;
|
||||
|
|
@ -174,15 +148,6 @@ bool wlr_output_state_copy(struct wlr_output_state *dst,
|
|||
wlr_output_state_set_damage(©, &src->damage);
|
||||
}
|
||||
|
||||
if (src->committed & WLR_OUTPUT_STATE_GAMMA_LUT) {
|
||||
const uint16_t *r = src->gamma_lut;
|
||||
const uint16_t *g = src->gamma_lut + src->gamma_lut_size;
|
||||
const uint16_t *b = src->gamma_lut + 2 * src->gamma_lut_size;
|
||||
if (!wlr_output_state_set_gamma_lut(©, src->gamma_lut_size, r, g, b)) {
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
||||
if (src->committed & WLR_OUTPUT_STATE_WAIT_TIMELINE) {
|
||||
wlr_output_state_set_wait_timeline(©, src->wait_timeline,
|
||||
src->wait_point);
|
||||
|
|
@ -199,8 +164,4 @@ bool wlr_output_state_copy(struct wlr_output_state *dst,
|
|||
wlr_output_state_finish(dst);
|
||||
*dst = copy;
|
||||
return true;
|
||||
|
||||
err:
|
||||
wlr_output_state_finish(©);
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue