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

Issue 761109 link

Starred by 1 user

Issue metadata

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



Sign in to add a comment

Add API to defer ui::Layer paint.

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

Issue description

We want a mechanism to defer ui::Layer paint during animation.
Any scheduled damage update during animation will be accumulated and draw at the end of animation.

The can be used with CacheRenderSurface. Recently we added an observer to request render surface cache at the beginning of the animation, and remove the request at the end of animation.
Similarly, we can do the same thing for defer paint.


 
Project Member

Comment 1 by bugdroid1@chromium.org, Sep 26 2017

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

commit 61373a39633bcfd8e8db030e882fd58b421ecee9
Author: wutao <wutao@chromium.org>
Date: Tue Sep 26 18:45:35 2017

Add deferred paint API to ui::Layer.

We want a mechanism to defer ui::Layer painting during animation.
There are two benefits. First, we will not do layer compositing and
rasterization at the same time. Second, we can cache the render surface
of the animating layer. In deferred paint mode, the |damaged_region_| in
SchedulePaint() will be accumulated and drawn after the deferred paint
request is removed.

Changes:
1. Added APIs of [Add|Remove]DeferredPaintRequest().
2. Modified SchedulePaint() and SendDamagedRects() to defer painting.

Bug:  761109 
Test: linux build and device.
Change-Id: I7d9710b7a6e758b6a70550d62e9cbce64333ee6b
Reviewed-on: https://chromium-review.googlesource.com/646906
Commit-Queue: Tao Wu <wutao@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: David Reveman <reveman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504438}
[modify] https://crrev.com/61373a39633bcfd8e8db030e882fd58b421ecee9/ui/compositor/layer.cc
[modify] https://crrev.com/61373a39633bcfd8e8db030e882fd58b421ecee9/ui/compositor/layer.h
[modify] https://crrev.com/61373a39633bcfd8e8db030e882fd58b421ecee9/ui/compositor/layer_unittest.cc

Project Member

Comment 2 by bugdroid1@chromium.org, Oct 4 2017

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

commit 7ba7cc88e81f7045e5459ff591f65fc4ab77756c
Author: wutao <wutao@chromium.org>
Date: Wed Oct 04 00:40:35 2017

Add DeferredPaintObserver to ScopedLayerAnimationSettings.

We want to defer layer painting during some UI animations so that we can
avoid resterization at the same time and we can cache the render suface
of the animating layer. Adding an observer to
ScopedLayerAnimationSettings can AddDeferredPaintRequest and
RemoveDeferredPaintRequest at the beginning and end of the animation.

Bug:  761109 
Test: LayerAnimatorTest.DeferredPaint*
Change-Id: If5e7afb7d2564f5ff480438447eabd10fca799ab
Reviewed-on: https://chromium-review.googlesource.com/685493
Commit-Queue: Tao Wu <wutao@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: David Reveman <reveman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506253}
[modify] https://crrev.com/7ba7cc88e81f7045e5459ff591f65fc4ab77756c/ui/compositor/layer.h
[modify] https://crrev.com/7ba7cc88e81f7045e5459ff591f65fc4ab77756c/ui/compositor/layer_animator.cc
[modify] https://crrev.com/7ba7cc88e81f7045e5459ff591f65fc4ab77756c/ui/compositor/layer_animator.h
[modify] https://crrev.com/7ba7cc88e81f7045e5459ff591f65fc4ab77756c/ui/compositor/layer_animator_unittest.cc
[modify] https://crrev.com/7ba7cc88e81f7045e5459ff591f65fc4ab77756c/ui/compositor/scoped_layer_animation_settings.cc
[modify] https://crrev.com/7ba7cc88e81f7045e5459ff591f65fc4ab77756c/ui/compositor/scoped_layer_animation_settings.h

Project Member

Comment 3 by bugdroid1@chromium.org, Oct 4 2017

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

commit 2a510e5a37b14028b4414d0cfff4a509d74a34b6
Author: Kentaro Hara <haraken@chromium.org>
Date: Wed Oct 04 05:05:55 2017

Revert "Add DeferredPaintObserver to ScopedLayerAnimationSettings."

This reverts commit 7ba7cc88e81f7045e5459ff591f65fc4ab77756c.

Reason for revert: This broke LayerAnimatorTest on Linux Chromium OS ASan LSan Tests.


Original change's description:
> Add DeferredPaintObserver to ScopedLayerAnimationSettings.
> 
> We want to defer layer painting during some UI animations so that we can
> avoid resterization at the same time and we can cache the render suface
> of the animating layer. Adding an observer to
> ScopedLayerAnimationSettings can AddDeferredPaintRequest and
> RemoveDeferredPaintRequest at the beginning and end of the animation.
> 
> Bug:  761109 
> Test: LayerAnimatorTest.DeferredPaint*
> Change-Id: If5e7afb7d2564f5ff480438447eabd10fca799ab
> Reviewed-on: https://chromium-review.googlesource.com/685493
> Commit-Queue: Tao Wu <wutao@chromium.org>
> Reviewed-by: Antoine Labour <piman@chromium.org>
> Reviewed-by: David Reveman <reveman@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#506253}

TBR=reveman@chromium.org,ajuma@chromium.org,varkha@chromium.org,piman@chromium.org,wutao@chromium.org

Change-Id: I975cf1d908101bf9f97ca2fe68a74805fc1d17a9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug:  761109 
Reviewed-on: https://chromium-review.googlesource.com/700214
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506305}
[modify] https://crrev.com/2a510e5a37b14028b4414d0cfff4a509d74a34b6/ui/compositor/layer.h
[modify] https://crrev.com/2a510e5a37b14028b4414d0cfff4a509d74a34b6/ui/compositor/layer_animator.cc
[modify] https://crrev.com/2a510e5a37b14028b4414d0cfff4a509d74a34b6/ui/compositor/layer_animator.h
[modify] https://crrev.com/2a510e5a37b14028b4414d0cfff4a509d74a34b6/ui/compositor/layer_animator_unittest.cc
[modify] https://crrev.com/2a510e5a37b14028b4414d0cfff4a509d74a34b6/ui/compositor/scoped_layer_animation_settings.cc
[modify] https://crrev.com/2a510e5a37b14028b4414d0cfff4a509d74a34b6/ui/compositor/scoped_layer_animation_settings.h

Project Member

Comment 4 by bugdroid1@chromium.org, Oct 4 2017

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

commit 87aebf77ded8a984ffc11c387670556852da6843
Author: wutao <wutao@chromium.org>
Date: Wed Oct 04 05:28:08 2017

Clean up ScheduleDraw in ui::Layer.

layer_mask_->ScheduleDraw() is redundant with this->ScheduleDraw(). It
has the same value to GetCompositor(), and Compositor::ScheduleDraw is
idempotent.

Bug:  761109 
Change-Id: I905b933a7d37069cb3117171ac05d88369df98df
Reviewed-on: https://chromium-review.googlesource.com/699150
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Tao Wu <wutao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506310}
[modify] https://crrev.com/87aebf77ded8a984ffc11c387670556852da6843/ui/compositor/layer.cc

Project Member

Comment 5 by bugdroid1@chromium.org, Oct 5 2017

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

commit 4f1c0d5dfb68e1e86b33a99b798d8aaf27c280b9
Author: wutao <wutao@chromium.org>
Date: Thu Oct 05 01:02:43 2017

Reland: Add DeferredPaintObserver to ScopedLayerAnimationSettings.

We want to defer layer painting during some UI animations so that we can
avoid resterization at the same time and we can cache the render suface
of the animating layer. Adding an observer to
ScopedLayerAnimationSettings can AddDeferredPaintRequest and
RemoveDeferredPaintRequest at the beginning and end of the animation.

Bug= 761109 
Test=LayerAnimatorTest.DeferredPaint*

Change-Id: I319c52f8f00b402d84363c7f926b0a376e07458c
Reviewed-on: https://chromium-review.googlesource.com/700357
Reviewed-by: David Reveman <reveman@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Tao Wu <wutao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506598}
[modify] https://crrev.com/4f1c0d5dfb68e1e86b33a99b798d8aaf27c280b9/ui/compositor/layer.h
[modify] https://crrev.com/4f1c0d5dfb68e1e86b33a99b798d8aaf27c280b9/ui/compositor/layer_animator.cc
[modify] https://crrev.com/4f1c0d5dfb68e1e86b33a99b798d8aaf27c280b9/ui/compositor/layer_animator.h
[modify] https://crrev.com/4f1c0d5dfb68e1e86b33a99b798d8aaf27c280b9/ui/compositor/layer_animator_unittest.cc
[modify] https://crrev.com/4f1c0d5dfb68e1e86b33a99b798d8aaf27c280b9/ui/compositor/scoped_layer_animation_settings.cc
[modify] https://crrev.com/4f1c0d5dfb68e1e86b33a99b798d8aaf27c280b9/ui/compositor/scoped_layer_animation_settings.h

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

Status: Fixed (was: Available)

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

Status: Archived (was: Fixed)

Comment 8 by dchan@chromium.org, Jan 23 2018

Status: Fixed (was: Archived)

Sign in to add a comment