Commit c7ddcb6d authored by Daniele Castagna's avatar Daniele Castagna Committed by Commit Bot

viz: Changing color usage invalidates the whole frame

When the root contents color usage changes between frames
the renderer might reshape the output surface, increasing
the damage to the whole frame.

If SurfaceAggregator ignores quads outside the damage we
might end up with a renderer that can't draw the full frame
after reshaping the surface.

This CL increases the damage in SurfaceAggragtor to the full
frame when the color usage changes.

Bug: b/158777601
Test: Youtube HDR video, no artifacts when it starts playing.
Change-Id: Ibce88f6f4375567c1bbab1761ab7aea53f84c226
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2369441
Commit-Queue: Daniele Castagna <dcastagna@chromium.org>
Reviewed-by: default avatarDaniele Castagna <dcastagna@chromium.org>
Reviewed-by: default avatarMiguel Casas <mcasas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800807}
parent cb2c9ed7
...@@ -1741,6 +1741,15 @@ AggregatedFrame SurfaceAggregator::Aggregate( ...@@ -1741,6 +1741,15 @@ AggregatedFrame SurfaceAggregator::Aggregate(
// intersect this area. // intersect this area.
root_damage_rect_.Union(target_damage); root_damage_rect_.Union(target_damage);
// Changing color usage will cause the renderer to reshape the output surface,
// therefore the renderer might expand the damage to the whole frame. The
// following makes sure SA will produce all the quads to cover the full frame.
if (root_content_color_usage_ != prewalk_result.content_color_usage) {
root_damage_rect_ = cc::MathUtil::MapEnclosedRectWith2dAxisAlignedTransform(
root_surface_transform_,
gfx::Rect(root_surface_frame.size_in_pixels()));
}
root_content_color_usage_ = prewalk_result.content_color_usage; root_content_color_usage_ = prewalk_result.content_color_usage;
if (prewalk_result.frame_sinks_changed) if (prewalk_result.frame_sinks_changed)
......
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