Commit 7eb97887 authored by Bo Liu's avatar Bo Liu Committed by Commit Bot

viz: Allow empty quad visible rect

In Rect::Intersect and throughout the code, when an intersection result
is empty, the origin is thrown away. Which means the resulting Rect may
not be contained in either of the original intersected Rects.

So relax the check in draw_quad and serialization checks to explicitly
allow this.

Fixed: 1095559
Bug: 1072407
Change-Id: I13c9fb9255141466909d99eafba3255d9c7a1c70
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2248162Reviewed-by: default avatarJonathan Ross <jonross@chromium.org>
Commit-Queue: Bo <boliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#778975}
parent e2c1db08
...@@ -53,6 +53,9 @@ void SolidColorLayerImpl::AppendSolidQuads( ...@@ -53,6 +53,9 @@ void SolidColorLayerImpl::AppendSolidQuads(
gfx::Rect visible_quad_rect = gfx::Rect visible_quad_rect =
occlusion_in_layer_space.GetUnoccludedContentRect(visible_layer_rect); occlusion_in_layer_space.GetUnoccludedContentRect(visible_layer_rect);
if (visible_quad_rect.IsEmpty())
return;
auto* quad = render_pass->CreateAndAppendDrawQuad<viz::SolidColorDrawQuad>(); auto* quad = render_pass->CreateAndAppendDrawQuad<viz::SolidColorDrawQuad>();
quad->SetNew(shared_quad_state, visible_layer_rect, visible_quad_rect, color, quad->SetNew(shared_quad_state, visible_layer_rect, visible_quad_rect, color,
force_anti_aliasing_off); force_anti_aliasing_off);
......
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