Commit a5452078 authored by Harish Krupo's avatar Harish Krupo Committed by Harish Krupo

gl-renderer: Use full damage when HDR state changes

Signed-off-by: Harish Krupo's avatarHarish Krupo <harish.krupo.kps@intel.com>
parent 403a2e68
......@@ -1477,10 +1477,16 @@ gl_renderer_repaint_output(struct weston_output *output,
pixman_region32_t buffer_damage, total_damage;
enum gl_border_status border_damage = BORDER_STATUS_CLEAN;
struct weston_view *view;
pixman_region32_t full_damage;
pixman_region32_t *repaint_damage, *repaint_texture_damage;
if (use_output(output) < 0)
return;
pixman_region32_init_rect(&full_damage, 0, 0,
output->current_mode->width,
output->current_mode->height);
/* Clear the used_in_output_repaint flag, so that we can properly track
* which surfaces were used in this output repaint. */
wl_list_for_each_reverse(view, &compositor->view_list, link) {
......@@ -1539,19 +1545,39 @@ gl_renderer_repaint_output(struct weston_output *output,
pixman_region32_init(&buffer_damage);
output_get_damage(output, &buffer_damage, &border_damage);
output_rotate_damage(output, output_damage, go->border_status);
if (go->hdr_state_changed) {
output_rotate_damage(output, &full_damage, go->border_status);
} else {
output_rotate_damage(output, output_damage, go->border_status);
}
pixman_region32_union(&total_damage, &buffer_damage, output_damage);
border_damage |= go->border_status;
if (gr->supports_half_float_texture) {
if (go->hdr_state_changed) {
repaint_damage = &full_damage;
repaint_texture_damage = &full_damage;
} else {
repaint_damage = output_damage;
repaint_texture_damage = &total_damage;
}
glBindFramebuffer(GL_FRAMEBUFFER, go->shadow_fbo);
repaint_views(output, output_damage);
repaint_views(output, repaint_damage);
glBindFramebuffer(GL_FRAMEBUFFER, 0);
repaint_from_texture(output, &total_damage);
repaint_from_texture(output, repaint_texture_damage);
} else {
if (go->hdr_state_changed) {
repaint_damage = &full_damage;
} else {
repaint_damage = &total_damage;
}
glBindFramebuffer(GL_FRAMEBUFFER, 0);
repaint_views(output, &total_damage);
repaint_views(output, repaint_damage);
}
pixman_region32_fini(&total_damage);
......@@ -1619,6 +1645,9 @@ gl_renderer_repaint_output(struct weston_output *output,
TIMELINE_RENDER_POINT_TYPE_END);
update_buffer_release_fences(compositor, output);
go->hdr_state_changed = false;
pixman_region32_fini(&full_damage);
}
static int
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment