1
0
Fork 0

backends: Use meta_gamma_lut_new_sized() in a few more places

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2944>
This commit is contained in:
Jonas Ådahl 2023-03-30 12:05:13 +02:00 committed by Marge Bot
parent f3f1db5e33
commit 8ca94f4d3f
2 changed files with 2 additions and 11 deletions

View file

@ -229,11 +229,7 @@ meta_gamma_lut_copy_to_size (const MetaGammaLut *gamma,
if (gamma->size == target_size)
return meta_gamma_lut_copy (gamma);
out = meta_gamma_lut_new (target_size, NULL, NULL, NULL);
out->red = g_new0 (uint16_t, target_size);
out->green = g_new0 (uint16_t, target_size);
out->blue = g_new0 (uint16_t, target_size);
out = meta_gamma_lut_new_sized (target_size);
if (target_size >= gamma->size)
{

View file

@ -170,12 +170,7 @@ read_crtc_legacy_gamma (MetaKmsCrtc *crtc,
{
crtc_state->gamma.size = drm_crtc->gamma_size;
crtc_state->gamma.supported = drm_crtc->gamma_size != 0;
crtc_state->gamma.value = meta_gamma_lut_new (drm_crtc->gamma_size,
NULL, NULL, NULL);
crtc_state->gamma.value->red = g_new0 (uint16_t, drm_crtc->gamma_size);
crtc_state->gamma.value->green = g_new0 (uint16_t, drm_crtc->gamma_size);
crtc_state->gamma.value->blue = g_new0 (uint16_t, drm_crtc->gamma_size);
crtc_state->gamma.value = meta_gamma_lut_new_sized (drm_crtc->gamma_size);
drmModeCrtcGetGamma (meta_kms_impl_device_get_fd (impl_device),
crtc->id,