0

Update instances where SQS->clip_rect is referenced without checking

is_clipped

This will make the changes in cl/2812398 (moving clip_rect to an
optional) easier to review, because the most complex logic related
changes are here.

Bug: 1194630
Change-Id: Ie882501679b2f5896fd94443fce6ebd4be913f11
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2822729
Reviewed-by: kylechar <kylechar@chromium.org>
Commit-Queue: Kevin Haslett <khaslett@chromium.org>
Cr-Commit-Position: refs/heads/master@{#872036}
This commit is contained in:
Kevin Haslett
2021-04-13 18:32:05 +00:00
committed by Chromium LUCI CQ
parent b6c697a274
commit 09e032a84c
4 changed files with 11 additions and 10 deletions

@@ -1519,9 +1519,9 @@ bool GLRenderer::UpdateRPDQWithSkiaFilters(
filter = sk_ref_sp(filter->getInput(0));
}
if (filter) {
gfx::Rect clip_rect = quad->shared_quad_state->clip_rect;
if (clip_rect.IsEmpty()) {
clip_rect = current_draw_rect_;
gfx::Rect clip_rect = current_draw_rect_;
if (quad->shared_quad_state->is_clipped) {
clip_rect = quad->shared_quad_state->clip_rect;
}
gfx::Transform transform = params->quad_to_target_transform;
transform.FlattenTo2d();

@@ -149,7 +149,7 @@ SharedQuadState* CreateTestSharedQuadState(
const gfx::RRectF& rrect) {
const gfx::Rect layer_rect = rect;
const gfx::Rect visible_layer_rect = rect;
const gfx::Rect clip_rect = rect;
const gfx::Rect clip_rect = gfx::Rect();
const bool is_clipped = false;
const bool are_contents_opaque = false;
const float opacity = 1.0f;
@@ -1316,7 +1316,6 @@ class IntersectingQuadPixelTest : public VizPixelTestWithParam {
trans.RotateAboutYAxis(45.0);
front_quad_state_ = CreateTestSharedQuadState(
trans, viewport_rect_, render_pass_.get(), gfx::RRectF());
front_quad_state_->clip_rect = quad_rect_;
// Make sure they end up in a 3d sorting context.
front_quad_state_->sorting_context_id = 1;
@@ -1328,7 +1327,6 @@ class IntersectingQuadPixelTest : public VizPixelTestWithParam {
back_quad_state_ = CreateTestSharedQuadState(
trans, viewport_rect_, render_pass_.get(), gfx::RRectF());
back_quad_state_->sorting_context_id = 1;
back_quad_state_->clip_rect = quad_rect_;
}
void AppendBackgroundAndRunTest(const cc::PixelComparator& comparator,
const base::FilePath::CharType* ref_file) {

@@ -2422,9 +2422,9 @@ SkiaRenderer::DrawRPDQParams SkiaRenderer::CalculateRPDQParams(
filters->MapRect(rpdq_params.filter_bounds, local_matrix);
// If after applying the filter we would be clipped out, skip the draw.
gfx::Rect clip_rect = quad->shared_quad_state->clip_rect;
if (clip_rect.IsEmpty()) {
clip_rect = current_draw_rect_;
gfx::Rect clip_rect = current_draw_rect_;
if (quad->shared_quad_state->is_clipped) {
clip_rect = quad->shared_quad_state->clip_rect;
}
gfx::Transform transform =
quad->shared_quad_state->quad_to_target_transform;

@@ -2122,7 +2122,9 @@ void SurfaceAggregator::HandleDeJelly(Surface* surface) {
continue;
// We are going to de-jelly this SharedQuadState. Expand the max clip.
jelly_clip.Union(state->clip_rect);
if (state->is_clipped) {
jelly_clip.Union(state->clip_rect);
}
// Compute the skew angle and update |max_skew|.
float de_jelly_angle = gfx::RadToDeg(atan2(delta_y, screen_width));
@@ -2228,6 +2230,7 @@ void SurfaceAggregator::CreateDeJellyRenderPassQuads(
// MaxDeJellyHeight().
int un_clip_top = 0;
int un_clip_bottom = 0;
DCHECK(state->is_clipped);
if (state->clip_rect.y() <= jelly_clip.y()) {
un_clip_top = MaxDeJellyHeight();
}