New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 745101 link

Starred by 1 user

Issue metadata

Status: Archived
Owner:
Closed: Jul 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug


Show other hotlists

Hotlists containing this issue:
Hotlist-1


Sign in to add a comment

damage_tracker when there has a filter.

Project Member Reported by wutao@chromium.org, Jul 18 2017

Issue description

Please verify is this a bug or expected.

For example, we have a foreground blur filter with radius 20 and damage_for_this_update_ is empty.
After this line [1]: the damage_rect is -60,-60 120x120 due to the blur filter.
[1] https://cs.chromium.org/chromium/src/cc/trees/damage_tracker.cc?rcl=88a57b64c852326ba2a5d84c395882c01692ea32&l=192
Similar could happen at here [2]
[2] https://cs.chromium.org/chromium/src/cc/trees/damage_tracker.cc?rcl=88a57b64c852326ba2a5d84c395882c01692ea32&l=341


This will cause a problem when I try to cache a parent layer of this render surface [3]:
[3] https://bugs.chromium.org/p/chromium/issues/detail?id=738185#c29

There is no a real damage, so I should reuse the render surface cache of a parent layer. However this cl [4] will consider it is "damaged" if the child-render surface has a damage.
[4] https://codereview.chromium.org/2873593002/
 

Comment 1 by wutao@chromium.org, Jul 18 2017

Correction, in the prototype [3], I just use normal blur filter.

Comment 2 by wutao@chromium.org, Jul 18 2017

Description: Show this description

Comment 3 by ajuma@chromium.org, Jul 18 2017

Cc: senorblanco@chromium.org ajuma@chromium.org
Components: Internals>Compositing
Owner: wutao@chromium.org
Status: Assigned (was: Untriaged)
Just to make sure I'm understanding, is the issue that MapRectInternal (https://cs.chromium.org/chromium/src/cc/base/filter_operation.cc?rcl=0238418b07cbe9ea31f40cb3804e7ebea141ab43&l=325) maps empty rects into non-empty 
rects for blur filters, and so the surface a blur filter draws into is considered damaged every frame even when nothing changes? That would certainly be a bug.

Would you be interested in fixing MapRectInternal?

Comment 4 by danakj@chromium.org, Jul 18 2017

I think we need to separate the concepts of "what is damaged/what should i swap" from "what should i draw". Today they are one rect, but we want to draw more than what changed for background filters, in order for them to read, and if they are in the cache then we don't need to draw.

Comment 5 by wutao@chromium.org, Jul 18 2017

#4 sounds good. The change could also resolve the partial swap for blur in this  bug 737255 . I am adding a second rect to track the real damaged area. But I could make it more general to fit here.

#3, right, an empty rect becomes non-empty rects due to result.Inset(-spread_x, -spread_y, -spread_x, -spread_y).

We might have multiple places to check if this rect is empty. One place could be here [1], before we expand, we check is_rect_valid. But is_rect_valid could be empty. I wonder whether we can define an empty rect is not valid.

[1] https://cs.chromium.org/chromium/src/cc/trees/damage_tracker.cc?rcl=88a57b64c852326ba2a5d84c395882c01692ea32&l=461

Comment 6 by danakj@chromium.org, Jul 18 2017

From https://bugs.chromium.org/p/chromium/issues/detail?id=738185#c29 it sounds like this bug actually isn't what I thought, as there is no background filter?

With a normal filter, whatever damage there is needs to expand, because the pixels move and changing a green box to red would change pixels outside of that box too.

So that made me confused why the damage expansion is a problem. Is it going from empty to non-empty?

Comment 7 by danakj@chromium.org, Jul 18 2017

> #3, right, an empty rect becomes non-empty rects due to result.Inset(-spread_x, -spread_y, -spread_x, -spread_y).

OH I should read this bug's comment. It's already here, thanks for explaining wutao@. We should def not expand an empty rect.

It seems to me that FilterOperations::MapRect should not expand an empty rect.

Comment 8 by wutao@chromium.org, Jul 26 2017

Labels: M-61
I will upload a cl for this soon.

Is there any exception that when the input rect is empty, we still want to expand/shrink the rect?

