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

Issue 756696 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug

Blocked on:
issue 774224
issue 774242

Blocking:
issue 753224



Sign in to add a comment

Use trilinear filtering and Cache render surface in overview mode.

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

Issue description

To get better image quality when we are scaling down windows in overview mode, we can apply the trilinear filtering. At the same time we cache the render surface for good performance and reduced overdraw.
 

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

Blocking: 753224

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

Cc: varkha@chromium.org
+varkha@.

Continue the discussion in the cl:
When entering overview mode, we only call transform_window_.SetTransform [1] so there is no opacity animation, so no render surface.
When existing overview mode, we do call additional SetOpacity [2], so we have opacity in the animation. Therefore we created the render surface?

[1] https://cs.chromium.org/chromium/src/ash/wm/overview/window_selector_item.cc?l=677&rcl=65c8da95cbc89501e08ba28cd3bc9d308f20a026
[2] https://cs.chromium.org/chromium/src/ash/wm/overview/scoped_transform_overview_window.cc?l=197&rcl=6239bc6b7d27a33b9498fb237dd8a0553cfe3362



Comment 3 by wutao@chromium.org, Aug 18 2017

#2, removed the SetOpacity here [1], can remove the render surface when exiting overview mode.
And seems the SetOpacity does not do anything.

[1] https://cs.chromium.org/chromium/src/ash/wm/overview/scoped_transform_overview_window.cc?l=197&rcl=6239bc6b7d27a33b9498fb237dd8a0553cfe3362

Comment 4 by wutao@chromium.org, Aug 18 2017

I do see huge improvement by just cache the render surface during animation:

5 browser windows, 30x slow-down-compositiong-scale-factor=30
Linux builds: ~55%

On Kevin, I must use long animation duration (10s) to see ~15% improvement.


Comment 5 by varkha@google.com, Aug 18 2017

Does it still properly dim the items other than selected when text filter is on?

Comment 6 by varkha@chromium.org, Aug 18 2017

#4, that's nice, what do the improvement numbers mean?

Comment 7 by wutao@chromium.org, Aug 18 2017

#5, thanks, I see this SetOpacity for now. The caching render surface does not need to remove the code of SetOpacity.

#6, sorry for the confusion. The numbers are:
When I tested overview mode animation in linux builds, I opened 5 blank browsers, and to repeatedly draw render surface 30 times (which is to simulate slower machine), the mean of histogram Ash.WindowSelector.AnimationSmoothness.Enter was improved from 55% to 85%, about ~55% improvement.


Components: Internals>Compositing

Comment 9 by wutao@chromium.org, Oct 11 2017

We plan to turn on render surface caching and trilinear filtering in overview mode at the same time.

The difficulty part is that to keep caching and filtering all there phases during overview mode: 1) entering animation, 2) staying in the overview mode, 3) exiting animation.

There seems no single place we can add and remove the caching and filtering requests. But what we can do is do it multiple times: 1) + 2) can be achieved add/remove requests in ScopedTransformOverviewWindow::PrepareForOverview/RestoreWindow. For 3), we can add/remove requests on beginning/ending of the exiting animation.

I wonder should we make the ui::Layer::SetTrilinearFiltering API similar to ui::Layer::AddCacheRenderSurfaceRequest with a request counter. And add rilinearFilteringObserver in scoped layer animation settings similar to RenderSurfaceObserver?

Comment 10 by wutao@chromium.org, Oct 11 2017

Summary: Use trilinear filtering and Cache render surface in overview animation. (was: Cache render surface in overview animation.)

Comment 11 by wutao@chromium.org, Oct 11 2017

Description: Show this description

Comment 12 by wutao@chromium.org, Oct 11 2017

Summary: Use trilinear filtering and Cache render surface in overview mode. (was: Use trilinear filtering and Cache render surface in overview animation.)
Add/Remove API is fine with me if that's the best solution here too.

Comment 14 by wutao@chromium.org, Oct 12 2017

Maybe we make it a little complicated to Add/Remove trilinear request API. But just in case multiple places (and/or animations) try to set/unset the trilinear filtering on the same layer.

Comment 15 by wutao@chromium.org, Oct 12 2017

Blockedon: 774224

Comment 16 by wutao@chromium.org, Oct 12 2017

Blockedon: 774242

Comment 17 by wutao@chromium.org, Oct 12 2017

Cc: piman@chromium.org
The trilinear filtering results look terrific!
Thanks reveman@!
without_trilinear_filtering.png
1.1 MB View Download
with_trilinear_filtering.png
1.1 MB View Download

Comment 18 by wutao@chromium.org, Oct 13 2017

Cc: abodenha@chromium.org kaznacheev@chromium.org
Uploaded a cl to: https://chromium-review.googlesource.com/c/chromium/src/+/717725

I had limited number of tests on how much the caching render surface + defer painting combination can improve the overview animation smoothness.

On linux build (Z840), --slow-down-compositing-scale-factor=30, with 5 blank chrome browsers with maximized size. The 10 times of average results are about:
~33% improvement for enter animation.
~48% improvement for exit animation.
Those number might be very different than real device and are different than in the comment of #7. UMA will let us know the real improvement later.

Details are:
enter/exit animation smoothness (%, 100% is ideal frame per second)

1. Current ToT code:                                       48.2%/41.2%
2. DeferPaint:                                             54.9%/43.0%
3. TrilinearFiltering:                                     45.8%/37.6%
4. DeferPaint + TrilinearFiltering:                        52.4%/38.4%
5. CachingRenderSurface:                                   52.4%/50.8%
6. TrilinearFiltering + CachingRenderSurface:              54/1%/50.0%
7. DeferPaint + CachingRenderSurface:                      65.3%/59.9%
8. DeferPaint + TrilinearFiltering + CachingRenderSurface: 64.2%/61.0%


Cc: puneetster@chromium.org
Really exciting to see all this come together! If we could get mipmaps and caching turned on for window switcher as well in M63 that would be awesome!

Btw, we have one level of fullscreen overdraw in overview mode just because we dim the background using a solid color layer with opacity. I think we should switch that to setting brightness for the wallpaper layer instead and make sure the compositor implements that efficiently. We can probably use the color matrix like we're looking at doing for the night mode color temperature effect.

Comment 20 by wutao@chromium.org, Oct 13 2017

# 19, sg! I will work on the wallpaper dimmer.

Comment 21 by wutao@chromium.org, Oct 13 2017

Components: -Internals>Compositing UI>Shell>OverviewMode
Labels: -M-62 M-63
#19, created other two issues for:
Wallpaper dimmer in overview mode:
https://bugs.chromium.org/p/chromium/issues/detail?id=774690

Using mipmaps and caching turned on for window switcher:
https://bugs.chromium.org/p/chromium/issues/detail?id=773841

Project Member

Comment 22 by bugdroid1@chromium.org, Oct 17 2017

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

commit 2a577cfa8d7c87946f9335fe5ee831b322da7fda
Author: wutao <wutao@chromium.org>
Date: Tue Oct 17 01:05:59 2017

Use trilinear filtering and Cache render surface in overview mode.

To get better image quality when we are scaling down windows in overview
mode, we can apply the trilinear filtering. At the same time we cache
the render surface for good performance and reduced overdraw.

without trilinear filtering:
with trilinear filtering:

