New issue
Advanced search Search tips

Issue 885182 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug



Sign in to add a comment

Avoid unneeded swapchain recreation in Windows

Project Member Reported by magchen@chromium.org, Sep 18

Issue description

Chrome Version: (M71)
OS: (Win10)

These two kinds of swapchain recreation can be avoided or reduced.
(1) switching between overlay and underlay from the same video
(2) video resizing.


 
Project Member

Comment 1 by bugdroid1@chromium.org, Oct 4

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

commit 653ce95108b8f4bb2e1014489a36ffe29bb0e255
Author: Maggie Chen <magchen@chromium.org>
Date: Thu Oct 04 01:13:23 2018

Prevent frequent overlay swapchain recreation in Windows

When there is a new swapchain size request, don't recreate a new swapchain
immediately. Instead, use the previous swapchain size until the the new size
has been requested for 30 frames. Then create a new swapchain with the new size.
We can achieve the same onscreen video size by adding this size delta to the
transform matrix calculation.

Bug:885182

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I846b8bcb0753a9bd9ccce8329354dc55decc1481
Reviewed-on: https://chromium-review.googlesource.com/c/1235316
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Sunny Sachanandani <sunnyps@chromium.org>
Commit-Queue: Maggie Chen <magchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596463}
[modify] https://crrev.com/653ce95108b8f4bb2e1014489a36ffe29bb0e255/gpu/ipc/service/direct_composition_surface_win.cc
[modify] https://crrev.com/653ce95108b8f4bb2e1014489a36ffe29bb0e255/gpu/ipc/service/direct_composition_surface_win.h
[modify] https://crrev.com/653ce95108b8f4bb2e1014489a36ffe29bb0e255/gpu/ipc/service/direct_composition_surface_win_unittest.cc

Project Member

Comment 2 by bugdroid1@chromium.org, Dec 4

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

commit 620efd1d06d880f5371c2e7eac8a034e43ce70d3
Author: Sunny Sachanandani <sunnyps@chromium.org>
Date: Tue Dec 04 20:22:19 2018

Use ResizeBuffers instead of recreating swap chains on resize

This CL implements changing size, format, and flags for both root
surface and video by calling ResizeBuffers.  This is the recommended
method for resizing, and doesn't seem to be prone to flashing, and other
issues that require waiting for all commands to finish.  However, the
implementation has a fallback to recreating swap chain if ResizeBuffers
fails, or when it can't be used e.g. for changing alpha blending mode.

This seems fast enough to not need the resize after 30 frames
workaround which is removed in this CL.

This CL also includes cleanup of the root surface code so that it's not
unnecessarily recreated on any change.

Also, add a histogram to track resize failures and update the swap chain
creation result histogram to emit an HRESULT error code so that we don't
have to look at DumpWithCrashing dumps to figure that out.

Bug: 885182
Change-Id: Ic6898c6adaaae7d74742a3c683d47663c54fd1c8
Reviewed-on: https://chromium-review.googlesource.com/c/1305198
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
Reviewed-by: Ilya Sherman <isherman@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#613674}
[modify] https://crrev.com/620efd1d06d880f5371c2e7eac8a034e43ce70d3/gpu/ipc/service/direct_composition_child_surface_win.cc
[modify] https://crrev.com/620efd1d06d880f5371c2e7eac8a034e43ce70d3/gpu/ipc/service/direct_composition_child_surface_win.h
[modify] https://crrev.com/620efd1d06d880f5371c2e7eac8a034e43ce70d3/gpu/ipc/service/direct_composition_surface_win.cc
[modify] https://crrev.com/620efd1d06d880f5371c2e7eac8a034e43ce70d3/gpu/ipc/service/direct_composition_surface_win.h
[modify] https://crrev.com/620efd1d06d880f5371c2e7eac8a034e43ce70d3/gpu/ipc/service/direct_composition_surface_win_unittest.cc
[modify] https://crrev.com/620efd1d06d880f5371c2e7eac8a034e43ce70d3/gpu/ipc/service/image_transport_surface_win.cc
[modify] https://crrev.com/620efd1d06d880f5371c2e7eac8a034e43ce70d3/tools/metrics/histograms/histograms.xml

Sign in to add a comment