Comment 9 by wutao@chromium.org, Jul 26 2017

cl can be found at here:

https://chromium-review.googlesource.com/c/587090/
Project Member

Comment 10 by bugdroid1@chromium.org, Jul 29 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/92b48551c98e87d75510ee552b1ef96de7641893

commit 92b48551c98e87d75510ee552b1ef96de7641893
Author: wutao <wutao@chromium.org>
Date: Sat Jul 29 02:04:17 2017

Do not map empty rect in FilterOperation.

If the input rect is empty, we do not want to map the rect to a
non-empty rect. Because it could cause problem, for example, in
damage_tracker to have a damaged region due to having pixel-moving
filters.

DamageTrackerTest.VerifyDamageForBackgroundBlurredChild

Bug:  745101 
Test: DamageTrackerTest.VerifyDamageForImageFilter and
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I8719f5ad2e6da08b3a95df45c5194532c3bc5bd4
Reviewed-on: https://chromium-review.googlesource.com/587090
Commit-Queue: Tao Wu <wutao@chromium.org>
Reviewed-by: Ali Juma <ajuma@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Cr-Commit-Position: refs/heads/master@{#490580}
[modify] https://crrev.com/92b48551c98e87d75510ee552b1ef96de7641893/cc/trees/damage_tracker.cc
[modify] https://crrev.com/92b48551c98e87d75510ee552b1ef96de7641893/cc/trees/damage_tracker_unittest.cc

Comment 11 by wutao@chromium.org, Jul 29 2017

Labels: Merge-Request-61
Status: Fixed (was: Assigned)
This code need to be merged back to M61 to make Render surface cache work correctly.
[1]  issue 708513 
Render surface cache is required to make the signin/lock screen blur work efficiently.
[2]  issue 738185 

Project Member

Comment 12 by sheriffbot@chromium.org, Jul 30 2017

Labels: -Merge-Request-61 Hotlist-Merge-Approved Merge-Approved-61
Your change meets the bar and is auto-approved for M61. Please go ahead and merge the CL to branch 3163 manually. Please contact milestone owner if you have questions.
Owners: amineer@(Android), cmasso@(iOS), ketakid @(ChromeOS), govind@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 13 by bugdroid1@chromium.org, Jul 31 2017

Labels: -merge-approved-61 merge-merged-3163
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e4d934b8951f910c65a4276d4d30478f587fbe9b

commit e4d934b8951f910c65a4276d4d30478f587fbe9b
Author: Qiang Xu <warx@chromium.org>
Date: Mon Jul 31 18:35:48 2017

[merge to m61] Do not map empty rect in FilterOperation.

merge to m61 on behalf of wutao@

If the input rect is empty, we do not want to map the rect to a
non-empty rect. Because it could cause problem, for example, in
damage_tracker to have a damaged region due to having pixel-moving
filters.

DamageTrackerTest.VerifyDamageForBackgroundBlurredChild

(cherry picked from commit 92b48551c98e87d75510ee552b1ef96de7641893)

TBR: ajuma@chromium.org, senorblanco@chromium.org
Bug:  745101 
Test: DamageTrackerTest.VerifyDamageForImageFilter and
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I8719f5ad2e6da08b3a95df45c5194532c3bc5bd4
Reviewed-on: https://chromium-review.googlesource.com/587090
Commit-Queue: Tao Wu <wutao@chromium.org>
Reviewed-by: Ali Juma <ajuma@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#490580}
Reviewed-on: https://chromium-review.googlesource.com/594669
Reviewed-by: Qiang(Joe) Xu <warx@chromium.org>
Cr-Commit-Position: refs/branch-heads/3163@{#170}
Cr-Branched-From: ff259bab28b35d242e10186cd63af7ed404fae0d-refs/heads/master@{#488528}
[modify] https://crrev.com/e4d934b8951f910c65a4276d4d30478f587fbe9b/cc/trees/damage_tracker.cc
[modify] https://crrev.com/e4d934b8951f910c65a4276d4d30478f587fbe9b/cc/trees/damage_tracker_unittest.cc

Comment 14 by dchan@chromium.org, Jan 22 2018

Status: Archived (was: Fixed)

Sign in to add a comment