Bug:  756696 
Test: Tested local
Change-Id: I12765172efec921c9336b32f0aa3fa8ba7e78f35
Screenshot: 
https: //screenshot.googleplex.com/MYU3w3ff6s0
https: //screenshot.googleplex.com/AqGiVp4eh43
Reviewed-on: https://chromium-review.googlesource.com/717725
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Valery Arkhangorodsky <varkha@chromium.org>
Reviewed-by: David Reveman <reveman@chromium.org>
Commit-Queue: Tao Wu <wutao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#509198}
[modify] https://crrev.com/2a577cfa8d7c87946f9335fe5ee831b322da7fda/ash/wm/overview/scoped_overview_animation_settings.cc
[modify] https://crrev.com/2a577cfa8d7c87946f9335fe5ee831b322da7fda/ash/wm/overview/scoped_overview_animation_settings.h
[modify] https://crrev.com/2a577cfa8d7c87946f9335fe5ee831b322da7fda/ash/wm/overview/scoped_transform_overview_window.cc
[modify] https://crrev.com/2a577cfa8d7c87946f9335fe5ee831b322da7fda/ash/wm/overview/scoped_transform_overview_window.h
[modify] https://crrev.com/2a577cfa8d7c87946f9335fe5ee831b322da7fda/testing/buildbot/filters/ash_unittests_mash.filter
[modify] https://crrev.com/2a577cfa8d7c87946f9335fe5ee831b322da7fda/testing/buildbot/filters/ash_unittests_mus.filter

Comment 23 by wutao@chromium.org, Oct 17 2017

Labels: Merge-Request-63
Project Member

Comment 24 by sheriffbot@chromium.org, Oct 18 2017

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

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

Comment 25 by bugdroid1@chromium.org, Oct 18 2017

Labels: -merge-approved-63 merge-merged-3239
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c4567563e222638c0d3c3f6d80be808614f34b7d

commit c4567563e222638c0d3c3f6d80be808614f34b7d
Author: wutao <wutao@chromium.org>
Date: Wed Oct 18 01:47:27 2017

[Merge M63] Use trilinear filtering and Cache render surface in overview mode.

To get better image quality when we are scaling down windows in overview
mode, we can apply the trilinear filtering. At the same time we cache
the render surface for good performance and reduced overdraw.

TBR=reveman@chromium.org,varkha@chromium.org

Bug:  756696 
Test: Tested local
Change-Id: I12765172efec921c9336b32f0aa3fa8ba7e78f35
Screenshot: 
https: //screenshot.googleplex.com/MYU3w3ff6s0
https: //screenshot.googleplex.com/AqGiVp4eh43
Reviewed-on: https://chromium-review.googlesource.com/717725
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Valery Arkhangorodsky <varkha@chromium.org>
Reviewed-by: David Reveman <reveman@chromium.org>
Commit-Queue: Tao Wu <wutao@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#509198}(cherry picked from commit 2a577cfa8d7c87946f9335fe5ee831b322da7fda)
Reviewed-on: https://chromium-review.googlesource.com/724740
Reviewed-by: Tao Wu <wutao@chromium.org>
Cr-Commit-Position: refs/branch-heads/3239@{#42}
Cr-Branched-From: adb61db19020ed8ecee5e91b1a0ea4c924ae2988-refs/heads/master@{#508578}
[modify] https://crrev.com/c4567563e222638c0d3c3f6d80be808614f34b7d/ash/wm/overview/scoped_overview_animation_settings.cc
[modify] https://crrev.com/c4567563e222638c0d3c3f6d80be808614f34b7d/ash/wm/overview/scoped_overview_animation_settings.h
[modify] https://crrev.com/c4567563e222638c0d3c3f6d80be808614f34b7d/ash/wm/overview/scoped_transform_overview_window.cc
[modify] https://crrev.com/c4567563e222638c0d3c3f6d80be808614f34b7d/ash/wm/overview/scoped_transform_overview_window.h
[modify] https://crrev.com/c4567563e222638c0d3c3f6d80be808614f34b7d/testing/buildbot/filters/ash_unittests_mash.filter
[modify] https://crrev.com/c4567563e222638c0d3c3f6d80be808614f34b7d/testing/buildbot/filters/ash_unittests_mus.filter

Status: Fixed (was: Available)

Sign in to add a comment